public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
From: John MacFarlane <jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org>
To: "Laurent René de Cotret"
	<laurent.decotret-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	pandoc-discuss
	<pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
Subject: Re: feature proposal: pretty printing of Native format
Date: Sun, 23 Jun 2019 12:21:45 +0200	[thread overview]
Message-ID: <m2tvcgr492.fsf@macbook-air-3.home> (raw)
In-Reply-To: <6c1c4146-20b8-437a-878a-24c4ac915946-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>


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.


  parent reply	other threads:[~2019-06-23 10:21 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-19 22:13 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 [this message]
     [not found]     ` <m2tvcgr492.fsf-gd5emFPDCk19a1wB/4mvwEEMvNT87kid@public.gmane.org>
2019-06-23 21:10       ` Laurent René de Cotret

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m2tvcgr492.fsf@macbook-air-3.home \
    --to=jgm-tvlzxgkolnx2fbvcvol8/a@public.gmane.org \
    --cc=laurent.decotret-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).