From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/16591 Path: news.gmane.org!.POSTED!not-for-mail From: Kolen Cheung Newsgroups: gmane.text.pandoc Subject: Re: Writing filter: getting `--top-level-division`? Date: Wed, 4 Jan 2017 15:30:43 -0800 (PST) Message-ID: References: <39d1e149-7ccb-45e4-a169-abfc5a4bc935@googlegroups.com> <20161215130942.GC64436@Administrateurs-iMac-3.local> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_3699_1551848364.1483572643214" X-Trace: blaine.gmane.org 1483572651 19890 195.159.176.226 (4 Jan 2017 23:30:51 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 4 Jan 2017 23:30:51 +0000 (UTC) To: pandoc-discuss Original-X-From: pandoc-discuss+bncBCS252WXTEIBBJELW3BQKGQEJWAXTIQ-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Thu Jan 05 00:30:46 2017 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane.org Original-Received: from mail-yb0-f183.google.com ([209.85.213.183]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cOv0y-0003oH-E2 for gtp-pandoc-discuss@m.gmane.org; Thu, 05 Jan 2017 00:30:40 +0100 Original-Received: by mail-yb0-f183.google.com with SMTP id l23sf48965570ybj.1 for ; Wed, 04 Jan 2017 15:30:45 -0800 (PST) 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:x-spam-checked-in-group:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=WamAA8Qfq2P3rZA6t7AHzQQGEsfXmS4FfYxDks135lA=; b=CVFJNqZR09pmgkfL3ma+yvZuHYTn7Ot+d+1kwp0jhQ9RB5hDDKAxtlLVbT5SCrtLHo qf+04q3A+2dlH7dbvOpho0fPgAAif7ZZKAOydxG9so7qaiAm6mq+K52vKKtwfVHLG0zg IgNvpvtu9T5XNOWgSpjtIsEZW0NEl2L5bkJ2bltBwOm9vVPVpPOqW6e1k45ZJlggkcu1 9cgUTYARbixMYRv2sWDu6OCnCg8ZnQDstMpNOc5mSBux7pxJXpqjYpeGVMBSbKIXWueu I48F6IltB42M7PoMaC2RRLNYnFmzShzNaNrLCjM8TjLWhUGSVTUMEv8k8LRg53k2vzU6 cGsw== 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 :x-spam-checked-in-group:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=WamAA8Qfq2P3rZA6t7AHzQQGEsfXmS4FfYxDks135lA=; b=fRaJ4xcLalggRS1UMThDWXkdqxW5G0f4+JO6OzRsa1oaC3IdO8Xs6BJp1IJZqPJOX0 6vR6b7ilbgyr/u4mgKi/9mh1quj9MugbjFjPJDgyJ2UUQQtWoJSR9tIHJNILsSMC2R4h UxY4GYSJ3d5dDpg3twOEABxSI5UqofvrXnzaJvNisHnt3bAcizZpqMx46Ts9nrpBiYqN bFIuEn9UU6ewWzV+mibrG6JtNmDUHMiW7R3Q2ijHh8mjfI6++LeWhaGPOkWf7+NTqbzn RJafgfpWfMfJLaorI6itdD6t2PqGr6R7b0EzneZAmbL9aElmYVSaDw2Tls+N5h+UPAMo 9QXQ== 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=WamAA8Qfq2P3rZA6t7AHzQQGEsfXmS4FfYxDks135lA=; b=LMGgJ1eXEtINRplbB8i0bi6Ky5qIu/jNbgZJPo6zjOEzwrRttCdUatyGHevFcMX/Wo yTC1EeI7bBf187dY0WNkYPsxwDA4I0dq+/0k1DN2L5sjOA6tt43EhENvVzGrcTvqMymt SFtVSTxm5QJxjOsFj+gseOVu3qMUVGl13gL8hosIOOkYzHhizsjls++3APln0wPIF+so p1vmOL/Yf9wbJFVtQfVBdJuh3bGoVx+ddOkTMcxiePQOJ1mR3U2OFCGlFVlDdJQWjHwa 8kUsR6aWtC4CoXECI1Zxmg9DyvmUlAVA4iaT5YIinnyT1Y6siahU3PnzN4FyfXgyGi25 /APQ== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AIkVDXIyid9/9Eu03HaJPycIi2C4cosKTwAM2yt1/L3LJOlXVhuaVHl3ynfpPfIFU9peeg== X-Received: by 10.157.17.3 with SMTP id g3mr3449361ote.8.1483572644645; Wed, 04 Jan 2017 15:30:44 -0800 (PST) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 10.157.52.220 with SMTP id t28ls43441763otd.3.gmail; Wed, 04 Jan 2017 15:30:43 -0800 (PST) X-Received: by 10.157.45.170 with SMTP id g39mr3448613otb.16.1483572643902; Wed, 04 Jan 2017 15:30:43 -0800 (PST) In-Reply-To: <20161215130942.GC64436-BKjuZOBx5Kn2N3qrpRCZGbhGAdq7xJNKhPhL2mjWHbk@public.gmane.org> 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:16591 Archived-At: ------=_Part_3699_1551848364.1483572643214 Content-Type: multipart/alternative; boundary="----=_Part_3700_333876668.1483572643215" ------=_Part_3700_333876668.1483572643215 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Would you consider to pass the info of the top-level-division in the JSON? When reading: --top-level-division=3D[default|section|chapter|part] : Treat top-level headers as the given division type in LaTeX, ConTeXt,=20 DocBook, and TEI output. The hierarchy order is part, chapter, then=20 section; all headers are shifted such that the top-level header becomes the= =20 specified type. The default behavior is to determine the best division type= =20 via heuristics: unless other conditions apply, section is chosen. When the= =20 LaTeX document class is set to report, book, or memoir (unless the article= =20 option is specified), chapter is implied as the setting for this option. If= =20 beamer is the output format, specifying either chapter or part will cause= =20 top-level headers to become \part{..}, while second-level headers remain as= =20 their default type. I found that requiring the user to specify the top-level-division in YAML= =20 for filters (in addition to the cli option they need) is not enough,=20 because of the default option. Users might want to leave it as default, and= =20 it means filters author need to replicate the logic to determine which one= =20 becomes the default. By the way, I don=E2=80=99t understand the last few words of this quote: se= cond-level=20 headers remain as their default type, what are their default type? On Thursday, December 15, 2016 at 5:10:30 AM UTC-8, John MacFarlane wrote: There's no way to get this information in a filter; it's=20 > part of the WriterOptions.=20 > > +++ Kolen Cheung [Dec 15 16 02:54 ]:=20 > >Is it possible to determine the=20 > `--top-level-division=3D[default|section|chapter|part]` option used in a= =20 > filter? I want to write a filter that needs to know how the header-level-= 1=20 > is related to the LaTeX's top level division.=20 > >=20 > >I tried using such settings with `-t native -s` and it seems the info=20 > isn't there.=20 > >=20 > >--=20 > >You received this message because you are subscribed to the Google Group= s=20 > "pandoc-discuss" group.=20 > >To unsubscribe from this group and stop receiving emails from it, send a= n=20 > email to pandoc-discus...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org .=20 > >To post to this group, send email to pandoc-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org=20 > .=20 > >To view this discussion on the web visit=20 > https://groups.google.com/d/msgid/pandoc-discuss/39d1e149-7ccb-45e4-a169-= abfc5a4bc935%40googlegroups.com.=20 > > >For more options, visit https://groups.google.com/d/optout.=20 > > =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/b94d7725-f24e-4ff0-8cbb-eceb9783ffce%40googlegroups.com. For more options, visit https://groups.google.com/d/optout. ------=_Part_3700_333876668.1483572643215 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

