Support for custom Pandoc filters

Open
#363 6 comments 5 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
20/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
haskell, python, yaml
Domain
backend, tooling

Research direction

No file or test is named in the issue. Start by locating the code that builds a zettel's Pandoc representation and handles YAML frontmatter, then trace how rendering consumes it. Done means a configured filter can receive the representation on stdin, return AST JSON on stdout, and affect final rendering.

Written by the indexing model from the issue text.

Description

as-plugin enhancement NeuronNG/Triage proposal

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).

Dominant language
Haskell
Stars
1.6k
Forks
145
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from srid/neuron

All issues in srid/neuron

Similar issues

More Haskell issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.