* feature proposal: pretty printing of Native format
@ 2019-06-19 22:13 Laurent René de Cotret
[not found] ` <6c1c4146-20b8-437a-878a-24c4ac915946-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
0 siblings, 1 reply; 5+ messages in thread
From: Laurent René de Cotret @ 2019-06-19 22:13 UTC (permalink / raw)
To: pandoc-discuss
[-- Attachment #1.1: Type: text/plain, Size: 2248 bytes --]
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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/6c1c4146-20b8-437a-878a-24c4ac915946%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
[-- Attachment #1.2: Type: text/html, Size: 6343 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
[parent not found: <6c1c4146-20b8-437a-878a-24c4ac915946-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>]
* Re: feature proposal: pretty printing of Native format [not found] ` <6c1c4146-20b8-437a-878a-24c4ac915946-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> @ 2019-06-20 0:39 ` Hans Kunkell [not found] ` <c899bdb4-f441-43ef-a147-9109ee94a267-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> 2019-06-23 10:21 ` John MacFarlane 1 sibling, 1 reply; 5+ messages in thread From: Hans Kunkell @ 2019-06-20 0:39 UTC (permalink / raw) To: pandoc-discuss [-- Attachment #1.1: Type: text/plain, Size: 2676 bytes --] Hello! It is possible to do with external tools, for example "jq <https://stedolan.github.io/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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@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. [-- Attachment #1.2: Type: text/html, Size: 7130 bytes --] ^ permalink raw reply [flat|nested] 5+ messages in thread
[parent not found: <c899bdb4-f441-43ef-a147-9109ee94a267-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>]
* Re: feature proposal: pretty printing of Native format [not found] ` <c899bdb4-f441-43ef-a147-9109ee94a267-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> @ 2019-06-20 12:24 ` Laurent René de Cotret 0 siblings, 0 replies; 5+ messages in thread From: Laurent René de Cotret @ 2019-06-20 12:24 UTC (permalink / raw) To: pandoc-discuss [-- Attachment #1.1: Type: text/plain, Size: 931 bytes --] On Wednesday, June 19, 2019 at 8:39:55 PM UTC-4, Hans Kunkell wrote: > > Hello! > > It is possible to do with external tools, for example "jq > <https://stedolan.github.io/jq/>" . This will give you (kind of) the > desired output : > pandoc -t json myfile.md | jq . > > Regards > Hans > >> >> This is a great idea! Thank you for the suggestion. 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/5fd975a8-8e0f-4012-9524-ff0b05c50d64%40googlegroups.com. For more options, visit https://groups.google.com/d/optout. [-- Attachment #1.2: Type: text/html, Size: 2607 bytes --] ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: feature proposal: pretty printing of Native format [not found] ` <6c1c4146-20b8-437a-878a-24c4ac915946-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> 2019-06-20 0:39 ` Hans Kunkell @ 2019-06-23 10:21 ` John MacFarlane [not found] ` <m2tvcgr492.fsf-gd5emFPDCk19a1wB/4mvwEEMvNT87kid@public.gmane.org> 1 sibling, 1 reply; 5+ messages in thread From: John MacFarlane @ 2019-06-23 10:21 UTC (permalink / raw) To: Laurent René de Cotret, pandoc-discuss Actually Text.Pandoc.Writers.Native does do some prettification; it doesn't just do "show." You can see this if you print something with nested block structure, like lists or blockquotes. If there are ways you think this should be improved, feel free to make suggestions or do a PR. Laurent René de Cotret <laurent.decotret-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes: > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/6c1c4146-20b8-437a-878a-24c4ac915946%40googlegroups.com. > For more options, visit https://groups.google.com/d/optout. -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/m2tvcgr492.fsf%40macbook-air-3.home. For more options, visit https://groups.google.com/d/optout. ^ permalink raw reply [flat|nested] 5+ messages in thread
[parent not found: <m2tvcgr492.fsf-gd5emFPDCk19a1wB/4mvwEEMvNT87kid@public.gmane.org>]
* Re: feature proposal: pretty printing of Native format [not found] ` <m2tvcgr492.fsf-gd5emFPDCk19a1wB/4mvwEEMvNT87kid@public.gmane.org> @ 2019-06-23 21:10 ` Laurent René de Cotret 0 siblings, 0 replies; 5+ messages in thread From: Laurent René de Cotret @ 2019-06-23 21:10 UTC (permalink / raw) To: pandoc-discuss [-- Attachment #1.1: Type: text/plain, Size: 3889 bytes --] Yes I see that Text.Pandoc.Writers.Native is more than what I thought. Piping to a file looks better than the Windows terminal. Pretty-printing works better there. Additionally, Hans' suggestion above is fine for now. Regards, Laurent On Sunday, June 23, 2019 at 6:22:02 AM UTC-4, John MacFarlane wrote: > > > Actually Text.Pandoc.Writers.Native does do some > prettification; it doesn't just do "show." You can > see this if you print something with nested block > structure, like lists or blockquotes. > > If there are ways you think this should be improved, > feel free to make suggestions or do a PR. > > Laurent René de Cotret <laurent...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org <javascript:>> > writes: > > > 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-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org <javascript:>. > > To post to this group, send email to pandoc-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org > <javascript:>. > > To view this discussion on the web visit > https://groups.google.com/d/msgid/pandoc-discuss/6c1c4146-20b8-437a-878a-24c4ac915946%40googlegroups.com. > > > For more options, visit https://groups.google.com/d/optout. > -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/25fbb536-424e-4032-a786-743dd075e80f%40googlegroups.com. For more options, visit https://groups.google.com/d/optout. [-- Attachment #1.2: Type: text/html, Size: 6508 bytes --] ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2019-06-23 21:10 UTC | newest] Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2019-06-19 22:13 feature proposal: pretty printing of Native format Laurent René de Cotret [not found] ` <6c1c4146-20b8-437a-878a-24c4ac915946-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> 2019-06-20 0:39 ` Hans Kunkell [not found] ` <c899bdb4-f441-43ef-a147-9109ee94a267-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> 2019-06-20 12:24 ` Laurent René de Cotret 2019-06-23 10:21 ` John MacFarlane [not found] ` <m2tvcgr492.fsf-gd5emFPDCk19a1wB/4mvwEEMvNT87kid@public.gmane.org> 2019-06-23 21:10 ` Laurent René de Cotret
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).