Abjad / abjad

Abjad is a Python API for building LilyPond files. Use Abjad to make PDFs of music notation.
https://abjad.github.io
GNU General Public License v3.0
234 stars 41 forks source link

Add workaround to container-example docstrings #1518

Closed trevorbaca closed 1 year ago

trevorbaca commented 1 year ago

Sometime after January 14 (Abjad 3.15) and yesterday, Sphinx started to issue an ERROR/WARNING pair for every .. container:: example directive that's followed by explanatory text (rather than by example Python code).

So Sphinx errors on this (explanatory text immediately after container directive):

        ..  container:: example

            Gets slice open at right:

            >>> items = [0, 1, 2, 3, 4, 5]
            >>> tuple_ = abjad.CyclicTuple(items=items)
            >>> tuple_[2:]
            (2, 3, 4, 5)

But Sphinx is happy with this (explanatory text hoisted outside of container directive):

        Gets slice open at right:

        ..  container:: example

            >>> items = [0, 1, 2, 3, 4, 5]
            >>> tuple_ = abjad.CyclicTuple(items=items)
            >>> tuple_[2:]
            (2, 3, 4, 5)

The PR to solve this issue manually hoists the first such line of explanatory text in a couple hundred container directives.