public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
* Limit Heading Numbering Depth (Feature Wish)
@ 2015-01-19 22:25 Tim Hill
       [not found] ` <757e3675-1a0a-4081-9126-298b501dff4c-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Tim Hill @ 2015-01-19 22:25 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw


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

I would love to see a command line switch "--numbering-depth" in Pandoc 
that works in a similar manner to "--toc-depth" but for section numbering.

Rationale: We create documents with four levels of heading (H1 to H4 in 
HTML parlance), but only with H1 and H2 to be numbered (H3 is used for API 
names and H4 for paragraph headings). At present, we can do this by marking 
the H3/H4 headings as unnumbered, something like:

### Some Heading {-}

It works well, BUT I have a couple of issues with this. First, I can't tell 
you how often our documentation guys forget to add that "{-}" tag. Second, 
I don't like the idea of decorating a markdown file with something that 
really feels more to me like output policy.

So my wish is that I can use something like "--number-sections 
--numbering-depth 2" to limit section numbering to H1/H2 only.

I *suspect* there might be a way to do this already, but I've poked at 
style sheets and various options and haven't found anything except the 
"{-}" tags.

Good/bad idea?
--Tim

-- 
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/757e3675-1a0a-4081-9126-298b501dff4c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

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

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

* Re: Limit Heading Numbering Depth (Feature Wish)
       [not found] ` <757e3675-1a0a-4081-9126-298b501dff4c-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2015-01-19 22:49   ` John MacFarlane
  2015-01-19 23:37   ` Matthew Pickering
  1 sibling, 0 replies; 4+ messages in thread
From: John MacFarlane @ 2015-01-19 22:49 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

If you're targeting LaTeX/PDF, you can achieve this in the template.
But I can see the use for this in other formats.

+++ Tim Hill [Jan 19 15 14:25 ]:
>   I would love to see a command line switch "--numbering-depth" in Pandoc
>   that works in a similar manner to "--toc-depth" but for section
>   numbering.
>   Rationale: We create documents with four levels of heading (H1 to H4 in
>   HTML parlance), but only with H1 and H2 to be numbered (H3 is used for
>   API names and H4 for paragraph headings). At present, we can do this by
>   marking the H3/H4 headings as unnumbered, something like:
>   ### Some Heading {-}
>   It works well, BUT I have a couple of issues with this. First, I can't
>   tell you how often our documentation guys forget to add that "{-}" tag.
>   Second, I don't like the idea of decorating a markdown file with
>   something that really feels more to me like output policy.
>   So my wish is that I can use something like "--number-sections
>   --numbering-depth 2" to limit section numbering to H1/H2 only.
>   I *suspect* there might be a way to do this already, but I've poked at
>   style sheets and various options and haven't found anything except the
>   "{-}" tags.
>   Good/bad idea?
>   --Tim
>
>   --
>   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 [1]pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
>   To post to this group, send email to
>   [2]pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
>   To view this discussion on the web visit
>   [3]https://groups.google.com/d/msgid/pandoc-discuss/757e3675-1a0a-4081-
>   9126-298b501dff4c%40googlegroups.com.
>   For more options, visit [4]https://groups.google.com/d/optout.
>
>References
>
>   1. mailto:pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
>   2. mailto:pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
>   3. https://groups.google.com/d/msgid/pandoc-discuss/757e3675-1a0a-4081-9126-298b501dff4c-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org?utm_medium=email&utm_source=footer
>   4. https://groups.google.com/d/optout


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

* Re: Limit Heading Numbering Depth (Feature Wish)
       [not found] ` <757e3675-1a0a-4081-9126-298b501dff4c-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  2015-01-19 22:49   ` John MacFarlane
@ 2015-01-19 23:37   ` Matthew Pickering
       [not found]     ` <CALuQ0m_R9e5Vfb569eaUHzdwvy-mU-SX66MO+VBWYreiR5c7KA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  1 sibling, 1 reply; 4+ messages in thread
From: Matthew Pickering @ 2015-01-19 23:37 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

