WHAT DO YOU RECOMMEND?
Add templating mini-DSL with expansion on object creation, e.g. {{today}}
Including on titles.
Define and limit what’s in the context, e.g.
- Date related universal context
- Current object context (
{{this}}? - Current user, e.g.
{{me}} - Current location, e.g.
{{location.city}}? - API provided
{{ctx}}- for scripting / integration
I’recommend simple string expansion for an MVP (except maybe for {{this}}, if decided). Object matching could be thought of later on, for example by a detecting a context value that looks like a json string, e.g. {anyID: ..., strRepr: ..., objForCreation: {type: ..., ...}}
REAL WORLD USE CASES
- Is there a way to have diary entry show today's date in title automatically?
- API integration with external context
- Related/Refactor/Fix: Date properties in templates: "today" functionality not working as expected · Issue #2824 · anyproto/anytype-heart · GitHub
- variables/placeholders in templates · Issue #806 · anyproto/anytype-ts · GitHub
ADDITIONAL CONTEXT
IMO, a mini-DSL is a fundamental primitive of templating. The possibility to combine it with API-provided context provided for new level of interesting integration scenarios.
Might leverage some.implemented primitives from: Shorcuts for insterting dates inline - #27 by MarchCowboy55