Menu

#438 The source info of topic node is not filled when topic directive only contains a bullet list

closed-duplicate
nobody
None
5
2022-06-01
2021-12-09
No

It seems docutils does not fill the topic node with the source info when the topic directive has a bullet list.

from docutils.core import publish_doctree


# topic directive with a paragraph
s = """
.. topic:: 5. Topic Title

   Paragraph
"""

(topic,) = publish_doctree(s)
print(topic.source, topic.line)


# topic directive with a bullet list
s = """
.. topic:: 5. Topic Title

   - Bullet List Item
"""

(topic,) = publish_doctree(s)
print(topic.source, topic.line)
$ python test.py
<string> None
None None

Related

Feature Requests: #41

Discussion

  • Günter Milde

    Günter Milde - 2021-12-11

    This is one more instance of feature request [#41].
    Is there a use case for the internal source and line attributes for topic nodes?

    The interesting point is that in some cases there is a "source" attribute (but no "line" attribute) for the "topic" node. (Tested with rst2pseudoxml --expose-internal-attributes=source:line.)

     

    Related

    Feature Requests: #41

  • Günter Milde

    Günter Milde - 2022-06-01
    • status: open --> closed-duplicate
     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.