Skip to content

Using pandoc with a custom new syntax in a C program with live preview #9468

Answered by jgm
smnto asked this question in Q&A
Discussion options

You must be logged in to vote

re 1. Easiest approach would be to run pandoc server in a separate process and pass JSON back and forth. In principle it should be possible to use Haskell's FFI to expose a C library, but this would take some work.

re 2. The Haskell parser does not run in IO, so the parser can't directly include a file. However, you could use a later transformation stage on the AST, matching an AST element and replacing it with the result of parsing another file. In pandoc the RST reader, for example, implements inclusion.

re 4. Pandoc is not particularly fast, so I don't think it would be good for that purpose. The Haskell djot parser is probably fast enough (used by itself -- pandoc brings in other thin…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@smnto
Comment options

@jgm
Comment options

Answer selected by smnto
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants