As a workaround to this issue, the following can be done:
- Place an empty div with an ad hoc class (super-part, in my case) and
an id that describes de section that will begin, as in
- Write a filter to
1. Get all divs with class super-part and return an empty
with the
same id
2. Get all headers and increment their level (from
to
, etc.)
- Compile with pandoc
- Post-process the html file to
1. Delete all empty
2. Replace
with
,
with
, etc.
3. Reduce the *level* classes of the (from level1 to level0,
level2 to level1, etc)
Im my case, I postprocess the file with the sed Linux command, so it will
be automated, as I convert my files with a shell script.
This, however is very impractical for ePubs, because in that case one would
have to extract the files, make this replacements to all and only the
relevant files, then compress it again.
I hope that someday would be a way to get a valid output for this cases
natively.
El jueves, 20 de abril de 2017, 18:23:46 (UTC-5), Marlon escribió:
>
> I’m trying to write a book in pandoc markdown, but I’m having an issue
> with --section-divs to enclose each matter in a definite block with its own
> id.
>
> Suppose a markdown document like this
>
>
> ## Introduction
> …
>
>
> # Chapter I
> …
> #Chapter II
> …
>
>
>
>
>
> If used with --section-divs, the section opened by the previous heading
> won’t close until the next heading. Resulting in something like (assuming
> -t html5)
>
>
>
>
Introduction
> …
>
>
>
>
>
Chapter I
> …
>
>
>
> Is there a way to tell pandoc to close all pending before
> another header?
> Or for pandoc to recognize , , , , ,
> , ? (before those closing tags, of course).
>
--
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/aef1b11a-d336-4218-b4ec-1ae08e723c42%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.