From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/22991 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Hans Kunkell Newsgroups: gmane.text.pandoc Subject: Re: feature proposal: pretty printing of Native format Date: Wed, 19 Jun 2019 17:39:55 -0700 (PDT) Message-ID: References: <6c1c4146-20b8-437a-878a-24c4ac915946@googlegroups.com> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_85_360873073.1560991195704" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="232466"; mail-complaints-to="usenet@blaine.gmane.org" To: pandoc-discuss Original-X-From: pandoc-discuss+bncBDXJP3V4SEPRBXFLVPUAKGQE43XHOBI-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Thu Jun 20 02:39:59 2019 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane.org Original-Received: from mail-ot1-f56.google.com ([209.85.210.56]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1hdl7P-000yMY-1U for gtp-pandoc-discuss@m.gmane.org; Thu, 20 Jun 2019 02:39:59 +0200 Original-Received: by mail-ot1-f56.google.com with SMTP id b25sf465692otp.12 for ; Wed, 19 Jun 2019 17:39:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20161025; h=sender:date:from:to:message-id:in-reply-to:references:subject :mime-version:x-original-sender:reply-to:precedence:mailing-list :list-id:list-post:list-help:list-archive:list-subscribe :list-unsubscribe; bh=uU+1ZuXpK7jfEXo64e6xejbfB1P5qdwAYOmdc1MKZHQ=; b=XtXeQ6/xb7Ca8OWNTEPJZ6J6rxcN00pw3nzqCoFB7cxoy4EwduRRGfM03Frg9HphhD B+MFopR4LiSsyyoPOln7hRQPv2mvPfVm/0ZxG3B9pfCt3jMPBaBUB5rYA7CM9IM5zp1V Xy7XtmW/KoiEb0k5V2bvsKmQ650FOwrqUWoyjtKBAJQ73NLZ6oGlpNF0LWPyYblIPdp4 ovLsq5jwENdwNt0DkBbtyOiO4YqM/tKqkHQoqihK0bt5gI+4DZ8j8O/Bt08HXvi0J66b XGcTmxJNnVG8BzkgIQuCCc6r+hJKQ/FeUFPw7iCjys2D4p5CWk77FajoBPgaJTEk0s+d qYww== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:message-id:in-reply-to:references:subject:mime-version :x-original-sender:reply-to:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-subscribe:list-unsubscribe; bh=uU+1ZuXpK7jfEXo64e6xejbfB1P5qdwAYOmdc1MKZHQ=; b=E1HIq8TxJJlgNdh7hOOlLfzpaRUuZkdk3s5EIrY6BFA6stY9NRvUQbAfnE4+v7+rp6 qUSnKkYSrvw6xRwVVoW4Alv+lJYo0iqEPmIAiMhe4i3KiEI2/kAnA+HhIJ0W5yIn8jIY UaPD91T3sPchgGRTXkNogz8y3dtqpKldY7MzW1lvnmT4ocI5Ena0fjK2R2AqDXuxAaD/ GjmwvssTb13ZBUqFasU3H2fMkPja5bWYcUunJvTBlG25Ywg4s1c6UX4gVR3jUDjcgUAw ioEybm/x55OmNfniheMd02waDbpAZ6n9igHgkUmODv37koUJzyClWXIjctCH2HdNk3f3 30XQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=sender:x-gm-message-state:date:from:to:message-id:in-reply-to :references:subject:mime-version:x-original-sender:reply-to :precedence:mailing-list:list-id:x-spam-checked-in-group:list-post :list-help:list-archive:list-subscribe:list-unsubscribe; bh=uU+1ZuXpK7jfEXo64e6xejbfB1P5qdwAYOmdc1MKZHQ=; b=EV2QoVn/zyEZQ1UVbD0tguwnjGddmj+JbtR5LU575z8FiXv79/jDDi/5D7oZ571Ux8 wfWGKTdPRw7qbZbqT2iEKr2tsrtFLzd4u21viMeE/8N71+nlJeSBGEv2JGMo3aaYwQfq Iw4BHTqNnPRh+Hg2cpvhMIfWaeWvZHVvu9j9lGuSapp86FGx6dOhz+w4nsdl6qZRJyD9 GMrzTfsV/2IS35nOhkBnxQs/hqCkBtkQp1f/VRWu4Y9HXlSB7v0JhA+k5wxTMdbLbfW4 68dxZ6E8TIJLwhfD4rPHf5BgLBKTBvg7Z4d13y+2m1Q6jCMxBqaSaPXD1GdZVJpmxhjD JVEw== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: APjAAAWlzqcnGnR+39IupeXEgAhgT45qEQ1DgEUhuejifpWBHBejQbnD F8dQ5aV2cAtjZ54CWZOpzXA= X-Google-Smtp-Source: APXvYqwtYFR1OVb8OpoRIjLuj/JDtoi0Owr72BeNp5Qy21++39Gw7ZjU/Yceyztu4SmHibMGToxylw== X-Received: by 2002:a05:6830:120e:: with SMTP id r14mr9446584otp.4.1560991197566; Wed, 19 Jun 2019 17:39:57 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a9d:60d7:: with SMTP id b23ls766321otk.14.gmail; Wed, 19 Jun 2019 17:39:56 -0700 (PDT) X-Received: by 2002:a9d:3675:: with SMTP id w108mr12174424otb.271.1560991196570; Wed, 19 Jun 2019 17:39:56 -0700 (PDT) In-Reply-To: <6c1c4146-20b8-437a-878a-24c4ac915946-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> X-Original-Sender: hanzukun-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org Precedence: list Mailing-list: list pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org; contact pandoc-discuss+owners-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org List-ID: X-Google-Group-Id: 1007024079513 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , Xref: news.gmane.org gmane.text.pandoc:22991 Archived-At: ------=_Part_85_360873073.1560991195704 Content-Type: multipart/alternative; boundary="----=_Part_86_42063637.1560991195705" ------=_Part_86_42063637.1560991195705 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hello! It is possible to do with external tools, for example "jq=20 " . This will give you (kind of) the=20 desired output : pandoc -t json myfile.md | jq . Regards Hans Den torsdag 20 juni 2019 kl. 07:13:22 UTC+9 skrev Laurent Ren=C3=A9 de Cotr= et: > > Hello, > > I often work on Pandoc filters, and I regularly look at Pandoc's native= =20 > 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,St= r=20 > "This",Space,Str "is",Space,Str "a",Space,Str "caption"]=20 > ("generated/other\\8842295943125512100.jpg","fig:")] > ,Para [Str "As",Space,Str "you",Space,Str "can",Space,Str "see",Space,Str= =20 > "in",Space,Str "fig.\160\&1,",Space,Str "pandoc-crossref",Space,Str=20 > "is",Space,Str "compatible",Space,Str "with",Space,Str "the",Space,Str=20 > "ouput",Space,Str "of",Space,Str "pandoc-pyplot."]] > > It would be very useful to get a pretty-printing version of the above,=20 > e.g.: > > [ > Para [ > Image=20 > ("fig:myfigure",[],[])=20 > [Str "Figure",Space,Str "1:",Space,Str "This",Space,Str=20 > "is",Space,Str "a",Space,Str "caption"]=20 > ("generated/other\\8842295943125512100.jpg","fig:") > ], > Para [ > Str "As",Space,Str "you",Space,Str "can",Space,Str "see",Space,St= r=20 > "in",Space,Str "fig.\160\&1,",Space,Str "pandoc-crossref",Space, > Str "is",Space,Str "compatible",Space,Str "with",Space,Str=20 > "the",Space,Str "ouput",Space,Str "of",Space, Str "pandoc-pyplot." > ] > ] > > After a cursory look at the source in Text.Pandoc.Writers.Native, it=20 > would be possible to make a nice, indented, pretty version of native=20 > Haskell, given that WriterOptions type has the writerColumns attribute. > > Is this something that the Pandoc community might be interested in? Shoul= d=20 > it be a different format than "native", called "pretty-native" or somethi= ng? > > I'm happy to put together a pull request. > > Laurent > > --=20 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 e= mail 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. ------=_Part_86_42063637.1560991195705 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hello!

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

