Skip to content

prettier templates #1

@dansgithubuser

Description

@dansgithubuser

Template code is awkward because it has two competing interlaced indentation structures.

Crangen offers little: generation code is separated from verbatim code. This is nice, but something like a generative for loop means you have to write what could be verbatim code as an internal expression in generation code.

Something like jinja2 allows you to write more verbatim code, but the indentation structure gets even more finely interwoven and confused.

The first insight is that this is an editor problem. Better offload visuals to the editor than try to encode them in a syntax.

The second insight is that verbatim code lines can be interpreted as generative code lines by circumpending print(' and '). Here I'm imagining the rendered file as stdout.

A suggestion for integration is to add *.meta2.* support. Crangen comments are denoted with //\ (by default) at the beginning of the line. Other lines are interpreted as print statements.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions