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.
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
- github.com/westurner/sphinxcontrib-srclinks / master
- This Page
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', ], }
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
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Filename, size | File type | Python version | Upload date | Hashes |
---|---|---|---|---|
Filename, size sphinxcontrib_srclinks-0.2.4-py37-none-any.whl (10.3 kB) | File type Wheel | Python version py37 | Upload date | Hashes View |
Filename, size sphinxcontrib-srclinks-0.2.4.tar.gz (8.9 kB) | File type Source | Python version None | Upload date | Hashes View |
Close
Hashes for sphinxcontrib_srclinks-0.2.4-py37-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1bd99b551f0733fa0c41e23564d539c02404c69529a7a4a0e0dc82d7650ae178 |
|
MD5 | c2d68fa9597e8059f23483562f72aaa4 |
|
BLAKE2-256 | fde874f46331980f5f22005c50b0e456f291cd994982bd4f4eea13727ecdd7e9 |
Close
Hashes for sphinxcontrib-srclinks-0.2.4.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | c265d972eeda1898c5d21a62ac0f32a33a6866cae1a05b07483595dc2a4e0166 |
|
MD5 | 7ff5e43219b1bc11cff3f38698152bc3 |
|
BLAKE2-256 | fbc29717dd2992b08b80fd218333d91c52a8a1678c8b9f9aaf797d03612b09de |