public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
* [docx 2 md]  Numbered titles only from levels 1 to 4
@ 2019-08-08 15:45 Jean SALMON
       [not found] ` <d4b41655-6612-4184-897e-cd806e56a29e-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Jean SALMON @ 2019-08-08 15:45 UTC (permalink / raw)
  To: pandoc-discuss


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

Hi Mister,

I'm using Pandoc to convert one Word document into one gfm Markdown file.
Using the "*--number-sections"* option, titles are well numbered. 

Nevertheless, I would like only the first 4 levels to be numbered (with 
titles of lower levels not numbered).
How it is possible please?

Thanks for your help.

Regards,

Jean


-- 
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 view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/d4b41655-6612-4184-897e-cd806e56a29e%40googlegroups.com.

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

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

* Re: [docx 2 md]  Numbered titles only from levels 1 to 4
       [not found] ` <d4b41655-6612-4184-897e-cd806e56a29e-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2019-08-08 17:53   ` John MacFarlane
       [not found]     ` <yh480kef1vtugs.fsf-pgq/RBwaQ+zq8tPRBa0AtqxOck334EZe@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: John MacFarlane @ 2019-08-08 17:53 UTC (permalink / raw)
  To: Jean SALMON, pandoc-discuss


You can use a filter to add the "unnumbered" class to each
Header of level > 4.

Save as fixheaders.lua

function Header(el)
    if el.level > 4 then
        el.classes = {"unnumbered"}
        return el
    end
end

Run with --lua-filter fixheaders.lua

Jean SALMON <jean.salmon.orange-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:

> Hi Mister,
>
> I'm using Pandoc to convert one Word document into one gfm Markdown file.
> Using the "*--number-sections"* option, titles are well numbered. 
>
> Nevertheless, I would like only the first 4 levels to be numbered (with 
> titles of lower levels not numbered).
> How it is possible please?
>
> Thanks for your help.
>
> Regards,
>
> Jean
>
>
> -- 
> 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 view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/d4b41655-6612-4184-897e-cd806e56a29e%40googlegroups.com.


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

* Re: [docx 2 md]  Numbered titles only from levels 1 to 4
       [not found]     ` <yh480kef1vtugs.fsf-pgq/RBwaQ+zq8tPRBa0AtqxOck334EZe@public.gmane.org>
@ 2019-08-09 10:35       ` Jean SALMON
       [not found]         ` <02ef680b-1680-4ca4-a27f-e00b13c7a1ca-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Jean SALMON @ 2019-08-09 10:35 UTC (permalink / raw)
  To: pandoc-discuss


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

It works fine! 
Thanks a lot!
:-)

Le jeudi 8 août 2019 19:53:22 UTC+2, John MacFarlane a écrit :
>
>
> You can use a filter to add the "unnumbered" class to each 
> Header of level > 4. 
>
> Save as fixheaders.lua 
>
> function Header(el) 
>     if el.level > 4 then 
>         el.classes = {"unnumbered"} 
>         return el 
>     end 
> end 
>
> Run with --lua-filter fixheaders.lua 
>
> Jean SALMON <jean.sal...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org <javascript:>> writes: 
>
> > Hi Mister, 
> > 
> > I'm using Pandoc to convert one Word document into one gfm Markdown 
> file. 
> > Using the "*--number-sections"* option, titles are well numbered. 
> > 
> > Nevertheless, I would like only the first 4 levels to be numbered (with 
> > titles of lower levels not numbered). 
> > How it is possible please? 
> > 
> > Thanks for your help. 
> > 
> > Regards, 
> > 
> > Jean 
> > 
> > 
> > -- 
> > 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-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org <javascript:>. 
> > To view this discussion on the web visit 
> https://groups.google.com/d/msgid/pandoc-discuss/d4b41655-6612-4184-897e-cd806e56a29e%40googlegroups.com. 
>
>

-- 
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 view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/02ef680b-1680-4ca4-a27f-e00b13c7a1ca%40googlegroups.com.

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

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

* Re: [docx 2 md] Numbered titles only from levels 1 to 4
       [not found]         ` <02ef680b-1680-4ca4-a27f-e00b13c7a1ca-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2019-08-12 16:54           ` BP Jonsson
  0 siblings, 0 replies; 4+ messages in thread
From: BP Jonsson @ 2019-08-12 16:54 UTC (permalink / raw)
  To: pandoc-discuss

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

You might want to change line 3 to

````
el.classes:extend({'unnumbered'})
````

so that no existing classes are lost.

Den fre 9 aug. 2019 12:35Jean SALMON <jean.salmon.orange-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> skrev:

> It works fine!
> Thanks a lot!
> :-)
>
> Le jeudi 8 août 2019 19:53:22 UTC+2, John MacFarlane a écrit :
>>
>>
>> You can use a filter to add the "unnumbered" class to each
>> Header of level > 4.
>>
>> Save as fixheaders.lua
>>
>> function Header(el)
>>     if el.level > 4 then
>>         el.classes = {"unnumbered"}
>>         return el
>>     end
>> end
>>
>> Run with --lua-filter fixheaders.lua
>>
>> Jean SALMON <jean.sal...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:
>>
>> > Hi Mister,
>> >
>> > I'm using Pandoc to convert one Word document into one gfm Markdown
>> file.
>> > Using the "*--number-sections"* option, titles are well numbered.
>> >
>> > Nevertheless, I would like only the first 4 levels to be numbered (with
>> > titles of lower levels not numbered).
>> > How it is possible please?
>> >
>> > Thanks for your help.
>> >
>> > Regards,
>> >
>> > Jean
>> >
>> >
>> > --
>> > 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-...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
>> > To view this discussion on the web visit
>> https://groups.google.com/d/msgid/pandoc-discuss/d4b41655-6612-4184-897e-cd806e56a29e%40googlegroups.com.
>>
>>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/pandoc-discuss/02ef680b-1680-4ca4-a27f-e00b13c7a1ca%40googlegroups.com
> <https://groups.google.com/d/msgid/pandoc-discuss/02ef680b-1680-4ca4-a27f-e00b13c7a1ca%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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 view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/CAFC_yuTExy2SyVgP-BPtxdEbi9HdhK%3DdxoUZvxqk1_%2B_g4Y8Gw%40mail.gmail.com.

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

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

end of thread, other threads:[~2019-08-12 16:54 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-08 15:45 [docx 2 md] Numbered titles only from levels 1 to 4 Jean SALMON
     [not found] ` <d4b41655-6612-4184-897e-cd806e56a29e-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2019-08-08 17:53   ` John MacFarlane
     [not found]     ` <yh480kef1vtugs.fsf-pgq/RBwaQ+zq8tPRBa0AtqxOck334EZe@public.gmane.org>
2019-08-09 10:35       ` Jean SALMON
     [not found]         ` <02ef680b-1680-4ca4-a27f-e00b13c7a1ca-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2019-08-12 16:54           ` BP Jonsson

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