Compare commits
9 Commits
0.15.0
...
973609e141
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
973609e141 | ||
|
|
644687b885 | ||
|
|
4f222ac85d | ||
|
|
3a98d1ef7d | ||
|
|
95a24b950f | ||
|
|
a3df900bd2 | ||
|
|
59b0c176c7 | ||
|
|
bc5051ffe3 | ||
|
|
9444ee5c86 |
@@ -1,3 +1,11 @@
|
|||||||
|
## 0.15.1
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
- Fix bug in `LazyValueWrapper`, causing it to never resolve.
|
||||||
|
[David Jennes](https://github.com/djbe)
|
||||||
|
[#328](https://github.com/stencilproject/Stencil/pull/328)
|
||||||
|
|
||||||
## 0.15.0
|
## 0.15.0
|
||||||
|
|
||||||
### Breaking
|
### Breaking
|
||||||
|
|||||||
@@ -61,9 +61,3 @@ extension LazyValueWrapper: Resolvable {
|
|||||||
return try (value as? Resolvable)?.resolve(context) ?? value
|
return try (value as? Resolvable)?.resolve(context) ?? value
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
extension LazyValueWrapper: Normalizable {
|
|
||||||
public func normalize() -> Any? {
|
|
||||||
(cachedValue as? Normalizable)?.normalize() ?? cachedValue
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -110,16 +110,16 @@ public struct Variable: Equatable, Resolvable {
|
|||||||
return resolve(bit: bit, collection: array)
|
return resolve(bit: bit, collection: array)
|
||||||
} else if let string = context as? String {
|
} else if let string = context as? String {
|
||||||
return resolve(bit: bit, collection: string)
|
return resolve(bit: bit, collection: string)
|
||||||
|
} else if let value = context as? DynamicMemberLookup {
|
||||||
|
return value[dynamicMember: bit]
|
||||||
} else if let object = context as? NSObject { // NSKeyValueCoding
|
} else if let object = context as? NSObject { // NSKeyValueCoding
|
||||||
#if os(Linux)
|
#if !canImport(ObjectiveC)
|
||||||
return nil
|
return nil
|
||||||
#else
|
#else
|
||||||
if object.responds(to: Selector(bit)) {
|
if object.responds(to: Selector(bit)) {
|
||||||
return object.value(forKey: bit)
|
return object.value(forKey: bit)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
} else if let value = context as? DynamicMemberLookup {
|
|
||||||
return value[dynamicMember: bit]
|
|
||||||
} else if let value = context {
|
} else if let value = context {
|
||||||
return Mirror(reflecting: value).getValue(for: bit)
|
return Mirror(reflecting: value).getValue(for: bit)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "Stencil",
|
"name": "Stencil",
|
||||||
"version": "0.15.0",
|
"version": "0.15.1",
|
||||||
"summary": "Stencil is a simple and powerful template language for Swift.",
|
"summary": "Stencil is a simple and powerful template language for Swift.",
|
||||||
"homepage": "https://stencil.fuller.li",
|
"homepage": "https://stencil.fuller.li",
|
||||||
"license": {
|
"license": {
|
||||||
@@ -13,7 +13,7 @@
|
|||||||
"social_media_url": "https://twitter.com/kylefuller",
|
"social_media_url": "https://twitter.com/kylefuller",
|
||||||
"source": {
|
"source": {
|
||||||
"git": "https://github.com/stencilproject/Stencil.git",
|
"git": "https://github.com/stencilproject/Stencil.git",
|
||||||
"tag": "0.15.0"
|
"tag": "0.15.1"
|
||||||
},
|
},
|
||||||
"source_files": [
|
"source_files": [
|
||||||
"Sources/Stencil/*.swift"
|
"Sources/Stencil/*.swift"
|
||||||
|
|||||||
@@ -58,9 +58,9 @@ author = 'Kyle Fuller'
|
|||||||
# built documents.
|
# built documents.
|
||||||
#
|
#
|
||||||
# The short X.Y version.
|
# The short X.Y version.
|
||||||
version = '0.15.0'
|
version = '0.15.1'
|
||||||
# The full version, including alpha/beta/rc tags.
|
# The full version, including alpha/beta/rc tags.
|
||||||
release = '0.15.0'
|
release = '0.15.1'
|
||||||
|
|
||||||
# The language for content autogenerated by Sphinx. Refer to documentation
|
# The language for content autogenerated by Sphinx. Refer to documentation
|
||||||
# for a list of supported languages.
|
# for a list of supported languages.
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ dependencies inside ``Package.swift``.
|
|||||||
let package = Package(
|
let package = Package(
|
||||||
name: "MyApplication",
|
name: "MyApplication",
|
||||||
dependencies: [
|
dependencies: [
|
||||||
.package(url: "https://github.com/stencilproject/Stencil.git", from: "0.15.0"),
|
.package(url: "https://github.com/stencilproject/Stencil.git", from: "0.15.1"),
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -26,7 +26,7 @@ If you're using CocoaPods, you can add Stencil to your ``Podfile`` and then run
|
|||||||
|
|
||||||
.. code-block:: ruby
|
.. code-block:: ruby
|
||||||
|
|
||||||
pod 'Stencil', '~> 0.15.0'
|
pod 'Stencil', '~> 0.15.1'
|
||||||
|
|
||||||
Carthage
|
Carthage
|
||||||
--------
|
--------
|
||||||
@@ -37,7 +37,7 @@ Carthage
|
|||||||
|
|
||||||
.. code-block:: text
|
.. code-block:: text
|
||||||
|
|
||||||
github "stencilproject/Stencil" ~> 0.15.0
|
github "stencilproject/Stencil" ~> 0.15.1
|
||||||
|
|
||||||
2) Checkout your dependencies, generate the Stencil Xcode project, and then use Carthage to build Stencil:
|
2) Checkout your dependencies, generate the Stencil Xcode project, and then use Carthage to build Stencil:
|
||||||
|
|
||||||
|
|||||||
@@ -113,12 +113,10 @@ To comment out part of your template, you can use the following syntax:
|
|||||||
|
|
||||||
{# My comment is completely hidden #}
|
{# My comment is completely hidden #}
|
||||||
|
|
||||||
.. _template-inheritance:
|
|
||||||
|
|
||||||
Whitespace Control
|
Whitespace Control
|
||||||
------------------
|
------------------
|
||||||
|
|
||||||
Stencil supports the same syntax as Jinja for whitespace control, see [their docs for more information](https://jinja.palletsprojects.com/en/3.1.x/templates/#whitespace-control).
|
Stencil supports the same syntax as Jinja for whitespace control, see `their docs for more information <https://jinja.palletsprojects.com/en/3.1.x/templates/#whitespace-control>`_.
|
||||||
|
|
||||||
Essentially, Stencil will **not** trim whitespace by default. However you can:
|
Essentially, Stencil will **not** trim whitespace by default. However you can:
|
||||||
|
|
||||||
@@ -126,6 +124,8 @@ Essentially, Stencil will **not** trim whitespace by default. However you can:
|
|||||||
- You can disable this per-block using the `+` control character. For example `{{+ if … }}` to preserve whitespace before.
|
- You can disable this per-block using the `+` control character. For example `{{+ if … }}` to preserve whitespace before.
|
||||||
- You can force trimming per-block by using the `-` control character. For example `{{ if … -}}` to trim whitespace after.
|
- You can force trimming per-block by using the `-` control character. For example `{{ if … -}}` to trim whitespace after.
|
||||||
|
|
||||||
|
.. _template-inheritance:
|
||||||
|
|
||||||
Template inheritance
|
Template inheritance
|
||||||
--------------------
|
--------------------
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user