This is very easy to achieve with a filter.

https://gist.github.com/mpickering/ffa67748a9ca7a2ac7c8

usage

pandoc -f markdown -t .... --filter=scrub.hs



On Mon, Jan 19, 2015 at 10:25 PM, Tim Hill <drtimhill-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> I would love to see a command line switch "--numbering-depth" in Pandoc that
> works in a similar manner to "--toc-depth" but for section numbering.
>
> Rationale: We create documents with four levels of heading (H1 to H4 in HTML
> parlance), but only with H1 and H2 to be numbered (H3 is used for API names
> and H4 for paragraph headings). At present, we can do this by marking the
> H3/H4 headings as unnumbered, something like:
>
> ### Some Heading {-}
>
> It works well, BUT I have a couple of issues with this. First, I can't tell
> you how often our documentation guys forget to add that "{-}" tag. Second, I
> don't like the idea of decorating a markdown file with something that really
> feels more to me like output policy.
>
> So my wish is that I can use something like "--number-sections
> --numbering-depth 2" to limit section numbering to H1/H2 only.
>
> I *suspect* there might be a way to do this already, but I've poked at style
> sheets and various options and haven't found anything except the "{-}" tags.
>
> Good/bad idea?
> --Tim
>
> --
> 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/757e3675-1a0a-4081-9126-298b501dff4c%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.


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

* Re: Limit Heading Numbering Depth (Feature Wish)
       [not found]     ` <CALuQ0m_R9e5Vfb569eaUHzdwvy-mU-SX66MO+VBWYreiR5c7KA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2015-01-19 23:46       ` John MacFarlane
  0 siblings, 0 replies; 4+ messages in thread
From: John MacFarlane @ 2015-01-19 23:46 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

Good solution.

+++ Matthew Pickering [Jan 19 15 23:37 ]:
>This is very easy to achieve with a filter.
>
>https://gist.github.com/mpickering/ffa67748a9ca7a2ac7c8
>
>usage
>
>pandoc -f markdown -t .... --filter=scrub.hs
>
>
>
>On Mon, Jan 19, 2015 at 10:25 PM, Tim Hill <drtimhill-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>> I would love to see a command line switch "--numbering-depth" in Pandoc that
>> works in a similar manner to "--toc-depth" but for section numbering.
>>
>> Rationale: We create documents with four levels of heading (H1 to H4 in HTML
>> parlance), but only with H1 and H2 to be numbered (H3 is used for API names
>> and H4 for paragraph headings). At present, we can do this by marking the
>> H3/H4 headings as unnumbered, something like:
>>
>> ### Some Heading {-}
>>
>> It works well, BUT I have a couple of issues with this. First, I can't tell
>> you how often our documentation guys forget to add that "{-}" tag. Second, I
>> don't like the idea of decorating a markdown file with something that really
>> feels more to me like output policy.
>>
>> So my wish is that I can use something like "--number-sections
>> --numbering-depth 2" to limit section numbering to H1/H2 only.
>>
>> I *suspect* there might be a way to do this already, but I've poked at style
>> sheets and various options and haven't found anything except the "{-}" tags.
>>
>> Good/bad idea?
>> --Tim
>>
>> --
>> 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/757e3675-1a0a-4081-9126-298b501dff4c%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/CALuQ0m_R9e5Vfb569eaUHzdwvy-mU-SX66MO%2BVBWYreiR5c7KA%40mail.gmail.com.
>For more options, visit https://groups.google.com/d/optout.


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

end of thread, other threads:[~2015-01-19 23:46 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-19 22:25 Limit Heading Numbering Depth (Feature Wish) Tim Hill
     [not found] ` <757e3675-1a0a-4081-9126-298b501dff4c-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2015-01-19 22:49   ` John MacFarlane
2015-01-19 23:37   ` Matthew Pickering
     [not found]     ` <CALuQ0m_R9e5Vfb569eaUHzdwvy-mU-SX66MO+VBWYreiR5c7KA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-01-19 23:46       ` John MacFarlane

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