Metadata-Version: 2.0
Name: sphinxcontrib-srclinks
Version: 0.2.3
Summary: Add source, edit, history, annotate links to GitHub or BitBucket
Home-page: http://bitbucket.org/westurner/sphinxcontrib-srclinks
Author: Wes Turner
Author-email: wes@wrd.nu
License: BSD (3-clause)
Download-URL: http://pypi.python.org/pypi/sphinxcontrib-srclinks
Platform: any
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Web Environment
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: BSD License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Topic :: Documentation
Classifier: Topic :: Utilities
Requires-Dist: Sphinx (>=0.6)



sphinxcontrib-srclinks
========================
| Source: https://github.com/westurner/sphinxcontrib-srclinks
| Source: https://github.com/westurner/sphinxcontrib-srclinks/blob/develop/sphinxcontrib/srclinks/__init__.py
| Source: https://github.com/westurner/sphinxcontrib-srclinks/blob/develop/sphinxcontrib/srclinks/_templates/srclinks.html

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

Contents
------------
.. 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

    * `github.com/westurner/sphinxcontrib-srclinks <https://github.com/westurner/sphinxcontrib-srclinks>`_ / 
      `master <https://github.com/westurner/sphinxcontrib-srclinks/tree/master>`_

      * git clone https://github.com/westurner/sphinxcontrib-srclinks
      * git clone git@github.com/westurner/sphinxcontrib-srclinks
      * git clone `<ssh://git@github.com/westurner/sphinxcontrib-srclinks>`_

Usage
-------

- Clone the sphinxcontrib-srclinks repo:

.. code:: bash

    git clone https://github.com/westurner/sphinxcontrib-srclinks

- Copy ``srclinks.html`` to the ``_templates/srclinks.html`` folder:

.. code:: bash

    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()``):

.. code:: python

    # 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``:

.. code:: Python

    # 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
~~~~~~~~~~~~~~~~~~
* https://wrdrd.github.io/ ( https://wrdrd.com/ )

  * conf.py: https://github.com/wrdrd/docs/blob/master/docs/conf.py


License
===========
BSD 3-Clause



Changelog
===========

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
------

* https://github.com/astropy/astropy/pull/347

  - https://gist.github.com/mgedmin/6052926

    - https://gist.github.com/westurner/d89c1ea1af05c5c514f9



