-
Notifications
You must be signed in to change notification settings - Fork 1
includes
includes
predictably reads in another file. It's like copy/paste but
MulleScion does the work for you. The contents are parsed just like
any regular template text.
There is a special includes verbatim
. It reads the contents of
a file but doesn't parse it. You can also use includes optionally
, which
doesn't raise an error, if the file doesn't exist. And you can combine both
into includes optionally verbatim
Here we include the file set.scion and have the comments parsed away
{% includes "__demo.scion" %}
Output:
Here is just some plaintext and an expression
and the file included verbatim
{% includes verbatim "__demo.scion" %}
Output:
{% block demo %}
Here is just some plaintext and {{ @"an expression" }}
{% endblock %}
includes
can't be used in multi-line statements.
There is a "hack" method to perform some filtering on includes. You can add a -NSData method after includes, that will filter the included data.
self
does nothing (but it also produces no error):
{% includes verbatim self "__demo.scion" %}
Output:
{% block demo %}
Here is just some plaintext and {{ @"an expression" }}
{% endblock %}