trlcdoc Logo

Contents:

  • About trlcdoc
  • Configuration Reference
  • SW-Requirements
  • SW-Architecture
  • SW-Tests
  • SW-Test Results
  • Software Tracing Report
  • Coverage Report
  • Implementation Reference
    • trlcdoc
      • Submodules
        • trlcdoc.cli
        • trlcdoc.config
        • trlcdoc.convert
        • trlcdoc.converters
        • trlcdoc.html
        • trlcdoc.log
        • trlcdoc.pages
        • trlcdoc.plantuml
        • trlcdoc.plantuml_client
        • trlcdoc.sphinx_links
        • trlcdoc.testrun
        • trlcdoc.trace
        • trlcdoc.util
  • License information
trlcdoc
  • Implementation Reference
  • trlcdoc
  • trlcdoc.sphinx_links
  • View page source

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

LOGGER

CONFIG_NAME

URL_SCHEME

Classes

MarkdownImages

Take the relative images of Markdown pages from the project, while the page is read.

MarkdownLinks

Resolve the relative links of Markdown pages, which MyST could not resolve in the Sphinx source folder.

Functions

setup(app) → dict[str, Any]

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

Inheritance diagram of trlcdoc.sphinx_links.MarkdownImages

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).

apply(**kwargs: Any) → None[source]

Replace the image paths of a Markdown page by the paths of the project files.

Parameters:

**kwargs (Any) – Unused transform arguments.

class trlcdoc.sphinx_links.MarkdownLinks(document, startnode=None)[source]

Bases: sphinx.transforms.post_transforms.SphinxPostTransform

Inheritance diagram of trlcdoc.sphinx_links.MarkdownLinks

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).

run(**kwargs: Any) → None[source]

Replace the unresolved links to project files by page links, repository links or text.

Parameters:

**kwargs (Any) – Unused transform arguments.

trlcdoc.sphinx_links.setup(app: sphinx.application.Sphinx) → dict[str, Any][source]

Register the configuration value and the transforms.

Parameters:

app (Sphinx) – The Sphinx application.

Returns:

The extension metadata.

Return type:

dict[str, Any]

Previous Next

© Copyright 2026, Norbert Schulz. Last updated on Nov 28, 2026 from V0.6.0-44-g2f3d3f7 on branch main.

Built with Sphinx using a theme provided by Read the Docs.