Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Socrats committed Oct 6, 2020
1 parent f6bcd60 commit 231cb49
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 3 deletions.
38 changes: 35 additions & 3 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@
# import sys
# sys.path.insert(0, os.path.abspath('.'))

import os
import subprocess
import sys

on_rtd = os.environ.get('READTHEDOCS') == 'True'


# -- Project information -----------------------------------------------------

Expand All @@ -37,6 +43,7 @@
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
sys.path.insert(1, os.path.abspath(os.path.dirname(__file__)))
extensions = [
'sphinx.ext.napoleon',
'sphinx.ext.autodoc',
Expand Down Expand Up @@ -75,10 +82,33 @@
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store', '**.ipynb_checkpoints']

# The name of the Pygments (syntax highlighting) style to use.
pygments_style = None
pygments_style = 'sphinx'

# Autodoc configuration
autodoc_member_order = 'groupwise'

if on_rtd:
branch_or_tag = branch or 'v{}'.format(release)
else:
rev_parse_name = subprocess.check_output(['git', 'rev-parse', '--abbrev-ref', 'HEAD']).decode('ascii').strip()
branch_or_tag = rev_parse_name if rev_parse_name != 'HEAD' else 'v{}'.format(release)

rst_epilog = """
.. |binder_badge_examples| image:: https://mybinder.org/badge_logo.svg
:target: https://mybinder.org/v2/gh/YannickJadoul/Parselmouth/{branch_or_tag}?urlpath=lab/tree/docs/examples
""".format(branch_or_tag=branch_or_tag)

nbsphinx_prolog = """
{{% set docname = env.doc2path(env.docname, base='docs') %}}
.. only:: html
.. note::
An online, interactive version of this example is available at Binder: |binder|
.. |binder| image:: https://mybinder.org/badge_logo.svg
:target: https://mybinder.org/v2/gh/YannickJadoul/Parselmouth/{branch_or_tag}?urlpath=lab/tree/{{{{ docname }}}}
""".format(branch_or_tag=branch_or_tag)

# -- Options for HTML output -------------------------------------------------

Expand Down Expand Up @@ -184,7 +214,9 @@
# -- Options for intersphinx extension ---------------------------------------

# Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {'https://docs.python.org/': None}
intersphinx_mapping = {'python': ('https://docs.python.org/3', None),
'numpy': ('https://docs.scipy.org/doc/numpy', None),
'tgt': ('https://textgridtools.readthedocs.io/en/stable', None)}

# -- Options for todo extension ----------------------------------------------

Expand Down
4 changes: 4 additions & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
-r ../requirements.txt

Sphinx==3.2.1
ipykernel
ipywidgets
nbsphinx
recommonmark

0 comments on commit 231cb49

Please sign in to comment.