Wrapping directive output

9 views
Skip to first unread message

Jonathan Gossage

unread,
Jun 3, 2024, 5:42:59 PMJun 3
to sphinx-users
I am attempting to build a Sphinx directive that wraps other Sphinx content. Thus I want the following source :


   .. nestedBlock:: Overview, "Implmentation id¨, Overview of structure
   
      As much Sphinx content as needed.

to generate the following HTML:

   <section id="Overview" class="nsLevel1", id="Implementation id">
     <p>Overview of structure</p>
     ... As much Sphinx content as needed - converted to HTML
   </section>

The generated HTMLwill then be styled with CSS yo produce the final output. I am uncertain about how this should be done, partly as I do not fully understand the implications of the self.content attribute. Any examples of doing this type of work would be greatly appreciated. I expect that these directives will be nested and I am only interested in HTML output.
Reply all
Reply to author
Forward
0 new messages