-
-
Notifications
You must be signed in to change notification settings - Fork 150
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
Support for custom Pandoc filters #363
Comments
A note on performance: if you have hundreds of notes using a filter, this would slow down site generation due to having to spawn the process that many times. So we could consider having the script consume input JSON infinite number of times in one spawn session. So neuron will spawn that script ahead, and then feed it the JSON of every zettel it needs transformed, while ending it only at the end (or not at all). |
Might have to do #321 first, to avoid unnecessary reruns. |
We can go one step further and add a plugin mechanism to neuron, where a plugin can determine a dynamic set of pages (or whatever) to generate based some structured data in notes. Plugins can include:
|
In addition to todotxt, the taskpaper format could be interesting. Maybe not the whole format, but the tags (obviously a confusing name within the context of neuron). I think that the taskpaper-mode package may have the best example about how the format could be used. Not exactly related to this, but if you haven't looked at it, there may be some interesting synergies with jupytext. It also uses pandoc behind the scenes. It could be nice to add computations and plots to notes. |
AIUI this would also be required to add custom TEX packages? I was eyeing chemfig, but I'd expect the problem to apply to any latex package. I am no latex expert.. |
I would love to see this, and I can replace https://github.com/iamcco/markdown-preview.nvim I'm currently adding this to
|
Suppose we use Pandoc's JSON filters, then add a new metadata property to YAML frontmatter such as
filter: foo.py
, and have neuron look for the script file named./neuron/filters/foo.py
. Then, that zettel's Pandoc representation can be passed as JSON to the script's stdin, which in turn spits out the modified Pandoc AST JSON in stdout, for neuron to use.The goal is to allow the user to customize the what gets rendered finally. Such as, say, evaluating code blocks and injecting the results back into the Pandoc AST.
We could also support builtin filters (in Haskell), and make neuron's link processing just another Pandoc filter (which is what it is anyway, in essense).
The text was updated successfully, but these errors were encountered: