From 37092ddb20344ea98db09dd4c2d348853008eccf Mon Sep 17 00:00:00 2001 From: tanner0101 Date: Wed, 12 Apr 2017 17:07:03 +0200 Subject: [PATCH] leaf package --- 2.0/docs/leaf/package.md | 43 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 2.0/docs/leaf/package.md diff --git a/2.0/docs/leaf/package.md b/2.0/docs/leaf/package.md new file mode 100644 index 00000000..39f70774 --- /dev/null +++ b/2.0/docs/leaf/package.md @@ -0,0 +1,43 @@ +# Using Leaf + +This section outlines how to import the Leaf package both with or without a Vapor project. + +## With Vapor + +The easiest way to use Leaf with Vapor is to include the Leaf provider. + +```swift +import PackageDescription + +let package = Package( + name: "Project", + dependencies: [ + .Package(url: "https://github.com/vapor/vapor.git", majorVersion: 2), + .Package(url: "https://github.com/vapor/leaf-provider.git", majorVersion: 1) + ], + exclude: [ ... ] +) +``` + +The Leaf provider package adds Leaf to your project and adds some additional, Vapor-specific conveniences like `drop.stem()`. + +Use `import LeafProvider`. + +## Just Leaf + +At the core of the Leaf provider is a fast, pure Swift templating engine. You can use it with any of your Swift packages or server-side Swift applications. + +```swift +import PackageDescription + +let package = Package( + name: "Project", + dependencies: [ + ... + .Package(url: "https://github.com/vapor/leaf.git", majorVersion: 2) + ], + exclude: [ ... ] +) +``` + +Use `import Leaf` to access the `Leaf.Stem` class.