pypage 2.2.0__py3-none-any.whl → 2.2.1__py3-none-any.whl

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
 
@@ -0,0 +1,7 @@
1
+ pypage.py,sha256=70F8Lg3KOyGVeHCJIvCGY3o223EQp1Pvy3qDA5vI7zo,30890
2
+ pypage-2.2.1.dist-info/licenses/LICENSE.txt,sha256=z8d0m5b2O9McPEK1xHG_dWgUBT6EfBDz6wA0F7xSPTA,11358
3
+ pypage-2.2.1.dist-info/METADATA,sha256=tDgfsis6WJfZ904RMOtsaH5Fa94CKlxiAj3AIvC1OUU,18890
4
+ pypage-2.2.1.dist-info/WHEEL,sha256=lTU6B6eIfYoiQJTZNc-fyaR6BpL6ehTzU3xGYxn2n8k,91
5
+ pypage-2.2.1.dist-info/entry_points.txt,sha256=iHPN6EfIUdv-njh8GV04yDTzkcCLGNcXvdbA43s_8mo,39
6
+ pypage-2.2.1.dist-info/top_level.txt,sha256=8AAB15dVQEt9xcwH_eLcVUZEbFlc__81RA5mOrYtJiQ,7
7
+ pypage-2.2.1.dist-info/RECORD,,
pypage.py CHANGED
@@ -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
  """
@@ -1,7 +0,0 @@
1
- pypage.py,sha256=s6OuUUo_nZjpS9aZFaXMBXlUvBUDSiF_3DzIoaE2uW4,30890
2
- pypage-2.2.0.dist-info/licenses/LICENSE.txt,sha256=z8d0m5b2O9McPEK1xHG_dWgUBT6EfBDz6wA0F7xSPTA,11358
3
- pypage-2.2.0.dist-info/METADATA,sha256=GDhXXdpQcCAnSziU-5_Z9P1QujNlnSFUAY9sXggefWU,18347
4
- pypage-2.2.0.dist-info/WHEEL,sha256=lTU6B6eIfYoiQJTZNc-fyaR6BpL6ehTzU3xGYxn2n8k,91
5
- pypage-2.2.0.dist-info/entry_points.txt,sha256=iHPN6EfIUdv-njh8GV04yDTzkcCLGNcXvdbA43s_8mo,39
6
- pypage-2.2.0.dist-info/top_level.txt,sha256=8AAB15dVQEt9xcwH_eLcVUZEbFlc__81RA5mOrYtJiQ,7
7
- pypage-2.2.0.dist-info/RECORD,,
File without changes