Regards
Hans

Den torsdag 20 juni 2019 kl. 07:13:22 UTC+9 skrev L= aurent Ren=C3=A9 de Cotret:
Hello,

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

H= ere 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&= quot;,Space,Str "is",Space,Str "a",Space,Str "capt= ion"] ("generated/other\\8842295943125512100.jpg","= ;fig:")]
,Para [Str "As",Space,Str "you&= quot;,Space,Str "can",Space,Str "see",Space,Str "i= n",Space,Str "fig.\160\&1,",Space,Str "pandoc-cross= ref",Space,Str "is",Space,Str "compatible",Space,S= tr "with",Space,Str "the",Space,Str "ouput",S= pace,Str "of",Space,Str "pandoc-pyplot."]]
<= /code>

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

[
=C2=A0 =C2=A0 Para=C2=A0[
=C2=A0 =C2=A0 =C2=A0 =C2=A0 Imag= e=C2=A0
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ("fig:myfigure",[],[])= =C2=A0
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 [Str "Figure",S= pace,Str "1:",Space,Str "This",Space,Str "is"= ,Space,Str "a",Space,Str "caption"]=C2=A0
<= div>=C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ("generated/other\\88422959431255= 12100.jpg","fig:")
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0]= ,
=C2=A0 =C2=A0= Para [
=C2=A0 = =C2=A0 =C2=A0 =C2=A0 Str "As",Space,Str "you",Space,Str= "can",Space,Str "see",Space,Str "in",Space,S= tr "fig.\160\&1,",Space,Str "pandoc-crossref",Space= ,
=C2=A0 =C2=A0= =C2=A0 =C2=A0 Str "is",Space,Str "compatible",Space,St= r "with",Space,Str "the",Space,Str "ouput",Sp= ace,Str "of",Space, Str "pandoc-pyplot."
=C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0]
]

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

Is this something that the Pa= ndoc community might be interested in? Should it be a different format than= "native", called "pretty-native" or something?<= /div>

I'm happy to= put together a pull request.

Laurent

=

--
You received this message because you are subscribed to the Google Groups &= quot;pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an e= mail to pand= oc-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.co= m.
For more options, visit http= s://groups.google.com/d/optout.
------=_Part_86_42063637.1560991195705-- ------=_Part_85_360873073.1560991195704--