Skip to content
Commit ec0e7f4b authored by Tomás Agustín González Orlando's avatar Tomás Agustín González Orlando Committed by Filipe Rinaldi
Browse files

doc: Add extension to generate repository links

To promote cross-links between the documentation and the code, create a
small Sphinx extension which transforms links relative to the repository
root into a reference to the repository URL. It attempts to read the
version from the Read the Docs configuration and falls back to `git
rev-parse HEAD`.

The links can be written as follows:

  :repo:`path/to/file.bb`

The environment variable REPO_URL_PATTERN can be used to modify the repo
URL for development purposes.

The Read the Docs version_name is not useful for determining the Git ref
for the purposes of linking to the source code because of the special
value "latest", which refers to the default branch. Use the
gitlab_version variable instead, which despite the name is simply the
"commit_name" of the version according to:
https://github.com/readthedocs/readthedocs.org/blob/6.3.0/readthedocs/doc_builder/backends/sphinx.py#L95
and
https://github.com/readthedocs/readthedocs.org/blob/6.3.0/readthedocs/builds/models.py#L254



Changelog: other
Signed-off-by: Tomás Agustín González Orlando's avatarTomás González <tomasagustin.gonzalezorlando@arm.com>
Signed-off-by: default avatarPeter Hoyes <Peter.Hoyes@arm.com>
Signed-off-by: Robbie Cao's avatarRobbie Cao <robbie.cao@arm.com>
parent 68c6c5ad
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment