Skip to content
Commit 9e13f1b2 authored by Peter Hoyes's avatar Peter Hoyes Committed by Robbie Cao
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



Issue-Id: SCM-5314
Issue-Id: SCM-5624
Signed-off-by: default avatarPeter Hoyes <Peter.Hoyes@arm.com>
Signed-off-by: Robbie Cao's avatarRobbie Cao <robbie.cao@arm.com>
Signed-off-by: Qi Feng's avatarQi Feng <qi.feng@arm.com>
Change-Id: Ic3c89208895f36dc3042f3bacbdd08547eb38265
parent e1b28c7c
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