trlcdoc.sphinx_links
Sphinx extension resolving the relative links and images of Markdown pages against the project.
A Markdown document is copied into the Sphinx source folder, so its relative links and images would point into that folder instead of the project. This extension resolves them against the location of the Markdown file in the project:
an image is taken from the project, Sphinx copies it into the site
a link to a file of a site page links to that page
a link to any other project file or folder links to the repository at the built commit
without a repository, such a link is shown as text with a warning
Links to targets which do not exist in the project are left to MyST, which reports them.
The settings are provided by trlcdoc in the configuration value ‘trlcdoc_links’.
Attributes
Classes
Take the relative images of Markdown pages from the project, while the page is read. |
|
Resolve the relative links of Markdown pages, which MyST could not resolve in the Sphinx source folder. |
Functions
|
Register the configuration value and the transforms. |
Module Contents
- trlcdoc.sphinx_links.LOGGER
- trlcdoc.sphinx_links.CONFIG_NAME = 'trlcdoc_links'
- trlcdoc.sphinx_links.URL_SCHEME
- class trlcdoc.sphinx_links.MarkdownImages(document, startnode=None)[source]
Bases:
sphinx.transforms.SphinxTransform
Take the relative images of Markdown pages from the project, while the page is read.
- default_priority = 400
Numerical priority of this transform, 0 through 999 (override).
- class trlcdoc.sphinx_links.MarkdownLinks(document, startnode=None)[source]
Bases:
sphinx.transforms.post_transforms.SphinxPostTransform
Resolve the relative links of Markdown pages, which MyST could not resolve in the Sphinx source folder.
- default_priority = 8
Numerical priority of this transform, 0 through 999 (override).