Sphinx: API documentation: How to turn off creating links to Parameter/Argument link creation
For projects with API documentation generated by Sphinx, I've noticed that some project's don't include links to the Parameter/Argument types (str, file-like object, int, etc) and some projects do. This is mainly for projects in the python language.
I'm wondering how to turn this option on and off. I've searched a bit for how to configure it but haven't found the information yet. I'll continue to search but also asking here in case someone else has knowledge of this.
Does anyone know how to turn on/off including links to the Parameter/Argument types when generating API documentation with Sphinx?
Thank you
2 answers
To control the inclusion of links to parameter/argument types in Sphinx-generated API documentation, you can adjust the autodoc_typehints setting in your conf.py file. Set autodoc_typehints to 'none' to turn off the links or 'description' to turn them on. You can also use the autodoc_typehints_format setting to fine-tune how types are displayed. For more control over type linking, ensure the sphinx.ext.autodoc extension is enabled in your project.
0 comment threads
Open the conf.py File:
Locate and open the conf.py file in your Sphinx documentation directory.
Modify the autodoc Options:
Look for the autodoc settings. You can control the linking of types using the autodoc_typehints option.
To include links to types, set:
autodoc_typehints = 'description' # or 'full' for fully qualified names
To exclude links to types, set:
autodoc_typehints = 'none'
0 comment threads