diff options
author | Juergen Bocklage-Ryannel <juergen@ryannel.org> | 2018-12-24 13:28:16 +0100 |
---|---|---|
committer | Juergen Bocklage-Ryannel <juergen@ryannel.org> | 2018-12-24 13:28:16 +0100 |
commit | f354532d7cc9e3663b005f5413baf03833c60398 (patch) | |
tree | e2bcb28bb3d8f3d3efc86bb1c064380cd5579e60 /docs | |
parent | 22840dd0a67644afd20c1b9c4dfffa2c23cb4c6d (diff) | |
download | qtivi-qface-f354532d7cc9e3663b005f5413baf03833c60398.tar.gz |
- introduce qface script mode
- add ability to load dynamic filters for qface script mode
- extract generic filters
- fixed some issues with cpp macros
Diffstat (limited to 'docs')
-rw-r--r-- | docs/index.rst | 1 | ||||
-rw-r--r-- | docs/script.rst | 40 |
2 files changed, 41 insertions, 0 deletions
diff --git a/docs/index.rst b/docs/index.rst index 0212095..12a05b7 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -18,6 +18,7 @@ Several code generators for common use cases have already been implemented. Thes json domain extending + script api diff --git a/docs/script.rst b/docs/script.rst new file mode 100644 index 0000000..fb3def2 --- /dev/null +++ b/docs/script.rst @@ -0,0 +1,40 @@ +*********** +Script Mode +*********** + +In the script mode, qface is used as the qface exectuable. In this mode the code generator consits of a rule document and template files and optionally a filter module. + +Whereas normally the generator writer create an own python package in this module only some documents are needed and the qface script is used. + +Setup +===== + +To get started create a `qface-rules.yml` document and a templates folder:: + + qface-rules.yml + templates/ + + +In the rules file you provide the code generation rules accoring to the rule generator documentation. The templates folder will contain the required templates. + +Filters +======= + +To provide extra filder you need to create a `filters.py` document with the declaration of your filters:: + + def echo(s): + print(s) + return "World" + + filters['echo'] = echo + +The filters module will be loaded by qface and all entries to the filters dictionary are added to the global lists of Jinja filters. + +Running +======= + +To run now the generator you can simply call:: + + qface --rules qface-rules.yml --target out counter.qface + +This will take your rules and generate the files inside the out folder based on the `counter.qface` interface file. |