Bake a template from corresponding JSON object
Warning : after some experience, JSON is NOT Pythonic. Use YAML instead.
Install (Python 3) : pip install pyjst
Create a project directory with given structure :
- project_name/
- datas/
- templates/
In templates/ you can put templates with extension .html. In datas/ you can put corresponding data with extension .json. What this module does is simply render asked template name.tmpl with corresponding data name.json. The output is generated in folder output/.
For instance let this file tree :
- example/
- datas/
- example.json
- another.json
- templates/
- example.tmpl
- another.tmpl
- datas/
So go into your project folder : cd example
Then generate your static page example : pyjst example
Or generate static page another : pyjst another
You can specify more to the command (templates folder, output file path, JSON data file path),
use pyjst -h
to know how to use it.