You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature/enhancement proposal related to a problem? Please describe.
Currently, it is not possible to make markup cross references from Sphinx-based documentation projects, which are written in reStructuredText (reST), to MkDocs-based documentation projects such as the PDM docs.
In particular, it is not possible currently to write markup links to PDM Python objects (such as functions, classes, methods etc.) documented in the PDM API or the CLI API from Sphinx-based projects using Sphinx directives and roles in the Sphinx Python domain.
This is because for Sphinx projects to link to the PDM documentation, the PDM documentation must be built with a Sphinx-style "object inventory", which is "a mapping from object names to URIs relative to the HTML set’s root", as described in the Sphinx intersphinx extension documentation. This is the Sphinx tool that makes it possible to write markup links between any two Sphinx projects (as long as both are configured with the intersphinx extension).
Of course, MkDocs is independent of Sphinx, but there is a simple configuration-based solution to this problem which is described in the next section.
To provide some context and an illustration of what this might look like, we can consider how markup links to notable Python documentation projects, such as Python standard library / API (and many other prominent Python documentation projects, such as Pandas, Numpy, matplotlib) currently work.
For example, the following reST markup is valid in any Sphinx project:
It should be noted that for these references to work in the source Sphinx projects the intersphinx mapping for the target Sphinx project must be defined in the source project conf.py, e.g. for Python:
The same should be possible with PDM as long as the PDM HTML documentation is built with a Sphinx-style object inventory. So, for example, it should be possible to make markup references from Sphinx projects to PDM functions, classes, methods (or any other public API objects), e.g.:
As implied by the MkDocs documentation setting enable_inventory to true would result in the PDM HTML documentation generating a Sphinx-style object inventory, which would support cross references from Sphinx projects.
The Sphinx projects wanting to link to PDM documentation would have to define the intersphinx mapping appropriately, and it should be something like this:
Is your feature/enhancement proposal related to a problem? Please describe.
Currently, it is not possible to make markup cross references from Sphinx-based documentation projects, which are written in reStructuredText (reST), to MkDocs-based documentation projects such as the PDM docs.
In particular, it is not possible currently to write markup links to PDM Python objects (such as functions, classes, methods etc.) documented in the PDM API or the CLI API from Sphinx-based projects using Sphinx directives and roles in the Sphinx Python domain.
This is because for Sphinx projects to link to the PDM documentation, the PDM documentation must be built with a Sphinx-style "object inventory", which is "a mapping from object names to URIs relative to the HTML set’s root", as described in the Sphinx intersphinx extension documentation. This is the Sphinx tool that makes it possible to write markup links between any two Sphinx projects (as long as both are configured with the intersphinx extension).
Of course, MkDocs is independent of Sphinx, but there is a simple configuration-based solution to this problem which is described in the next section.
To provide some context and an illustration of what this might look like, we can consider how markup links to notable Python documentation projects, such as Python standard library / API (and many other prominent Python documentation projects, such as Pandas, Numpy, matplotlib) currently work.
For example, the following reST markup is valid in any Sphinx project:
and a HTML build will generate HTML hyperlinks to the correct documentation targets
pathlib.Path
,json.JSONEncode.encode
, andre.match
, respectively, which are included as objects in the Sphinx object inventory generated for the Python standard library / API:It should be noted that for these references to work in the source Sphinx projects the intersphinx mapping for the target Sphinx project must be defined in the source project
conf.py
, e.g. for Python:The same should be possible with PDM as long as the PDM HTML documentation is built with a Sphinx-style object inventory. So, for example, it should be possible to make markup references from Sphinx projects to PDM functions, classes, methods (or any other public API objects), e.g.:
assuming that these PDM targets have docstrings and the Sphinx projects have defined the intersphinx mapping for the PDM documentation:
The solution is described in the next section.
Describe the solution you'd like
The solution is to make a single change to the PDM MkDocs YML in the
plugins.mkdocstrings
section:As implied by the MkDocs documentation setting
enable_inventory
totrue
would result in the PDM HTML documentation generating a Sphinx-style object inventory, which would support cross references from Sphinx projects.The Sphinx projects wanting to link to PDM documentation would have to define the intersphinx mapping appropriately, and it should be something like this:
The text was updated successfully, but these errors were encountered: