public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
From: "Laurent René de Cotret" <laurent.decotret-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: pandoc-discuss <pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
Subject: feature proposal: pretty printing of Native format
Date: Wed, 19 Jun 2019 15:13:21 -0700 (PDT)	[thread overview]
Message-ID: <6c1c4146-20b8-437a-878a-24c4ac915946@googlegroups.com> (raw)


[-- 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 --]

             reply	other threads:[~2019-06-19 22:13 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-19 22:13 Laurent René de Cotret [this message]
     [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

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=6c1c4146-20b8-437a-878a-24c4ac915946@googlegroups.com \
    --to=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).