Merge branch 'master' into dynamic-filter
# Conflicts: # CHANGELOG.md # Sources/ForTag.swift # Sources/IfTag.swift # Sources/Parser.swift # Sources/Variable.swift # Tests/StencilTests/ExpressionSpec.swift # Tests/StencilTests/FilterSpec.swift # Tests/StencilTests/ForNodeSpec.swift # Tests/StencilTests/VariableSpec.swift
This commit is contained in:
2
docs/_templates/sidebar_intro.html
vendored
2
docs/_templates/sidebar_intro.html
vendored
@@ -2,7 +2,7 @@
|
||||
|
||||
<p>
|
||||
<iframe
|
||||
src="https://ghbtns.com/github-btn.html?user=kylef&repo=Stencil&type=watch&count=true&size=large"
|
||||
src="https://ghbtns.com/github-btn.html?user=stencilproject&repo=Stencil&type=watch&count=true&size=large"
|
||||
allowtransparency="true" frameborder="0" scrolling="0" width="200px" height="35px">
|
||||
</iframe>
|
||||
</p>
|
||||
|
||||
@@ -149,6 +149,19 @@ Will be treated as:
|
||||
|
||||
one or (two and three)
|
||||
|
||||
You can use parentheses to change operator precedence. For example:
|
||||
|
||||
.. code-block:: html+django
|
||||
|
||||
{% if (one or two) and three %}
|
||||
|
||||
Will be treated as:
|
||||
|
||||
.. code-block:: text
|
||||
|
||||
(one or two) and three
|
||||
|
||||
|
||||
``==`` operator
|
||||
"""""""""""""""
|
||||
|
||||
|
||||
@@ -58,9 +58,9 @@ author = 'Kyle Fuller'
|
||||
# built documents.
|
||||
#
|
||||
# The short X.Y version.
|
||||
version = '0.7.0'
|
||||
version = '0.13.1'
|
||||
# The full version, including alpha/beta/rc tags.
|
||||
release = '0.7.0'
|
||||
release = '0.13.1'
|
||||
|
||||
# The language for content autogenerated by Sphinx. Refer to documentation
|
||||
# for a list of supported languages.
|
||||
|
||||
@@ -48,6 +48,17 @@ Registering custom filters with arguments:
|
||||
return value
|
||||
}
|
||||
|
||||
Registering custom boolean filters:
|
||||
|
||||
.. code-block:: swift
|
||||
|
||||
ext.registerFilter("ordinary", negativeFilterName: "odd") { (value: Any?) in
|
||||
if let value = value as? Int {
|
||||
return myInt % 2 == 0
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
Custom Tags
|
||||
-----------
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ dependencies inside ``Package.swift``.
|
||||
let package = Package(
|
||||
name: "MyApplication",
|
||||
dependencies: [
|
||||
.Package(url: "https://github.com/kylef/Stencil.git", majorVersion: 0, minor: 8),
|
||||
.Package(url: "https://github.com/stencilproject/Stencil.git", majorVersion: 0, minor: 13),
|
||||
]
|
||||
)
|
||||
|
||||
@@ -26,7 +26,7 @@ If you're using CocoaPods, you can add Stencil to your ``Podfile`` and then run
|
||||
|
||||
.. code-block:: ruby
|
||||
|
||||
pod 'Stencil', '~> 0.8.0'
|
||||
pod 'Stencil', '~> 0.13.1'
|
||||
|
||||
Carthage
|
||||
--------
|
||||
@@ -37,7 +37,7 @@ Carthage
|
||||
|
||||
.. code-block:: text
|
||||
|
||||
github "kylef/Stencil" ~> 0.8.0
|
||||
github "stencilproject/Stencil" ~> 0.13.1
|
||||
|
||||
2) Checkout your dependencies, generate the Stencil Xcode project, and then use Carthage to build Stencil:
|
||||
|
||||
|
||||
@@ -20,9 +20,9 @@ following lookup:
|
||||
|
||||
- Context lookup
|
||||
- Dictionary lookup
|
||||
- Array lookup (first, last, count, index)
|
||||
- Array and string lookup (first, last, count, by index)
|
||||
- Key value coding lookup
|
||||
- Type introspection
|
||||
- Type introspection (via ``Mirror``)
|
||||
|
||||
For example, if `people` was an array:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user