neurocore.scaffold.render ========================= .. py:module:: neurocore.scaffold.render .. autoapi-nested-parse:: 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 ---------- .. autoapisummary:: neurocore.scaffold.render.TEMPLATES_DIR Functions --------- .. autoapisummary:: neurocore.scaffold.render.render_text neurocore.scaffold.render.render_template neurocore.scaffold.render.render_tree Module Contents --------------- .. py:data:: TEMPLATES_DIR .. py:function:: render_text(content: str, context: dict[str, str]) -> str Apply ``{{ var }}`` substitutions to a string. .. py:function:: render_template(template_path: pathlib.Path, context: dict[str, str]) -> str Render a single template file to a string. .. py:function:: render_tree(src_dir: pathlib.Path, dest_dir: pathlib.Path, context: dict[str, str]) -> None Recursively copy ``src_dir`` into ``dest_dir``, rendering text files. Directory names and file names are rendered too, so a template file named ``{{ project_name }}.py`` is renamed accordingly. ``.gitkeep`` files create empty directories without leaving the marker behind.