Closed
Conversation
|
Sorry if this isn't the best place to discuss this, but I was wondering if this could be turned into a custom reader/writer for Pandoc since the Haskell parser project appears to be temporarily stalled. I'm interested in helping work on this! |
Member
|
Since there are WIP implementations of true pandoc parsers I think it's safe to close this issue as "superseded by x". Currently the following parser has worked for almost any document up to level 3 for me! The official pandoc parser made in haskell will probably follow. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Very WIP and very temporary solution for reliably exporting Neorg documents into other formats via Pandoc. It will be deprecated once https://github.com/Simre1/neorg-haskell-parser is stable. You can test it right now, but it requires a
pandocbinary to be available in your$PATH. This unfortunately introduces a rather large Haskell dependency, therefore it does not completely replacecore.exportyet (although it will be deprecated by this module in the future).This module works by walking the AST of an norg document using
tree_map_recand transforming it into Pandoc's native JSON representation withvim.json.encode, making it very efficient1. This is only an exporter; it is not a proper parser and does not allow for converting other formats to norg.If you're eager to try it out right now, add the module to your config, open an norg file and run
:Neorg pandoc json. Don't panic if it errors out with node types as messages - those are just unimplemented and will not be included in the output. This will output JSON tojson.jsonin your current working directory which can be read by Pandoc, for example:pandoc json.json -o test.md. Keep in mind that this interface probably won't survive very long.Implementation status (copied from https://github.com/Simre1/neorg-haskell-parser#implementation-status)
Legend
Footnotes
Source: just trust me bro. There is currently no way to properly benchmark it since neither this module nor @Simre1's parser fully implement the spec. For now just believe me when I say it's fast enough for you not to notice it. ↩