From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/15755 Path: news.gmane.org!.POSTED!not-for-mail From: Kolen Cheung Newsgroups: gmane.text.pandoc Subject: How to programmatically enforcing a pandoc markdown style Date: Sat, 22 Oct 2016 02:09:32 -0700 (PDT) Message-ID: Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_590_1287566796.1477127372848" X-Trace: blaine.gmane.org 1477127386 13625 195.159.176.226 (22 Oct 2016 09:09:46 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 22 Oct 2016 09:09:46 +0000 (UTC) To: pandoc-discuss Original-X-From: pandoc-discuss+bncBCS252WXTEIBBTOZVTAAKGQEEVSO7FI-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Sat Oct 22 11:09:40 2016 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane.org Original-Received: from mail-qt0-f191.google.com ([209.85.216.191]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bxsJ1-0001hS-T6 for gtp-pandoc-discuss@m.gmane.org; Sat, 22 Oct 2016 11:09:32 +0200 Original-Received: by mail-qt0-f191.google.com with SMTP id f6sf75947866qtd.1 for ; Sat, 22 Oct 2016 02:09:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20120806; h=sender:date:from:to:message-id: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=du9D/DAEslueHF4mMX5vf+iWceBEF9HgVAs+VCmvUkU=; b=c0axj3hW0w/I4Tyu/Iys9Uu1/RlLFtTAo8E36NQiQMAVb5S28gqLvJ/1XSbrBsZ9zn 7SQDJEoZTB3d4A2aJlOB7C4Zui9LyF5TZrkaSY6bIdoaEOs7glYJUGQGCvqEbwOQ6x+g IxcOMRM66L4M8Le1fBz2GBhOhaGi0w9DWEPdSLeGv99Thw43BUxbWcRA6k5BXcQDDHfo gafzEe80FxIPkJgyqAsVMmdImWQARfZNXj0Dbzl2bSpF5/byFQiReIVf5fEKKGnb6mTV FVsuDQyxdmLf+41TZanJ+1PchwaOv8ybBK642dm4rmoW0yPLQCr979mfnbuT5ygNx9SL qemA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:message-id: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=du9D/DAEslueHF4mMX5vf+iWceBEF9HgVAs+VCmvUkU=; b=DC77g6QXpGFHSb8c/ZulOD53xo8p69UN6sKKT7UB5/S8Oe2iWonz/yYZa9yfuReoOJ jMUuHxriIv84UrsFvgQv0hswPeJfl52L3UIiKYE6oUxfCFEVjtuyDa6a4kmiHmHww9VT T5Tfq0yO5k3CHR0yFmzby5Zp/BgxoBoK3HL2klkPqLaS3s58T3pRvxznDEGEEX8P5FH0 bPNTobf6cGaO45b5BUan8vOVysTk5FQo22DMxWTK7NN4AfIBpz9sehTyTImazYarqfYe SSeVsz/fgN8Eq3MLsjdemfHzXrGH4i2ZN/vgAc9iwjthw5Js4qD8Hx6UtqZy8+oV0BZz Ulmw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=sender:x-gm-message-state:date:from:to:message-id: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=du9D/DAEslueHF4mMX5vf+iWceBEF9HgVAs+VCmvUkU=; b=Go8s9jz9D6Sl3IIcgnXV4eJQ0gcOfmAtjyhJ+XPhDLaSSNKE+XfJYwMjkCrHSMK/Dj cBAVeGV1BJ9tSqAs9VO7I0TJBSlAJXTqZX68clHp72lrxs13ZAUBvi7R4juFVZVrmCbi lDmAvApnivxlr74vVr3DDTOlVHsSFkDIwujD7tMkPBFPz7AZahWhDsFpkrG4sF4V2X8/ 3VkHXdIM/G9iHmJNmI0AR+v0K0WcTh5P6DSGV2kLDPZUEZ8Fjz2l02x9wijOU90AF26A 28MKEe8KpTfrPb6ba+HhFIAxsFzRtKp6BdYK7k4Oz6TovyAEInCB5H9auTEbwEAsPYUj qtpQ== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AA6/9RmxcYt1v2P0Kv9Af1I0+E5jSwa44EOQLThbr4yclgB1+nn1fByXEvXv+Rx2yi6cqA== X-Received: by 10.157.10.98 with SMTP id 89mr2973551otg.3.1477127373935; Sat, 22 Oct 2016 02:09:33 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 10.157.54.164 with SMTP id h33ls8483266otc.12.gmail; Sat, 22 Oct 2016 02:09:33 -0700 (PDT) X-Received: by 10.157.10.98 with SMTP id 89mr2973550otg.3.1477127373497; Sat, 22 Oct 2016 02:09:33 -0700 (PDT) X-Original-Sender: christian.kolen-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:15755 Archived-At: ------=_Part_590_1287566796.1477127372848 Content-Type: multipart/alternative; boundary="----=_Part_591_1027306835.1477127372848" ------=_Part_591_1027306835.1477127372848 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi, all, pandoc from markdown to markdown=20 Ever since I read issue #2814 ,= =20 I find it a very useful trick. I am now working on a project, that starting from next semester will open= =20 up to about 100 GSIs to collaboratively update a series of workbooks. I=20 want to incorporate the said trick as a cleanup tool to normalize the=20 source code (in pandoc markdown with minimal raw LaTeX). Most things works very well, but however I find a few problems. I don=E2=80= =99t=20 know if there=E2=80=99s any way to get around these? 1. ### Main Goals {-} becomes ### Main Goals {#main-goals .unnumbered}:= =20 I want to keep using {-} for 2 reasons: shorter, and does not depends on= =20 the header (which will gets repeated after cat).=20 2. 1. abcd... becomes 1. abcd...: it seems that pandoc enforce 2 spaces= =20 after the enumerated list/bullet list. Are there ways to change this=20 behavior? I suppose I could use a regex to transform it back but it seem= s=20 to prone to error.=20 3. inline footnotes: I found that pandoc would convert inline footnotes= =20 to explicit footnotes with [^1], [^2].... And the use of inline_notes=20 cannot be enforced. I opened an issue in #3172=20 . I suppose I can change the= =20 source code to use explicit footnotes only. But it seems difficult to=20 enforce it and tell people not to use inline footnotes.=20 4. ™ becomes =E2=84=A2: after studying how trademark should be typ= eset,=20 considering I aim at HTML+LaTeX output and no non-ascii characters in th= e=20 source code, I chose ™. But pandoc would happily convert that to = =E2=84=A2=20 without my consent. I suppose other such HTML characters might behave=20 similarly. (by the way, input ™ from markdown would output =E2=84= =A2 in=20 TeX, and pdflatex has no problem with that. The resultant PDF looks=20 identical as if I use \texttrademark. Does anyone knows why? I thought= =20 pdflatex don=E2=80=99t like unicode.)=20 5. pipe tables becomes HTML tables: I believe it is a bug so I opened is= sue=20 #3171 . Even more=20 interestingly, the pipe tables were obtained by a .docx to .md=20 conversion.=20 The command I used to enforce =E2=80=9Cpandoc style=E2=80=9D is: find . -maxdepth 2 -mindepth 2 -iname "*.md" -exec pandoc -f markdown+abbre= viations+autolink_bare_uris+markdown_attribute+mmd_header_identifiers+mmd_l= ink_attributes+mmd_title_block+tex_math_double_backslash-latex_macros -t ma= rkdown+raw_tex-native_spans-simple_tables-multiline_tables-grid_tables-late= x_macros --normalize -s --wrap=3Dnone --atx-headers -o {} {} \; =E2=80=9Cpandoc lint=E2=80=9D=20 By the way, does anyone know how to do some sort of =E2=80=9Cpandoc lint=E2= =80=9D?=20 Currently I checked the TeX output by chktex -q and lacheck, which=20 sometimes gives useful typographical hints on what to correct. And I remembered I read somewhere @jgm mentioned something about a random= =20 string should be a valid markdown syntax (part of the markdown philosophy= =20 kind of thing). In this sense it seems very difficult to enforce a =E2=80= =9Cright=E2=80=9D=20 syntax in markdown. cat a lot of markdown files into one=20 Lastly, there=E2=80=99s a very minor issue: if I cat lots of markdown files= into=20 one, then between the end of one file to the beginning of another, the lack= =20 of enough newlines between them might make it a wrong markdown syntax. ( *e.g.* the beginning of a file starts with a heading, some text editors ( *e.g.* Atom) normalized my trailing newline without my consent to 1 empty= =20 line. So then the heading would start immediately after the last paragraph,= =20 which pandoc will not parse it as a heading.) I currently get around this problem with a script to normalize every files= =20 with exactly 2 trailing empty lines. I suppose cating markdown files would be a very common process. How=20 normally would others do it? Thanks in advance, Kolen =E2=80=8B --=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/e82e943f-604e-4a5b-a621-4b3dd82e42c0%40googlegroups.com. For more options, visit https://groups.google.com/d/optout. ------=_Part_591_1027306835.1477127372848 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

