I am using Sphinx tool for documentation and ran into a situation where I want to expose a piece of information in only one file format.
I came across this link which addresses a similar issue with help of only directive.
The issue I am facing is I want to use the only directive with a custom tag
.. only:: xyz
..directive ::
:maxdepth: 1
good_stuff
I am using a setup.py file for building, and running BuildDoc.run(self) to generate the html files. I want somehow pass this custom tag in the setup.py file. I tried doing this, but seems like we cant access tags object from within setup.py file.
def run(self):
self.builder = 'html'
*self.tags.add(xyz)*
BuildDoc.run(self)
self.zip("html.zip")
If I add tags.add('xyz') in the conf.py file, it will always expose the additional information, what I want to do is conditionally add this tag in my setup.py file.
I assume the make command does something similar by passing the tag info to the conf.py file but I am not sure how it works.
tags.add('my-tag')
inconf.py
. And the line highlights in conf.py and says tags is not defined. Can you please tell the right steps how to use this? What is the right usage of command . I am using:sphinx-build -t my-tag . build/html
, I get:WARNING: exception while evaluating only directive expression: chunk after expression
– Hyperextension