Open isosphere opened 1 year ago
IMO the top candidates are Jinja and Mako. Jinja's syntax is more similar to Django's, and it does not allow embedded Python code which allows us to worry a bit less about malicious templates - even if they would only ever be user generated.
I think Jinja is a good choice.
I want to be able to export annotations in a format that matches a specific structure of plain text output[^1]. If we support user-modifiable templates, users can fine-tune the exports from KoHighlight to match any plain text format they might want: plain text, CSV, markdown, HTML, JSON, TOML, etc.
[^1]: specifically, I want to generate markdown files that use properties as supported by logseq using book metadata
To that end, I propose that we identify an appropriate templating dependency and integrate it as an export choice in KoReader.
The user would not have control over what context variables are sent to the template; we'd just firehose them the metadata in a consistent variable format: