Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/sapphire64/vortexforms

Template engine to convert jinja-like templates into HTML with input forms. Forms can be replaced or extended with user's input dictionary.
https://github.com/sapphire64/vortexforms

Last synced: about 20 hours ago
JSON representation

Template engine to convert jinja-like templates into HTML with input forms. Forms can be replaced or extended with user's input dictionary.

Awesome Lists containing this project

README

        

VortexForms
==================

Simple template engine to convert HTML templates with service tags into HTML with input forms.

Implemented with Jinja2 in mind :)

Create forms from templates
--------------

Write template like this one:

.. code::

Your name: {{ first_name|text|class=myclass }}

Implementation:

.. code::

>>> VortexProcessor(code="

Your name: {{ first_name|text|class=myclass }}

").render()

Result:

.. code::

Your name:

Replace forms with user input
--------------

Use template as usual:

.. code::

Your name: {{ first_name|text|class=myclass }}

Pass dictionary with values to processor:

.. code::

>>> values = {'first_name':'Vortex'}
>>> VortexProcessor(code="

Your name: {{ first_name|text|class=myclass }}

").render(values)

Result:

.. code::

Your name: Vortex

TODO
--------------
1) Convert into module
2) Add functional and unit testings
3) Add more comments