Skip to content

Commit

Permalink
Use intersphinx to improve links with other docs
Browse files Browse the repository at this point in the history
Use intersphinx to improve links with other docs
  • Loading branch information
Guts committed Aug 13, 2019
2 parents a5a54c0 + 1bf1a06 commit 00fddf1
Show file tree
Hide file tree
Showing 7 changed files with 167 additions and 131 deletions.
1 change: 1 addition & 0 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ pytest-random-order = "*"
setuptools = "*"
twine = "*"
wheel = "*"
sphinx = "*"

[packages]
requests = ">=2.20.0"
Expand Down
148 changes: 132 additions & 16 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

88 changes: 10 additions & 78 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = ["sphinx.ext.autodoc", "sphinx.ext.viewcode"]
extensions = ["sphinx.ext.autodoc", "sphinx.ext.intersphinx", "sphinx.ext.viewcode"]

# Add any paths that contain templates here, relative to this directory.
templates_path = ["_templates"]
Expand Down Expand Up @@ -75,90 +75,14 @@
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
# html_theme = 'alabaster'

if on_rtd:
html_theme = "default"
else:
import guzzle_sphinx_theme

html_theme = "guzzle_sphinx_theme"
html_theme_path = guzzle_sphinx_theme.html_theme_path()
extensions.append("guzzle_sphinx_theme")
# Guzzle theme options
html_theme_options = {
"project_nav_name": project,
# Path to a touch icon
"touch_icon": "",
# Specify a base_url used to generate sitemap.xml links. If not
# specified, then no sitemap will be built.
"base_url": "http://isogeo-api-pysdk.readthedocs.io",
# Allow a separate homepage from the master_doc
# "homepage": "index",
# Allow the project link to be overriden to a custom URL.
"projectlink": "https://github.com/Isogeo/isogeo-api-py-minsdk/",
}

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
# html_static_path = ['_static']

# Custom sidebar templates, must be a dictionary that maps document names
# to template names.
#
# The default sidebars (for documents that don't match any pattern) are
# defined by theme itself. Builtin themes are using these templates by
# default: ``['localtoc.html', 'relations.html', 'sourcelink.html',
# 'searchbox.html']``.
#
# html_sidebars = {}

html_theme = "default"

# -- Options for HTMLHelp output ---------------------------------------------

# Output file base name for HTML help builder.
htmlhelp_basename = "IsogeoPySDK_doc"


# -- Options for LaTeX output ------------------------------------------------

latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
#
# 'papersize': 'letterpaper',
# The font size ('10pt', '11pt' or '12pt').
#
# 'pointsize': '10pt',
# Additional stuff for the LaTeX preamble.
#
# 'preamble': '',
# Latex figure (float) alignment
#
# 'figure_align': 'htbp',
}

# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(
master_doc,
"IsogeoPySDK.tex",
"Isogeo PySDK Documentation",
"Isogeo PySDK",
"manual",
)
]


# -- Options for manual page output ------------------------------------------

# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [(master_doc, "isogeopysdk", "Isogeo PySDK Documentation", [author], 1)]


# -- Options for Texinfo output ----------------------------------------------

# Grouping the document tree into Texinfo files. List of tuples
Expand All @@ -177,6 +101,14 @@
]


# Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {
"python": ("https://python.readthedocs.io/en/latest/", None),
"requests": ("https://requests.readthedocs.io/en/latest/", None),
"oauthlib": ("https://oauthlib.readthedocs.io/en/latest/", None),
"requests_oauthlib": ("https://requests-oauthlib.readthedocs.io/en/latest/", None),
}

# -- Options for Sphinx API doc ----------------------------------------------
# run api doc
def run_apidoc(_):
Expand Down
3 changes: 0 additions & 3 deletions docs/requirements_docs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,3 @@ requests_oauthlib

# required
Sphinx

# themes
guzzle_sphinx_theme
25 changes: 10 additions & 15 deletions isogeo_pysdk/api/routes_format.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,21 +194,16 @@ def create(self, frmt: Format, check_exists: bool = 1) -> Format:
:rtype: Format or tuple
:Example:
>>> format_to_add = Format(
code="geojson",
name="GeoJSON",
type="vectorDataset"
)
>>> print(isogeo.formats.create(format_to_add))
{
'_id': string (uuid),
'_tag': 'format:geojson',
'aliases': [],
'code': 'geojson',
'name': 'GeoJSON',
'type': 'vectorDataset',
'versions': []
}
.. code-block:: python
format_to_add = Format(
code="geojson",
name="GeoJSON",
type="vectorDataset"
)
isogeo.formats.create(format_to_add)
"""
# check format code
if not frmt.code:
Expand Down

0 comments on commit 00fddf1

Please sign in to comment.