1.1.2. Target Code Snippets

Aus Hugo Doku

Wechseln zu: Navigation, Suche

Within the Frame classes you see @# gen methods. The @#gen methods are the places where the written templated code is located. There can be more than one @#gen method, if the aspect, specified in .model file, requires several code snippets on different places in the target file. E.g. the aspect 'item' requires as well a data declaration (@#gen item_decl) as well as a set( ) method (@#gen item_getter_setter) . On which location in the target file which code snippet is placed is determined by the parent Frame class, i.e. the Frame class which belongs to the tag, which is the parent in the XML hierarchy; in our example: <class> is the parent of <item>. The _class Frame class uses so called slots to refer @#gen methods of its children. Thus a patchwork of code snippets results as the following figure shows.

Patchwork of target code snippets

What you write inside the @#gen methods can be any source code language, even text or HTML for generating documentation. Because on the point of view of HuGo the @#gen methods result in printing functions writing the there specified text on disk. ForHuGo the meaning of the generated text is irrelevant.


Next: 1.1.3. Acess to XML Attributes
Persönliche Werkzeuge