Skip to content

westurner/sphinxcontrib-srclinks

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sphinxcontrib-srclinks

A sphinx extension to add links to various views of the documentation page source in the sphinx jinja2 template sidebar.

Contents

Features

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