Add source, edit, history, annotate links to GitHub or BitBucket
Project description
sphinxcontrib-srclinks
A sphinx extension to add links to various views of the documentation page source in the sphinx jinja2 template sidebar.
Contents
Features
Specify srclink_project once in sphinx conf.py
Adds links to {Source, Edit, History, Annotate} with {GitHub, BitBucket,} URLs to the sidebar.
Adds links to e.g. https://github.com/user/repo/ and https://github.com/user/repo/tree/[srclink_branchname]
Adds a <code> git clone schema://git@github.com/repo </code> block for each https, native git/hg, and ssh URL
(Sphinx HTML Documentation Sidebar)
This Page
Source RST
Source
Edit
History
Annotate
Usage
Clone the sphinxcontrib-srclinks repo:
git clone https://github.com/westurner/sphinxcontrib-srclinks
Copy srclinks.html to the _templates/srclinks.html folder:
DOCS="./docs/"
mkdir -p "$DOCS/_templates"
cp sphinxcontrib-srclinks/sphinxcontrib/srclinks/_templates/srclinks.html \
"$DOCS/_templates/srclinks.html"
BLD: conf.py: Configure the srclink_ settings in conf.py (test_html_page_context()):
# conf.py
# srclink settings
srclink_project = 'https://github.com/westurner/sphinxcontrib-srclinks'
#srclink_project = 'https://bitbucket.org/westurner/sphinxcontrib-srclinks'
#srclink_project = 'hg@bitbucket.org/westurner/sphinxcontrib-srclinks'
#srclink_project = 'git@bitbucket.org/westurner/sphinxcontrib-srclinks'
srclink_src_path = 'docs/'
#srclink_src_path = ''
srclink_branch = 'master'
#srclink_branch = 'develop'
BLD: conf.py: Add srclinks.html to html_sidebars in conf.py:
# Custom sidebar templates, maps document names to template names.
html_sidebars = {
'**': [
'localtoc.html',
'relations.html',
'searchbox.html',
'srclinks.html',
],
'index': [
'globaltoc.html',
'relations.html',
'searchbox.html',
'srclinks.html',
],
}
conf.py examples
License
BSD 3-Clause
Changelog
0.2.4 (2019-04-16)
DOC: Add Python 2 and 3 trove classifiers
0.2.3 (2019-04-16)
BUG: Python 3 Compatibility
0.2.2
ENH: _templates/srclinks.html: add class=’widget navlinks|srclinks
0.2.1
DOC: CHANGELOG.rst
0.2.0
BUG: backwards compatibility with edit_on_github
0.1.2
BLD: MANIFEST.in
0.1.1
DOC: LICENSE
0.1.0
First release as sphinxcontrib.srclinks
ENH: Added BitBucket support (hg@ (default) and git@)
TST: Added tests for BitBucket and GitHub support
0.0.1
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file sphinxcontrib-srclinks-0.2.4.tar.gz
.
File metadata
- Download URL: sphinxcontrib-srclinks-0.2.4.tar.gz
- Upload date:
- Size: 8.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c265d972eeda1898c5d21a62ac0f32a33a6866cae1a05b07483595dc2a4e0166 |
|
MD5 | 7ff5e43219b1bc11cff3f38698152bc3 |
|
BLAKE2b-256 | fbc29717dd2992b08b80fd218333d91c52a8a1678c8b9f9aaf797d03612b09de |
File details
Details for the file sphinxcontrib_srclinks-0.2.4-py37-none-any.whl
.
File metadata
- Download URL: sphinxcontrib_srclinks-0.2.4-py37-none-any.whl
- Upload date:
- Size: 10.3 kB
- Tags: Python 3.7
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1bd99b551f0733fa0c41e23564d539c02404c69529a7a4a0e0dc82d7650ae178 |
|
MD5 | c2d68fa9597e8059f23483562f72aaa4 |
|
BLAKE2b-256 | fde874f46331980f5f22005c50b0e456f291cd994982bd4f4eea13727ecdd7e9 |