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

How to support generated static content? #364

Closed
peti opened this issue Aug 29, 2020 · 2 comments
Closed

How to support generated static content? #364

peti opened this issue Aug 29, 2020 · 2 comments
Labels
discussion Forum like question asked; not exactly a feature or a bug.

Comments

@peti
Copy link

peti commented Aug 29, 2020

I have plenty of notes that use graphics to illustrate their ideas and usually those graphics are generated programmatically, e.g. with Asymptote, Graphviz, or even LaTeX. Now, I realize that I can put those graphics into the static/ directory to make Neuron copy them into the output directory verbatim. However, I wonder whether there is a way to make Neuron actually generate that static content from the appropriate source files? Neuron is based on Rib, which in turn uses Shake, so my intuition says that it should be possible to register some kind of shake rules that drive this generation process. I would probably need to write my own customized neuron executable to get that done, but I wouldn't mind that. Neuron seems to offer most of its functionality in the form of a re-usable library, right?

What do you think about this use-case? Is there an easy way to accomplish what I'm trying to do?

@srid srid added the discussion Forum like question asked; not exactly a feature or a bug. label Aug 29, 2020
@srid
Copy link
Owner

srid commented Aug 29, 2020

@peti Okay, so, there are two ideas here:

  1. Generate HTML from individual parts of the markdown file, eg: turning code snippets into rendered graphics. See Embed Graphviz graphs #228 (comment) ... I proposed that this can be done by supporting arbitrary Pandoc filters. See Support for custom Pandoc filters #363
  2. Generate static files from other static files.

Both are about dynamically generating content for publishing that is not already available in the zettelkasten directory - but 2 deals with files, whereas 1 is about transforming the Pandoc document internally used by neuron.

Idea 2 is certainly interesting - but should this be in scope for a notes system? Even assuming it does, how would it be done?

Idea 1 on the other hand, I think, can certainly be in scope for neuron, because it is about transforming the Pandoc document arbitrarily so as to customize what gets rendered in the publish site - something you can't easily do outside of neuron without resorting to hacks as @b0o tried out in that link above.

@srid
Copy link
Owner

srid commented Sep 13, 2020

Closing in favour of #363, and it is not clear whether the specific use case is in scope for neuron (an equivalent of Makefile can be written and run outside of neuron?).

@srid srid closed this as completed Sep 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion Forum like question asked; not exactly a feature or a bug.
Projects
None yet
Development

No branches or pull requests

2 participants