neurocore.scaffold.render¶
Template rendering helpers shared by neurocore init and neurocore new.
Templates use a minimal {{ var }} substitution syntax (no real Jinja2
dependency). render_tree recursively copies a template directory, rendering
every text file through the same substitution.
Attributes¶
Functions¶
|
Apply |
|
Render a single template file to a string. |
|
Recursively copy |
Module Contents¶
- neurocore.scaffold.render.TEMPLATES_DIR¶
- neurocore.scaffold.render.render_text(content: str, context: dict[str, str]) str[source]¶
Apply
{{ var }}substitutions to a string.
- neurocore.scaffold.render.render_template(template_path: pathlib.Path, context: dict[str, str]) str[source]¶
Render a single template file to a string.
- neurocore.scaffold.render.render_tree(src_dir: pathlib.Path, dest_dir: pathlib.Path, context: dict[str, str]) None[source]¶
Recursively copy
src_dirintodest_dir, rendering text files.Directory names and file names are rendered too, so a template file named
{{ project_name }}.pyis renamed accordingly..gitkeepfiles create empty directories without leaving the marker behind.