Thank you for your response,

It is getting really hard for me to parse and build pandoc using pandoc types, as I am Haskell beginner.

Please correct me if I am wrong, but the only way to see the JSON output is by trying out pandoc? I mean for covering all the pandoc-types, I will have to put everything in a document then parse using pandoc?
And then figure out by looking at output how actually all types are stored in JSON?

It would be really helpful if there can be another way around it!

On Thursday, 9 September 2021 at 22:50:45 UTC+5:30 John MacFarlane wrote:
Harsh Donga <ha...-7+aFW328pE6p1wGUEcWPqti2O/JbrIOy@public.gmane.org> writes:

> Okay, being new to Haskell some of the questions might seem vague and some
> straightforward to you, I apologize in advance for that.
>
> 1. How can I create pandoc type variables, where exactly do I look if I
> want to make a table object purely using Haskell then convert it to JSON
> AST/other formats

You want to look at

https://hackage.haskell.org/package/pandoc-types-1.22/docs/Text-Pandoc-Builder.html

> 2. How can I convert my own JSON (storing elements analogous to HTML) to
> pandoc AST

If it's a custom JSON format, then you'll need to parse it to a
pandoc AST using a Haskell JSON parsing library (like aeson).
Alternatively, you could convert your JSON format to the JSON
serialization pandoc uses (which you can inspect using
pandoc -t json).

> 3. is there any way possible to make pandoc type variables using other
> languages like JS, Python...

As noted above, you can construct a JSON document that represents
the pandoc AST; pandoc can then read this (pandoc -f json).

To understand pandoc's JSON serialization, the best thing to use
is pandoc itself.

pandoc -t native

will give you a look at the pandoc AST

pandoc -f native -t json

will show you how pandoc represents AST elements in JSON.

--
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/3a59eb3c-352f-49f4-89f8-465aa7e86750n%40googlegroups.com.