Add source, edit, history, annotate links to GitHub or BitBucket
Project description
sphinxcontrib-srclinks
Sphinxcontrib-srclinks is a Sphinx extension for adding project links to the sidebar.
Usage
Clone the repo and copy srclinks.html into the docs’ _templates/ folder:
git clone https://bitbucket.org/westurner/sphinxcontrib-srclinks
DOCS="path/to/docs"
mkdir -p $DOCS/_templates
cp sphinxcontrib-srclinks/sphinxcontrib/srclinks/_templates/srclinks.html \
$DOCS/_templates/srclinks.html
Configure the srclink_ settings for the desired repo in conf.py:
# conf.py
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_branch = 'master'
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',
],
}
Changelog
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
Close
Hashes for sphinxcontrib-srclinks-0.1.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 13343baa9cc8a06d8b247d1af95a0000120db5d76b8dffa9097840e94991dd96 |
|
MD5 | 20b8a35c40fb89984a7e333c3a815069 |
|
BLAKE2b-256 | a2fab2f5ee649b865bde9b56a6da62bed990105426c4af08813b79494a673e75 |