Hi, all,=

pan= doc from markdown to markdown

Ever since I read issue #2814, I find it a very u= seful trick.

I am now working on a project, t= hat starting from next semester will open up to about 100 GSIs to collabora= tively update a series of workbooks. I want to incorporate the said trick a= s a cleanup tool to normalize the source code (in pandoc markdown with mini= mal raw LaTeX).

Most things works very well, but= however I find a few problems. I don=E2=80=99t know if there=E2=80=99s any= way to get around these?

  1. ### Main Goals {-} becomes ### Main Goals {= #main-goals .unnumbered}: I want to keep using {-} for 2 reasons: = shorter, and does not depends on the header (which will gets repeated after= cat<= /code>).
  2. 1. abcd... becomes 1. abcd...: it see= ms that pandoc enforce 2 spaces after the enumerated list/bullet list. Are = there ways to change this behavior? I suppose I could use a regex to transf= orm it back but it seems to prone to error.
  3. inline footnotes: I found that pandoc woul= d convert inline footnotes to explicit footnotes with [^1], [^2].... And = the use of inline_notes cannot be enforced. I opened an issue in #3172. I suppose I can ch= ange the source code to use explicit footnotes only. But it seems difficult= to enforce it and tell people not to use inline footnotes.
  4. &trade; becomes =E2=84=A2: after s= tudying how trademark should be typeset, considering I aim at HTML+LaTeX ou= tput and no non-ascii characters in the source code, I chose &trade;.= But pandoc would happily convert that to =E2=84=A2 without my consent. I= suppose other such HTML characters might behave similarly. (by the way, in= put &= amp;trade; from markdown would output =E2=84=A2 in TeX, and pdflatex has no problem with that. The resultant PDF looks identical as if I us= e \te= xttrademark. Does anyone knows why? I thought pdflatex don=E2=80= =99t like unicode.)
  5. pipe tables becomes HTML tables: I believe= it is a bug so I opened issue #3171. Even more interestingly, the pipe tables were obtained= by a .docx to .md conversion.

