public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
* Writing filter: getting `--top-level-division`?
@ 2016-12-15 10:54 Kolen Cheung
       [not found] ` <39d1e149-7ccb-45e4-a169-abfc5a4bc935-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: Kolen Cheung @ 2016-12-15 10:54 UTC (permalink / raw)
  To: pandoc-discuss

[-- Attachment #1: Type: text/plain, Size: 308 bytes --]

Is it possible to determine the `--top-level-division=[default|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 top level division.

I tried using such settings with `-t native -s` and it seems the info isn't there.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Writing filter: getting `--top-level-division`?
       [not found] ` <39d1e149-7ccb-45e4-a169-abfc5a4bc935-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2016-12-15 13:09   ` John MacFarlane
       [not found]     ` <20161215130942.GC64436-BKjuZOBx5Kn2N3qrpRCZGbhGAdq7xJNKhPhL2mjWHbk@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: John MacFarlane @ 2016-12-15 13:09 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

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=[default|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 top level division.
>
>I tried using such settings with `-t native -s` and it seems the info isn't there.
>
>-- 
>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/39d1e149-7ccb-45e4-a169-abfc5a4bc935%40googlegroups.com.
>For more options, visit https://groups.google.com/d/optout.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Writing filter: getting `--top-level-division`?
       [not found]     ` <20161215130942.GC64436-BKjuZOBx5Kn2N3qrpRCZGbhGAdq7xJNKhPhL2mjWHbk@public.gmane.org>
@ 2016-12-17  4:06       ` Kolen Cheung
  2016-12-17 11:33       ` BP Jonsson
  2017-01-04 23:30       ` Kolen Cheung
  2 siblings, 0 replies; 5+ messages in thread
From: Kolen Cheung @ 2016-12-17  4:06 UTC (permalink / raw)
  To: pandoc-discuss


[-- Attachment #1.1: Type: text/plain, Size: 1766 bytes --]

Is there a chance this can be changed?

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 
> part of the WriterOptions. 
>
> +++ Kolen Cheung [Dec 15 16 02:54 ]: 
> >Is it possible to determine the 
> `--top-level-division=[default|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 top level division. 
> > 
> >I tried using such settings with `-t native -s` and it seems the info 
> isn't there. 
> > 
> >-- 
> >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-discus...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org <javascript:>. 
> >To post to this group, send email to pandoc-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org 
> <javascript:>. 
> >To view this discussion on the web visit 
> https://groups.google.com/d/msgid/pandoc-discuss/39d1e149-7ccb-45e4-a169-abfc5a4bc935%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/f5bda5b4-25c0-4eac-9c3a-018b7cefda3e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

[-- Attachment #1.2: Type: text/html, Size: 3441 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Writing filter: getting `--top-level-division`?
       [not found]     ` <20161215130942.GC64436-BKjuZOBx5Kn2N3qrpRCZGbhGAdq7xJNKhPhL2mjWHbk@public.gmane.org>
  2016-12-17  4:06       ` Kolen Cheung
@ 2016-12-17 11:33       ` BP Jonsson
  2017-01-04 23:30       ` Kolen Cheung
  2 siblings, 0 replies; 5+ messages in thread
From: BP Jonsson @ 2016-12-17 11:33 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

[-- Attachment #1: Type: text/plain, Size: 2444 bytes --]

You can pass the same info both as a 'real' option and as a metadata value.
Not very elegant but it works.

Den 15 dec 2016 14:10 skrev "John MacFarlane" <jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org>:

> 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=[default|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 top level division.
>>
>> I tried using such settings with `-t native -s` and it seems the info
>> isn't there.
>>
>> --
>> 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/ms
>> gid/pandoc-discuss/39d1e149-7ccb-45e4-a169-abfc5a4bc935%40go
>> oglegroups.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/ms
> gid/pandoc-discuss/20161215130942.GC64436%40Administrateurs-iMac-3.local.
> 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/CAFC_yuQT%3D_c79NzoOFyfsfxjxYcCoBR5t0eKtWuPRb00SS0e2Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

[-- Attachment #2: Type: text/html, Size: 4113 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Writing filter: getting `--top-level-division`?
       [not found]     ` <20161215130942.GC64436-BKjuZOBx5Kn2N3qrpRCZGbhGAdq7xJNKhPhL2mjWHbk@public.gmane.org>
  2016-12-17  4:06       ` Kolen Cheung
  2016-12-17 11:33       ` BP Jonsson
@ 2017-01-04 23:30       ` Kolen Cheung
  2 siblings, 0 replies; 5+ messages in thread
From: Kolen Cheung @ 2017-01-04 23:30 UTC (permalink / raw)
  To: pandoc-discuss


[-- Attachment #1.1: Type: text/plain, Size: 3102 bytes --]



Would you consider to pass the info of the top-level-division in the JSON?

When reading:

--top-level-division=[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 
section; all headers are shifted such that the top-level header becomes the 
specified 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 user 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’t 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, 2016 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=[default|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 top level division. 
> > 
> >I tried using such settings with `-t native -s` and it seems the info 
> isn't there. 
> > 
> >-- 
> >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-discus...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org <javascript:>. 
> >To post to this group, send email to pandoc-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org 
> <javascript:>. 
> >To view this discussion on the web visit 
> https://groups.google.com/d/msgid/pandoc-discuss/39d1e149-7ccb-45e4-a169-abfc5a4bc935%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/b94d7725-f24e-4ff0-8cbb-eceb9783ffce%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

[-- Attachment #1.2: Type: text/html, Size: 19828 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-01-04 23:30 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-15 10:54 Writing filter: getting `--top-level-division`? Kolen Cheung
     [not found] ` <39d1e149-7ccb-45e4-a169-abfc5a4bc935-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2016-12-15 13:09   ` John MacFarlane
     [not found]     ` <20161215130942.GC64436-BKjuZOBx5Kn2N3qrpRCZGbhGAdq7xJNKhPhL2mjWHbk@public.gmane.org>
2016-12-17  4:06       ` Kolen Cheung
2016-12-17 11:33       ` BP Jonsson
2017-01-04 23:30       ` Kolen Cheung

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).