From c901203cd1ef27050e87937bef9d8e7c862fc9f5 Mon Sep 17 00:00:00 2001 From: Gunnar Andersson Date: Tue, 7 Jan 2025 16:48:20 +0100 Subject: [PATCH] Move templates to (temporary) new structure Ideally each template should be under each technology dir but the way the generic generator is written now, it assumes everything under one directory. For now, it can stay like this (but under the output_filters directory). Signed-off-by: Gunnar Andersson --- docs/static-developer-generators.md | 6 +++--- models/ifex/ifex_generator.py | 2 +- {ifex => output_filters}/templates/D-Bus/AST.tpl | 0 {ifex => output_filters}/templates/D-Bus/Argument.tpl | 0 {ifex => output_filters}/templates/D-Bus/Enumeration.tpl | 0 {ifex => output_filters}/templates/D-Bus/Error.tpl | 0 {ifex => output_filters}/templates/D-Bus/Event.tpl | 0 {ifex => output_filters}/templates/D-Bus/Include.tpl | 0 {ifex => output_filters}/templates/D-Bus/Interface.tpl | 0 {ifex => output_filters}/templates/D-Bus/Member.tpl | 0 {ifex => output_filters}/templates/D-Bus/Method.tpl | 0 {ifex => output_filters}/templates/D-Bus/Namespace.tpl | 0 {ifex => output_filters}/templates/D-Bus/Option.tpl | 0 {ifex => output_filters}/templates/D-Bus/Property.tpl | 0 {ifex => output_filters}/templates/D-Bus/Struct.tpl | 0 {ifex => output_filters}/templates/D-Bus/Typedef.tpl | 0 {ifex => output_filters}/templates/JinjaTemplateEnv.py | 2 +- {ifex => output_filters}/templates/TemplateDir.py | 0 {ifex => output_filters}/templates/__init__.py | 0 {ifex => output_filters}/templates/dtdl/AST_dtdl.tpl | 0 {ifex => output_filters}/templates/dtdl/dtdl.md | 0 .../templates/protobuf/AST_protobuf.tpl | 0 {ifex => output_filters}/templates/protobuf/protobuf.md | 0 .../templates/sds-bamm/AST_sds-bamm-aspect-model.tpl | 0 .../templates/sds-bamm/sds-bamm-aspect-model.md | 0 .../templates/sds-bamm/sds-bamm-macros.tpl | 0 .../templates/simple/AST-simple_doc.tpl | 0 .../templates/simple/Argument-simple_doc.html | 0 .../templates/simple/Error-simple_doc.html | 0 .../templates/simple/Member-simple_doc.html | 0 .../templates/simple/Namespace-simple_doc.html | 0 .../templates/simple/Service-simple_doc.html | 0 .../templates/simple/simple_overview.tpl | 0 setup.py | 2 +- 34 files changed, 6 insertions(+), 6 deletions(-) rename {ifex => output_filters}/templates/D-Bus/AST.tpl (100%) rename {ifex => output_filters}/templates/D-Bus/Argument.tpl (100%) rename {ifex => output_filters}/templates/D-Bus/Enumeration.tpl (100%) rename {ifex => output_filters}/templates/D-Bus/Error.tpl (100%) rename {ifex => output_filters}/templates/D-Bus/Event.tpl (100%) rename {ifex => output_filters}/templates/D-Bus/Include.tpl (100%) rename {ifex => output_filters}/templates/D-Bus/Interface.tpl (100%) rename {ifex => output_filters}/templates/D-Bus/Member.tpl (100%) rename {ifex => output_filters}/templates/D-Bus/Method.tpl (100%) rename {ifex => output_filters}/templates/D-Bus/Namespace.tpl (100%) rename {ifex => output_filters}/templates/D-Bus/Option.tpl (100%) rename {ifex => output_filters}/templates/D-Bus/Property.tpl (100%) rename {ifex => output_filters}/templates/D-Bus/Struct.tpl (100%) rename {ifex => output_filters}/templates/D-Bus/Typedef.tpl (100%) rename {ifex => output_filters}/templates/JinjaTemplateEnv.py (97%) rename {ifex => output_filters}/templates/TemplateDir.py (100%) rename {ifex => output_filters}/templates/__init__.py (100%) rename {ifex => output_filters}/templates/dtdl/AST_dtdl.tpl (100%) rename {ifex => output_filters}/templates/dtdl/dtdl.md (100%) rename {ifex => output_filters}/templates/protobuf/AST_protobuf.tpl (100%) rename {ifex => output_filters}/templates/protobuf/protobuf.md (100%) rename {ifex => output_filters}/templates/sds-bamm/AST_sds-bamm-aspect-model.tpl (100%) rename {ifex => output_filters}/templates/sds-bamm/sds-bamm-aspect-model.md (100%) rename {ifex => output_filters}/templates/sds-bamm/sds-bamm-macros.tpl (100%) rename {ifex => output_filters}/templates/simple/AST-simple_doc.tpl (100%) rename {ifex => output_filters}/templates/simple/Argument-simple_doc.html (100%) rename {ifex => output_filters}/templates/simple/Error-simple_doc.html (100%) rename {ifex => output_filters}/templates/simple/Member-simple_doc.html (100%) rename {ifex => output_filters}/templates/simple/Namespace-simple_doc.html (100%) rename {ifex => output_filters}/templates/simple/Service-simple_doc.html (100%) rename {ifex => output_filters}/templates/simple/simple_overview.tpl (100%) diff --git a/docs/static-developer-generators.md b/docs/static-developer-generators.md index 133d24d2..04ebb81b 100644 --- a/docs/static-developer-generators.md +++ b/docs/static-developer-generators.md @@ -39,7 +39,7 @@ A simple generator (with only one template) can be done like this: Unless you need to add more logic, generating one input file with one (or several) templates is basically already available if ifex_generator.py is called as a -main program. You specify the directory name (relative to `/ifex/templates`) +main program. You specify the directory name (relative to `/output_filters/templates`) where the template(s) is stored. Note that `setup.py` "installs" an executable entrypoint `ifexgen` to call the program: @@ -53,7 +53,7 @@ An advanced generator (with several templates) can be done like this: * Import the ifex_generator.py and ifex_parser.py, and TemplateDir modules. * Get the needed Service description file(s) (YAML), for example from command line argument * For each file, get the Abstract Syntax Tree representation by calling `ifex_parser.get_ast_from_yaml_file(service_desc_file)` -* Write templates according to (some, not all) node types. You can call `gen(node)` or `gen(node,