********* Extending ********* QFace is easy to use and easy to extend with your own generator. The standard way is to write a rules document to control the code generation. The more complicated path is to write your generator using just a small python script which uses qface as library. Rules Extensions ================ The rules extension uses a YAML based document to control the code generation. The document is structured roughly like this: .. code-block:: yml : when: context: path: source: : when: context: path: source: documents: - : preserved: - : .. rubric:: `scope` entry Scope is a logical distribution of generator. For example if you write a client/server generator you may want to have a ``client`` and ``server`` scope. This enables you also to switch a scope off using the ``when`` condition. .. rubric:: `qualifier` entry The qualifier defines the domain model type this code generation section shall be applied to. Valid qualifiers are ``system``, ``module``, ``interface``, ``struct`` and ``enum``. .. rubric:: `when` entry The `when` entry defines a condition when this part of the code generation is enabled. For example you may have some code generation parts, which create a scaffold project. By passing in the scaffold flag or by enabling the scaffold feature this part would then also be evaluated. By default when is true. .. rubric:: `context` entry The contexct map allows you to extend the cotnext given to the template. Each context key will then accessible in the template. .. rubric:: `path` entry The path is the path appended to the target directory. So the full export path for a template is ``//