= Would you consider to pass the info of the top-level-division in the JSON?<= /p>

When reading:

--top-level-divis= ion=3D[default|section|chapter|part]

: Treat top-level headers = as the given division type in LaTeX, ConTeXt, DocBook, and TEI output. The hierarchy order is part, chapter, then se= ction; all headers are shifted such that the top-level header becomes the spec= ified type. The default behavior is to determine the best division type via heuristics: unless other conditions apply, section is= chosen. When the LaTeX document class is set to report, book= , or memoir (unless the article option is specified), chapter is implied as the setting for this option. If beamer is the output format, specifying= either chapter or part will cause top-level headers to become \part{..}, while second-level headers remain as their default type.

I found that requiring the u= ser to specify the top-level-division in YAML for filters= (in addition to the cli option they need) is not enough, because of the default option. Users might want to leave it as default, and= it means filters author need to replicate the logic to determine which one= becomes the default.

By the way, I don=E2=80=99t = understand the last few words of this quote: second-level headers= remain as their default type, what are their default type?

On Thursday, December 15, 20= 16 at 5:10:30 AM UTC-8, John MacFarlane wrote:

There'= s no way to get this information in a filter; it's
part of the WriterOptions.

+++ Kolen Cheung [Dec 15 16 02:54 ]:
>Is it possible to determine the `--top-level-division=3D[defau= lt|section|chapter|part]` option used in a filter? I want to write a filter= that needs to know how the header-level-1 is related to the LaTeX's to= p level division.
>
>I tried using such settings with `-t native -s` and it seems the in= fo isn't there.
>
>--=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, s= end an email to pandoc-discus...@googlegroups.c= om.
>To post to this group, send email to pandoc-= ...@googlegroups.com.
>To view this discussion on the web visit https://groups.google.co= m/d/msgid/pandoc-discuss/39d1e149-7ccb-45e4-a169-abfc5a4bc935%40googlegroups.com.
>For more options, visit https://groups.google.com/d/opt= out.

=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/b94d7725-f24e-4ff0-8cbb-eceb9783ffce%40googlegroups.co= m.
For more options, visit http= s://groups.google.com/d/optout.
------=_Part_3700_333876668.1483572643215-- ------=_Part_3699_1551848364.1483572643214--