mirror of https://github.com/vapor/docs.git
Merge pull request #103 from codesman/master
Added info & fixed typos for Toolbox --template & Leaf #index
This commit is contained in:
commit
680b96a886
|
|
@ -27,6 +27,9 @@ Make sure the Toolbox installed successfully by running the help query. You shou
|
|||
```sh
|
||||
vapor --help
|
||||
```
|
||||
## Create A Project
|
||||
|
||||
Now that you have installed the Toolbox, you can create your first Vapor project following the [Hello, World guide](hello-world.md).
|
||||
|
||||
### Updating
|
||||
|
||||
|
|
@ -36,6 +39,19 @@ The toolbox can update itself. This may be useful if you experience any issues i
|
|||
vapor self update
|
||||
```
|
||||
|
||||
## Create A Project
|
||||
### Templates
|
||||
|
||||
Now that you have installed the Toolbox, you can create your first Vapor project following the [Hello, World guide](hello-world.md).
|
||||
The toolbox can create a project from the Vapor basic-template or any other git repo.
|
||||
|
||||
```sh
|
||||
vapor new <name> [--template=<repo-url-or-github-path>]
|
||||
```
|
||||
|
||||
The toolbox will build an absolute URL based on what you pass as the template option. If you do not specify a template option, the project will be built from the Vapor basic-template.
|
||||
|
||||
```sh
|
||||
Default(no template option specified) => https://github.com/vapor/basic-template
|
||||
http(s)://example.com/repo-path => http(s)://example.com/repo-path
|
||||
user/repo => https://github.com/user/repo
|
||||
light => https://github.com/vapor/light-template
|
||||
```
|
||||
|
|
|
|||
|
|
@ -85,10 +85,11 @@ Hello, #(name)!
|
|||
Hello, #(friend.name)!
|
||||
}
|
||||
```
|
||||
#### Index: `#loop(object, "index")`
|
||||
#### Index: `#index(object, _ index: Int|String)`
|
||||
|
||||
```
|
||||
Hello, #index(friends, "0")!
|
||||
Hello, #index(friends, 0)!
|
||||
Hello, #index(friends, "best")!
|
||||
```
|
||||
|
||||
#### If - Else: `#if(bool) ##else() { this }`
|
||||
|
|
@ -155,7 +156,7 @@ We can now register this Tag in our `main.swift` file with:
|
|||
|
||||
```swift
|
||||
if let leaf = drop.view as? LeafRenderer {
|
||||
leaf.stem.register(Version())
|
||||
leaf.stem.register(Index())
|
||||
}
|
||||
```
|
||||
|
||||
|
|
@ -182,3 +183,7 @@ There appears to be a way to [make Xcode file associations persist](http://stack
|
|||
### CLion & AppCode
|
||||
|
||||
Some preliminary work has been done to implement a Leaf Plugin for CLion & AppCode but lack of skill and interest in Java has slowed progress! If you have IntelliJ SDK experience and want to help with this, message Tom Holland on [Vapor Slack](http://vapor.team)
|
||||
|
||||
### VS Code
|
||||
|
||||
[html-leaf](https://marketplace.visualstudio.com/items?itemName=Francisco.html-leaf) by FranciscoAmado
|
||||
|
|
|
|||
Loading…
Reference in New Issue