The command I used to enforce = =E2=80=9Cpandoc style=E2=80=9D is:

find=
 . -maxdepth 2 -mindepth 2 -iname "*.md" -exec pandoc -f markdown+abbreviations+autolink_bare_uris+markdown_attribute+=
mmd_header_identifiers+mmd_link_attributes+mmd_title_block+tex_math_double_=
backslash-latex_macros -t markdown+raw_tex-native_spans-simple_tables-multi=
line_tables-grid_tables-latex_macros --normalize -s --wrap=3Dnone --atx-headers -o {} {} \;

=E2=80=9Cpandoc lint= =E2=80=9D

By the way, does anyone know how= to do some sort of =E2=80=9Cpandoc lint=E2=80=9D? Currently I checked the = TeX output by chktex -q and lacheck, which sometimes gives useful typog= raphical hints on what to correct.

And I remembered I read somewher= e @jgm mentioned something about a random string should be a valid markdown= syntax (part of the markdown philosophy kind of thing). In this sense it s= eems very difficult to enforce a =E2=80=9Cright=E2=80=9D syntax in markdown= .

cat= a lot of markdown files into one

Lastly, there=E2=80=99s a very m= inor issue: if I cat lots of markdown files into one, then between the en= d of one file to the beginning of another, the lack of enough newlines betw= een them might make it a wrong markdown syntax. (e.g. the beginnin= g of a file starts with a heading, some text editors (e.g. Atom) n= ormalized my trailing newline without my consent to 1 empty line. So then t= he heading would start immediately after the last paragraph, which pandoc w= ill not parse it as a heading.)

I currently get around this prob= lem with a script to normalize every files with exactly 2 trailing empty li= nes.

I suppose cating markdown file= s would be a very common process. How normally would others do it?

Thanks in advance,
Kolen

=E2=80=8B

--
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/e82e943f-604e-4a5b-a621-4b3dd82e42c0%40googlegroups.co= m.
For more options, visit http= s://groups.google.com/d/optout.
------=_Part_591_1027306835.1477127372848-- ------=_Part_590_1287566796.1477127372848--