From: Stefan M. <sm...@oe...> - 2009-08-13 21:09:11
|
Hi! Here is a small example:: .. contents:: Top level ========= Something in the top level. .. class:: strip-me Second level stripped --------------------- Second level section which is stripped. Second level visible -------------------- Visible second level. Here is the result of ``rst2pseudoxml --strip-elements-with-class=strip-me`` with one place marked with exclamation marks:: <document source="/home/stefan/tmp/tooMuchContents.rst"> <topic classes="contents" ids="contents" names="contents"> <title> Contents <bullet_list> <list_item> <paragraph> <reference ids="id1" refid="top-level"> Top level <bullet_list> !!! <list_item> !!! <paragraph> !!! <reference ids="id2" refid="second-level-stripped"> !!! Second level stripped <list_item> <paragraph> <reference ids="id3" refid="second-level-visible"> Second level visible <section ids="top-level" names="top\ level"> <title refid="id1"> Top level <paragraph> Something in the top level. <section ids="second-level-visible" names="second\ level\ visible"> <title refid="id3"> Second level visible <paragraph> Visible second level. As you can see the stripped section is indeed stripped but it still is listed in the table of contents. I'd consider this an error. I don't know the docutils code good enough to suggest a patch but could imagine that a change in the order of transformations done could solve the problem. I.e. the stripping needs to be done before the contents directive is evaluated. Grüße Stefan |