Re: Question About Section Levels

David Goodger <[email protected]> Fri, 4 Oct 2019 11:33:50 -0500
Newsgroups gmane.text.docutils.user
Message-ID <CABiJP=+WNNiLov4yhM5QvA-2jQ8q41-+euh7q9Mk_R-Csc7ycg@mail.gmail.com>
The way I would go about something like this is to write a new directive,
"insert" or "subdoc", which spawns a new parser, parses the external
subdocument file into a separate document tree, and grafts this doctree
onto the master document tree. That would allow independent section
structure in the subdocument. There are issues to consider here, like how
much context is to be copied over between the master document's parser and
the subparser (e.g. the section title adornments should not be copied over;
but what about reference names, substitution definitions, etc.?).

There are lots of notes on this (and many other topics) in the Docutils To
Do List:
http://docutils.sourceforge.net/docs/dev/todo.html#large-documents
Note: many items in there may be stale, as it hasn't been updated/pruned in
a while.

David Goodger
<https://david.goodger.org>