Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Template functions syntax #407

Closed
srid opened this issue Sep 19, 2020 · 5 comments
Closed

Template functions syntax #407

srid opened this issue Sep 19, 2020 · 5 comments
Labels
proposal Proposal with exact spec yet to be fleshed out Zettel Format Anything that affects the structure of the zettel text

Comments

@srid
Copy link
Owner

srid commented Sep 19, 2020

contd. from #312 (comment)

Deprecate

[[z:zettels?tag=foo&timeline]]

in favour of

{{ zettels | tag=foo | timeline }}
  • Folgezettel type would use {{...}}#
  • Template function syntax maps to URIs underneath (the two types are isomorphic)
  • The URI syntax will be deprecated but continue to be supported (as it is used as the underlying format in the Pandoc AST)
  • Template function syntax can be used to provide non-link-query related extensible features like Include markdown snippets #348 (comment)
@srid srid added proposal Proposal with exact spec yet to be fleshed out Zettel Format Anything that affects the structure of the zettel text labels Sep 19, 2020
@srid srid added this to the 0.8 milestone Sep 19, 2020
@srid
Copy link
Owner Author

srid commented Sep 19, 2020

Wiki-links can simply become an alias for the 'link' template function, and we can rename 'zettels' to 'linkMany' for naming consistency:

{{ linkMany | tag = foo | cf }}
{{ link | some-note | cf }} is equivalent to [[some-note]]

@srid srid removed this from the 0.8 milestone Sep 19, 2020
@srid
Copy link
Owner Author

srid commented Sep 19, 2020

Can't say I'm totally convinced about doing this, but will leave it here as a concrete proposal for the record.

@srid srid changed the title Template functions Template functions syntax Sep 19, 2020
@srid srid added this to the 1.0 milestone Sep 19, 2020
@srid
Copy link
Owner Author

srid commented Jan 2, 2021

Possibly outdated I think we should prevent the folgezettel type here, `{{{ ... }}}`. Allow templates to create ordinary links only.

For folgezettel tagging, use #514

This constraint will allow us to define template functions that operate on the graph itself, for example:

{{ linksFrom | some-note | label=# }} 

That will list all noted from some-note.md using the [[Foo]]# syntax (which is an alias to [[[...]]]).

@srid
Copy link
Owner Author

srid commented Mar 16, 2021

Perhaps we should ditch this syntax entirely and do what Obsidian does; search query in a particular codeblock: https://help.obsidian.md/Plugins/Search#Embed+search+results (see its search operators)

@srid
Copy link
Owner Author

srid commented Aug 8, 2021

Emanote uses Obsidian style queries, which makes this proposal outdated.

Closing per https://neuron.zettel.page/next ... to further discuss this idea, post in Emanote repo.

@srid srid closed this as completed Aug 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
proposal Proposal with exact spec yet to be fleshed out Zettel Format Anything that affects the structure of the zettel text
Projects
None yet
Development

No branches or pull requests

1 participant