Closed Daltz333 closed 3 years ago
Unfortunately, toctree directive can't run other directives in its body. And I think it's not a good design. I can agree if ifconfig
directive supports switching toctree
directives conditionally:
.. ifconfig:: localinstall == True
.. toctree::
:maxdepth: 1
:caption: API Docs
WPILib Java API Docs <../../../java/index.html>
WPILib C++ API Docs <../../../cpp/index.html>
.. ifconfig:: localinstall == False
.. toctree::
:maxdepth: 1
:caption: API Docs
WPILib Java API Docs <https://first.wpi.edu/FRC/roborio/release/docs/java/index.html>
WPILib C++ API Docs <https://first.wpi.edu/FRC/roborio/release/docs/cpp/index.html>
But, to do that, we need to rewrite the whole of toctree system of Sphinx. So I don't have a plan to support it. Of course, any contributions are welcome.
That is unfortunate, thanks for the quick response.
I'm trying to conditionally change my toctree based on the current system used to build the documentation.
I currently have this method set up in my
conf.py
and my
setup(app)
is configured like soin my root
index.rst
, I have the following set upHowever, no matter how I format my
index.rst
I get numerous errors.If formatted like the below
my console output shows