Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Include markdown snippets #348

Closed
dpaetzel opened this issue Aug 18, 2020 · 5 comments
Closed

Include markdown snippets #348

dpaetzel opened this issue Aug 18, 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

@dpaetzel
Copy link

I may be mistaken but I do not think that you can include other Zettels into a Zettel presently?

I would find this very handy, especially since I'm using the MathJax support extensively and start having the same preamble of the form

$$
\newcommand{…}{…}
(…)
\newcommand{…}{…}
$$

in more and more Zettels. It would be great if I could just write a Zettel with that preamble and then include that in every other Zettel that needs the definitions. For my use case, it would be enough to do this via the metadata as the definitions only need to be loaded at the top of the Zettel. Any thoughts on that? 🙂

@dpaetzel
Copy link
Author

Note that this is different to #328 as I might want to edit the included Zettel (e.g. add more definitions over time) which should then be reflected in the Zettels that import it.

@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 Aug 18, 2020
@srid
Copy link
Owner

srid commented Aug 18, 2020

@TheMatten had some ideas on a "include" function, using the syntax from #312 (comment) ... eg:

Hello world

{{ include | ./includes/preamble.md }}

Test

This would also allow us to embed comments widget (of #270) in every zettel. So I'm in favour of this feature, as long as the syntax for this is consistent with the proposal at #312.


Note that there was a similar feature request #184 - but it is not equivalent, as it wants to treat the file being included as a zettel (which isn't the case here).

@srid
Copy link
Owner

srid commented Aug 18, 2020

which isn't the case here

Although this is not what you wrote. Could you clarify why you want the file to be included to be a zettel (instead of being a regular file under ./includes/)?

@dpaetzel
Copy link
Author

Thank you for your response! 🙂

Could you clarify why you want the file to be included to be a zettel (instead of being a regular file under ./includes/)?

Actually, it doesn't need to be a zettel but I do think it needs to get parsed in order for MathJax picking up on the newcommands, doesn't it?

@srid srid changed the title Extend Zettel metadata by an include directive Include markdown snippets Aug 19, 2020
@srid
Copy link
Owner

srid commented Aug 19, 2020

Right. I imagine the include could happen prior to parsing the Markdown text, so whatever you are including should automatically get parsed.

Renamed the issue accordingly.

srid referenced this issue in alex-a-soto/zettelkasten Mar 22, 2021
Repository owner locked and limited conversation to collaborators Aug 8, 2021
@srid srid closed this as completed Aug 8, 2021

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

2 participants