Hello!

It is possible to do with external tools, for example "jq" . This will give you (kind of) the desired output :
pandoc -t json myfile.md | jq .

Regards
Hans

Den torsdag 20 juni 2019 kl. 07:13:22 UTC+9 skrev Laurent René de Cotret:
Hello,

I often work on Pandoc filters, and I regularly look at Pandoc's native format.

Here is an example of the output in my terminal:
> pandoc -i myfile.md --to native
[Para [Image ("fig:myfigure",[],[]) [Str "Figure",Space,Str "1:",Space,Str "This",Space,Str "is",Space,Str "a",Space,Str "caption"] ("generated/other\\8842295943125512100.jpg","fig:")]
,Para [Str "As",Space,Str "you",Space,Str "can",Space,Str "see",Space,Str "in",Space,Str "fig.\160\&1,",Space,Str "pandoc-crossref",Space,Str "is",Space,Str "compatible",Space,Str "with",Space,Str "the",Space,Str "ouput",Space,Str "of",Space,Str "pandoc-pyplot."]]

It would be very useful to get a pretty-printing version of the above, e.g.:

[
    Para [
        Image 
            ("fig:myfigure",[],[]) 
            [Str "Figure",Space,Str "1:",Space,Str "This",Space,Str "is",Space,Str "a",Space,Str "caption"] 
            ("generated/other\\8842295943125512100.jpg","fig:")
         ],
    Para [
        Str "As",Space,Str "you",Space,Str "can",Space,Str "see",Space,Str "in",Space,Str "fig.\160\&1,",Space,Str "pandoc-crossref",Space,
        Str "is",Space,Str "compatible",Space,Str "with",Space,Str "the",Space,Str "ouput",Space,Str "of",Space, Str "pandoc-pyplot."
         ]
]

After a cursory look at the source in Text.Pandoc.Writers.Native, it would be possible to make a nice, indented, pretty version of native Haskell, given that WriterOptions type has the writerColumns attribute.

Is this something that the Pandoc community might be interested in? Should it be a different format than "native", called "pretty-native" or something?

I'm happy to put together a pull request.

Laurent

--
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 post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/c899bdb4-f441-43ef-a147-9109ee94a267%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.