Skip to content

Commit

Permalink
Generate documentation (#52)
Browse files Browse the repository at this point in the history
* include autodoc

* autodoc earthspy

* add autosummary

* generated earthspy page

* change html theme

* add template

* improve doc conf

* fix version

* remove matplotlib

* remove plot_directive

* remove doc references

* remove example library
  • Loading branch information
AdrienWehrle authored May 2, 2022
1 parent a33442b commit 795f8fe
Show file tree
Hide file tree
Showing 15 changed files with 227 additions and 21 deletions.
1 change: 1 addition & 0 deletions docs/.#index.rst
Binary file modified docs/_build/doctrees/environment.pickle
Binary file not shown.
Binary file modified docs/_build/doctrees/index.doctree
Binary file not shown.
2 changes: 1 addition & 1 deletion docs/_build/html/.buildinfo
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: 9c8b1c4a938c9dc4ec3bdad471a320c3
config: b79dd4f55baf953d95ecd9bb9a9b0003
tags: 645f666f9bcd5a90fca523b33c5a78b7
2 changes: 1 addition & 1 deletion docs/_build/html/_sources/index.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ Welcome to earthspy's documentation!
====================================

.. toctree::
api
:maxdepth: 2
:caption: Contents:



Indices and tables
==================

Expand Down
32 changes: 32 additions & 0 deletions docs/_build/html/genindex.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,36 @@
<h1 id="index">Index</h1>

<div class="genindex-jumpbox">
<a href="#E"><strong>E</strong></a>
| <a href="#M"><strong>M</strong></a>

</div>
<h2 id="E">E</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
<li>
earthspy

<ul>
<li><a href="generated/earthspy.html#module-earthspy">module</a>
</li>
</ul></li>
</ul></td>
</tr></table>

<h2 id="M">M</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
<li>
module

<ul>
<li><a href="generated/earthspy.html#module-earthspy">earthspy</a>
</li>
</ul></li>
</ul></td>
</tr></table>



</div>
Expand All @@ -54,6 +82,10 @@ <h1 class="logo"><a href="index.html">earthspy</a></h1>


<h3>Navigation</h3>
<p class="caption" role="heading"><span class="caption-text">Contents:</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="api.html">API</a></li>
</ul>

<div class="relations">
<h3>Related Topics</h3>
Expand Down
10 changes: 10 additions & 0 deletions docs/_build/html/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
<script src="_static/doctools.js"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="API" href="api.html" />

<link rel="stylesheet" href="_static/custom.css" type="text/css" />

Expand All @@ -34,6 +35,10 @@
<section id="welcome-to-earthspy-s-documentation">
<h1>Welcome to earthspy’s documentation!<a class="headerlink" href="#welcome-to-earthspy-s-documentation" title="Permalink to this headline"></a></h1>
<div class="toctree-wrapper compound">
<p class="caption" role="heading"><span class="caption-text">Contents:</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="api.html">API</a></li>
</ul>
</div>
</section>
<section id="indices-and-tables">
Expand Down Expand Up @@ -62,11 +67,16 @@ <h1 class="logo"><a href="#">earthspy</a></h1>


<h3>Navigation</h3>
<p class="caption" role="heading"><span class="caption-text">Contents:</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="api.html">API</a></li>
</ul>

<div class="relations">
<h3>Related Topics</h3>
<ul>
<li><a href="#">Documentation overview</a><ul>
<li>Next: <a href="api.html" title="next chapter">API</a></li>
</ul></li>
</ul>
</div>
Expand Down
Binary file modified docs/_build/html/objects.inv
Binary file not shown.
4 changes: 4 additions & 0 deletions docs/_build/html/search.html
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@ <h1 class="logo"><a href="index.html">earthspy</a></h1>


<h3>Navigation</h3>
<p class="caption" role="heading"><span class="caption-text">Contents:</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="api.html">API</a></li>
</ul>

<div class="relations">
<h3>Related Topics</h3>
Expand Down
2 changes: 1 addition & 1 deletion docs/_build/html/searchindex.js

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

67 changes: 67 additions & 0 deletions docs/_templates/module.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
{{ fullname }}
{{ underline }}

.. automodule:: {{ fullname }}

.. contents:: Contents
:local:

{% block functions %}
{% if functions %}

Functions
=========

{% for item in functions %}

{{item}}
{{ "-" * (item | length) }}

.. autofunction:: {{ item }}

.. _sphx_glr_backref_{{fullname}}.{{item}}:

.. minigallery:: {{fullname}}.{{item}}
:add-heading:

{%- endfor %}
{% endif %}
{% endblock %}

{% block classes %}
{% if classes %}

Classes
=======

{% for item in classes %}

{{item}}
{{ "-" * (item | length) }}

.. autoclass:: {{ item }}
:show-inheritance:
:special-members: __init__
:members:

.. _sphx_glr_backref_{{fullname}}.{{item}}:

.. minigallery:: {{fullname}}.{{item}}
:add-heading:

{% endfor %}
{% endif %}
{% endblock %}

{% block exceptions %}
{% if exceptions %}

Exceptions
==========

.. autosummary::
{% for item in exceptions %}
{{ item }}
{%- endfor %}
{% endif %}
{% endblock %}
17 changes: 17 additions & 0 deletions docs/api.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
API
===

.. currentmodule:: earthspy

.. autosummary::
:toctree: generated/
:template: module.rst
:recursive:

earthspy


.. automodule earthspy
.. contents:: Contents
:local:
86 changes: 69 additions & 17 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,47 +9,99 @@
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
# import os
# import sys
# sys.path.insert(0, os.path.abspath('.'))

import os
import sys

# -- Project information -----------------------------------------------------
# Allow conf.py to find the earthspy module
sys.path.append(os.path.abspath("../"))
sys.path.append(os.path.abspath("../earthspy/"))

project = 'earthspy'
copyright = '2022, Adrien Wehrlé'
author = 'Adrien Wehrlé'

# The full version, including alpha/beta/rc tags
release = 'v0.1.0'
# -- Project information -----------------------------------------------------

project = "earthspy"
copyright = "2022, Adrien Wehrlé"
author = "Adrien Wehrlé"

# Set the python environment variable for programoutput to find it.
os.environ["PYTHON"] = sys.executable

# -- General configuration ---------------------------------------------------

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
# If your documentation needs a minimal Sphinx version, state it here.
#
# needs_sphinx = '3.3.1'
master_doc = "index"

extensions = [
"sphinx.ext.autodoc", # Create the API documentation automatically
"sphinx.ext.viewcode", # Create the "[source]" button in the API to show the source code.
"sphinx.ext.autosummary", # Create API doc summary texts from the docstrings.
"sphinx.ext.inheritance_diagram", # For class inheritance diagrams (see coregistration.rst).
"sphinx_autodoc_typehints", # Include type hints in the API documentation.
"sphinxcontrib.programoutput",
# "sphinx_gallery.gen_gallery", # Examples gallery
"sphinx.ext.intersphinx",
]

intersphinx_mapping = {
"rasterio": ("https://rasterio.readthedocs.io/en/latest", None),
"numpy": ("https://numpy.org/doc/stable", None),
}

sphinx_gallery_conf = {
# "examples_dirs": os.path.join(
# os.path.dirname(__file__), "../", "../", "examples"
# ), # path to your example scripts
# "gallery_dirs": "auto_examples", # path to where to save gallery generated output
# "inspect_global_variables": True, # Make links to the class/function definitions.
"reference_url": {
# The module you locally document uses None
"earthspy": None,
},
"filename_pattern": r".*\.py", # Run all python files in the gallery (by default, only files starting with "plot_" are run)
# directory where function/class granular galleries are stored
# "backreferences_dir": "gen_modules/backreferences",
"doc_module": (
"earthspy"
), # which function/class levels are used to create galleries
}

extlinks = {
"issue": ("https://github.com/AdrienWehrle/earthspy/issues/%s", "GH"),
"pull": ("https://github.com/AdrienWehrle/earthspy/pull/%s", "PR"),
}

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
templates_path = [os.path.join(os.path.dirname(__file__), "_templates")]

import earthspy

# The short X.Y version
version = "v0.1"
# The full version, including alpha/beta/rc tags.
release = "v0.1.0"


# 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", "_templates"]

# autodoc_default_options = {
# "special-members": "__init__",
# }

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

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = 'alabaster'
html_theme = "sphinx_rtd_theme"


# 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']
# html_static_path = ['_static']
23 changes: 23 additions & 0 deletions docs/generated/earthspy.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
earthspy
========

.. automodule:: earthspy



















2 changes: 1 addition & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ Welcome to earthspy's documentation!
====================================

.. toctree::
api
:maxdepth: 2
:caption: Contents:



Indices and tables
==================

Expand Down

0 comments on commit 795f8fe

Please sign in to comment.