mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
This commit is intended to improve new user's first-interaction with the Sphinx site: - Make page header icon/text smaller and not capitalized - Give min-width to left sidebar (it was getting too small at certain window sizes) - Replace features list on landing page with admonition boxes, with adaptive layout - Add landing page "used by" section - Slightly restructure the Extension section, into Tutorials and How-tos - Add code to `conf.py` to write HTML write redirect pages for moved documents - Improve support page, by adding link to Stackoverflow, GH discussion and ReadtheDocs, and remove defunct link to libera chat and matplotlib tutorial
28 lines
891 B
ReStructuredText
28 lines
891 B
ReStructuredText
Depend on another extension
|
|
===========================
|
|
|
|
Sometimes your extension depends on the functionality of another
|
|
Sphinx extension. Most Sphinx extensions are activated in a
|
|
project's :file:`conf.py` file, but this is not available to you as an
|
|
extension developer.
|
|
|
|
.. module:: sphinx.application
|
|
:no-index:
|
|
|
|
To ensure that another extension is activated as a part of your own extension,
|
|
use the :meth:`sphinx.application.Sphinx.setup_extension` method. This will
|
|
activate another extension at run-time, ensuring that you have access to its
|
|
functionality.
|
|
|
|
For example, the following code activates the :mod:`sphinx.ext.autodoc` extension:
|
|
|
|
.. code-block:: python
|
|
|
|
def setup(app):
|
|
app.setup_extension('sphinx.ext.autodoc')
|
|
|
|
.. note::
|
|
|
|
Since your extension will depend on another, make sure to include
|
|
it as a part of your extension's installation requirements.
|