pypage 2.2.0__tar.gz → 2.2.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,9 +1,9 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pypage
3
- Version: 2.2.0
3
+ Version: 2.2.1
4
4
  Summary: Light-weight Python Templating Engine
5
5
  Home-page: https://github.com/arjun-menon/pypage
6
- Download-URL: https://github.com/arjun-menon/pypage/archive/v2.2.0.tar.gz
6
+ Download-URL: https://github.com/arjun-menon/pypage/archive/v2.2.1.tar.gz
7
7
  Author: Arjun G. Menon
8
8
  Author-email: contact@arjungmenon.com
9
9
  License: Apache-2.0
@@ -341,10 +341,23 @@ tag:
341
341
  hello {{"bob"}}
342
342
  {% %}
343
343
 
344
- The above tag will not yield any output, but rather a new variable ``x``
344
+ The tag above will not yield any output, but rather a new variable ``x``
345
345
  will be created that captures the output of everything enclosed by it
346
346
  (which in this case is ``"hello bob"``).
347
347
 
348
+ Function Blocks
349
+ ^^^^^^^^^^^^^^^
350
+
351
+ You can define functions using the ``def`` tag:
352
+
353
+ .. code:: python
354
+
355
+ {% def anchor name href %}
356
+ <a href="{{href}}">{{name}}</a>
357
+ {% %}
358
+
359
+ The tag above will not yield any output, but rather create a new function ``anchor`` that behaves like a function, and returns the output of everything enclosed by it, with the named positional arguments injected (in an effective stacked local scope) as expected. In this example, we can invoke it with ``{{ anchor('Wikipedia', 'https://en.wikipedia.org') }}``.
360
+
348
361
  Finer Details
349
362
  -------------
350
363
 
@@ -304,10 +304,23 @@ tag:
304
304
  hello {{"bob"}}
305
305
  {% %}
306
306
 
307
- The above tag will not yield any output, but rather a new variable ``x``
307
+ The tag above will not yield any output, but rather a new variable ``x``
308
308
  will be created that captures the output of everything enclosed by it
309
309
  (which in this case is ``"hello bob"``).
310
310
 
311
+ Function Blocks
312
+ ^^^^^^^^^^^^^^^
313
+
314
+ You can define functions using the ``def`` tag:
315
+
316
+ .. code:: python
317
+
318
+ {% def anchor name href %}
319
+ <a href="{{href}}">{{name}}</a>
320
+ {% %}
321
+
322
+ The tag above will not yield any output, but rather create a new function ``anchor`` that behaves like a function, and returns the output of everything enclosed by it, with the named positional arguments injected (in an effective stacked local scope) as expected. In this example, we can invoke it with ``{{ anchor('Wikipedia', 'https://en.wikipedia.org') }}``.
323
+
311
324
  Finer Details
312
325
  -------------
313
326
 
@@ -1,9 +1,9 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pypage
3
- Version: 2.2.0
3
+ Version: 2.2.1
4
4
  Summary: Light-weight Python Templating Engine
5
5
  Home-page: https://github.com/arjun-menon/pypage
6
- Download-URL: https://github.com/arjun-menon/pypage/archive/v2.2.0.tar.gz
6
+ Download-URL: https://github.com/arjun-menon/pypage/archive/v2.2.1.tar.gz
7
7
  Author: Arjun G. Menon
8
8
  Author-email: contact@arjungmenon.com
9
9
  License: Apache-2.0
@@ -341,10 +341,23 @@ tag:
341
341
  hello {{"bob"}}
342
342
  {% %}
343
343
 
344
- The above tag will not yield any output, but rather a new variable ``x``
344
+ The tag above will not yield any output, but rather a new variable ``x``
345
345
  will be created that captures the output of everything enclosed by it
346
346
  (which in this case is ``"hello bob"``).
347
347
 
348
+ Function Blocks
349
+ ^^^^^^^^^^^^^^^
350
+
351
+ You can define functions using the ``def`` tag:
352
+
353
+ .. code:: python
354
+
355
+ {% def anchor name href %}
356
+ <a href="{{href}}">{{name}}</a>
357
+ {% %}
358
+
359
+ The tag above will not yield any output, but rather create a new function ``anchor`` that behaves like a function, and returns the output of everything enclosed by it, with the named positional arguments injected (in an effective stacked local scope) as expected. In this example, we can invoke it with ``{{ anchor('Wikipedia', 'https://en.wikipedia.org') }}``.
360
+
348
361
  Finer Details
349
362
  -------------
350
363
 
@@ -18,7 +18,7 @@
18
18
  from __future__ import print_function
19
19
  import string, sys, time, os, json
20
20
 
21
- pypage_version = '2.2.0'
21
+ pypage_version = '2.2.1'
22
22
 
23
23
  class RootNode(object):
24
24
  """
File without changes
File without changes
File without changes