Converting html to json with pandoc Converting html to json with pandoc json json

Converting html to json with pandoc


Currently, the pandoc JSON representation is not very human-readable, but is auto-generated from the Haskell pandoc data types (aka document AST). There is some discussion to change that eventually.

I guess you're looking for something like https://codebeautify.org/xmltojson? There also seem to be plenty of commandline-tools that do that.


Pandoc, It's a tool to convert documents, the json representation of the document, It's just another representation that Pandoc can handle for the AST (Abstract Syntax Tree)

Original Document --> Pandoc's AST --> Output Document                   |                |                pandoc           pandoc

Asking pandoc, to output a json, is to ask for the AST tree in it's json format,

If I understand correctly you would need something more like a xml to json converter like this Python xmljson module or an online tool like this one.

There are plenty of tools for that job as you picture it, just google XML to JSON convert.

The json representation of the AST used in pandoc, it normally used to output it from pandoc, and pipe it into another program that can handle json files, so you can alter the AST and make filters to manipulate the structure of your document.