-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add extdev doc for interfacing with linkcode
Adding a document under Sphinx's "extension development" chapter which provides information about integrating third-party builds with recently added features to the built-in linkcode extension. Signed-off-by: James Knight <[email protected]>
- Loading branch information
Showing
4 changed files
with
47 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
======================= | ||
Built-in extensions API | ||
======================= | ||
|
||
Sphinx includes several :ref:`built-in extensions <builtin-extensions>`, | ||
which third-party extensions may wish to integrate with. This chapter | ||
describes the extensions bundled with Sphinx which provide an API which | ||
other extensions may interface with. | ||
|
||
For the API documentation on writing your own extension, refer to | ||
:ref:`dev-extensions`. | ||
|
||
.. toctree:: | ||
|
||
linkcode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
``sphinx.ext.linkcode`` API | ||
=========================== | ||
|
||
Refer to :mod:`sphinx.ext.linkcode` for more information about the | ||
extension and its configuration. | ||
|
||
Builder API | ||
----------- | ||
|
||
.. class:: MyAwesomeBuilder | ||
|
||
.. attribute:: supported_linkcode | ||
|
||
The linkcode extension, by default, will only inject references | ||
for an ``html`` builder. If a non-html builder wishes to support | ||
managing references generated by linkcode, the | ||
``supported_linkcode`` attribute can be defined in the builder's | ||
implementation. The expected value for this attribute is an | ||
expression which is compatible with :rst:dir:`only`. | ||
|
||
For example, if a builder was named ``my-awesome-builder``, the | ||
following can be used: | ||
|
||
.. code-block:: python | ||
class MyAwesomeBuilder(Builder): | ||
supported_linkcode = 'my-awesome-builder' | ||
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters