1

I need to do something very simple: Access the tag generated by the command line:

$ sphinx-build -t <tag_name>

Example:

$ sphinx-build -t Foo

Will create a dictionary entry in:

sphinx.util.docutils.SphinxDirective.config._raw_config['tags'].tags

also mirrored in:

sphinx.util.docutils.SphinxDirective.env.config._raw_config['tags'].tags

And tags will contain a dictionary with an entry:

'Foo': True

However, accessing SphinxDirective.config._raw_config is asking for a protected member out of scope.

What is the correct method for accessing the Sphinx tags while processing directives?

natersoz
  • 1,674
  • 2
  • 19
  • 29
  • 1
    Wish I could help you, but I'm not a docutils hacker. – bad_coder Oct 04 '20 at 21:00
  • Neither am I :) – natersoz Oct 04 '20 at 21:23
  • 1
    I think docutils is interesting and in a sense "the next logical step" for someone that's gotten accustomed to Sphinx. However, the published API isn't fully documented (said to be a sign it's likely to undergo future change). That leaves an interested dev with little chance other than diving into the source code. Which I imagine is overwhelming, because you'll be reverse engineering the logic. Looking at the [top docutils users on SO](https://stackoverflow.com/tags/docutils/topusers) there really isn't an actively engaged community on the subject. I guess github is where it's happening... – bad_coder Oct 04 '20 at 21:33

0 Answers0