Command line option to specify that DocBook should use recursive <section> elements #585

wants to merge 1 commit into


None yet
4 participants

I'm using Publican and it expects the nested section tags rather than the sect1 ... sect5 tags.

Currently I've got some hacks to work around it, but it would be nice if pandoc could do it.
Would you consider something like this?

This is working for me. My devel environment is Fedora 17.

Does it need a test? Do you think --nested-sections would be a better name for it? (I was considering --docbook-recursive-sections but thought it was a bit long).

@simonbaird simonbaird Add boolean --recursive-sections option. Affects DocBook writer.
If this option is set then DocBook output will use <section>
elements instead of <sect1>, <sect2> ... <sect5> and <simplesect>.

This pull request fails (merged 36a292f into bb0b5e9).

I see there is some discussion here:

The arguments against seem to be:

  1. "it's easy to XSLT transform/sed hack/manual edit between the two formats so why bother"
  2. "let's not have too many command line options"

Ping? Any thoughts?


jgm commented Aug 29, 2012

I'll consider it further when I have a chance. But my main
thought is still as before -- I'd prefer not to add lots of
options for things that can be done so simply in postprocessing.

+++ Simon Baird [Aug 28 12 18:25 ]:

Ping? Any thoughts?

Reply to this email directly or [1]view it on GitHub.


  1. #585 (comment)

crmoore commented May 29, 2013

The current behavior generates invalid docbook xml for sections nested 7-levels deep or greater. According to the docbook 4 DTD and docbook 5 schema, 'simplesect's must be leaf sections and can't be nested. The only way to go more than 6 deep is to use 'section' throughout.

@jgm jgm referenced this pull request in neilmayhew/pandoc Apr 30, 2014

@neilmayhew neilmayhew Don't explicitly number section levels in Docbook output
Docbook can infer the section level from the nesting, and leaving out
the level numbering allows Pandoc output to be inserted as a fragment
into a larger Docbook document that already contains sections.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment