Skip to content

Commit

Permalink
adding auto-linking
Browse files Browse the repository at this point in the history
  • Loading branch information
choldgraf committed Jun 29, 2017
1 parent 9617fc8 commit b621060
Show file tree
Hide file tree
Showing 11 changed files with 72 additions and 10 deletions.
1 change: 1 addition & 0 deletions docs/doc-requirements.txt
@@ -1,3 +1,4 @@
netCDF4
iris
cf_units
sphinx-gallery
35 changes: 35 additions & 0 deletions docs/source/_templates/automodule.rst
@@ -0,0 +1,35 @@
{{ fullname | escape | underline}}


.. automodule:: {{ fullname }}
:no-members:
:no-inherited-members:

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

Classes
-------

.. autosummary::
:template: autosummary.rst
:toctree:
{% for item in classes %}{% if item not in ['zip', 'map', 'reduce'] %}
{{ item }}{% endif %}{% endfor %}
{% endif %}
{% endblock %}

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

Functions
---------

.. autosummary::
:template: autosummary.rst
:toctree:

{% for item in functions %}{% if item not in ['zip', 'map', 'reduce'] %}
{{ item }}{% endif %}{% endfor %}
{% endif %}
{% endblock %}
16 changes: 16 additions & 0 deletions docs/source/_templates/autosummary.rst
@@ -0,0 +1,16 @@
{{ fullname | escape | underline}}


.. currentmodule:: {{ module }}

.. auto{{ objtype }}:: {{ objname }}
{% if objtype in ['class', 'method', 'function'] %}

.. include:: {{module}}.{{objname}}.examples

.. raw:: html

<div class="clearer"></div>

{% endif %}
9 changes: 5 additions & 4 deletions docs/source/conf.py
Expand Up @@ -92,12 +92,13 @@
# Sphinx gallery configuration
sphinx_gallery_conf = {
'examples_dirs': ['../../lib/cartopy/examples'],
'filename_pattern': '^((?!sgskip).)*$',
'filename_pattern': '^((?!sgskip).)*$|^((?!__init__.py).)*$',
'gallery_dirs': ['gallery'],
'doc_module': ('cartopy'),
'reference_url': {'matplotlib': 'http://matplotlib.org',
'numpy': 'http://docs.scipy.org/doc/numpy/reference',
'scipy': 'http://docs.scipy.org/doc/scipy/reference'},
'scipy': 'http://docs.scipy.org/doc/scipy/reference',
'cartopy': None},
'backreferences_dir': 'api/_as_gen',
}

Expand Down Expand Up @@ -336,8 +337,8 @@

# Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {'python': ('https://docs.python.org/3', None),
'matplotlib': ('http://matplotlib.org', None),
'shapely': ('http://toblerity.org/shapely', None),}
'matplotlib': ('https://matplotlib.org', None),
'shapely': ('https://toblerity.org/shapely', None),}



Expand Down
6 changes: 3 additions & 3 deletions lib/cartopy/examples/README.txt
@@ -1,7 +1,7 @@
CartoPy Gallery
Cartopy Gallery
---------------

The following examples show off the functionality of CartoPy. They
The following examples show off the functionality of Cartopy. They
illustrate the kinds of things you can do with this library. For
more examples, tutorials, and guides on how to use CartoPy, see
more examples, tutorials, and guides on how to use Cartopy, see
the :ref:`getting started <getting-started>` section.
Empty file.
@@ -1,7 +1,8 @@
"""
Always Circular Stereo
Keep Boundary Circular
----------------------
Setting the boundary of an image to be circular.
"""
import matplotlib.path as mpath
import matplotlib.pyplot as plt
Expand Down
2 changes: 1 addition & 1 deletion lib/cartopy/examples/miscellanea/un_flag.py
@@ -1,5 +1,5 @@
"""
Un Flag
UN Flag
-------
"""
Expand Down
5 changes: 4 additions & 1 deletion lib/cartopy/examples/scalar_data/eyja_volcano.py
@@ -1,3 +1,4 @@
# -*- coding: utf-8 -*-
"""
Map tile acquisition
--------------------
Expand All @@ -7,8 +8,10 @@
into a single image and displayed in the cartopy GeoAxes.
.. _examples-eyja_volcano:
Grabbing the map tiles
======================
"""
# -*- coding: utf-8 -*-
import matplotlib.pyplot as plt
from matplotlib.transforms import offset_copy

Expand Down
Expand Up @@ -52,7 +52,9 @@ def main():
ax = fig.add_subplot(1, 1, 1, projection=ccrs.Miller())
ax.coastlines()
ax.set_global()
print('Retrieving image...')
img, crs, extent, origin = geos_image()
print('Projecting and plotting image (this may take a while)...')
ax.imshow(img, transform=crs, extent=extent, origin=origin, cmap='gray')
plt.show()

Expand Down
3 changes: 3 additions & 0 deletions lib/cartopy/examples/web_services/wmts.py
Expand Up @@ -14,6 +14,9 @@
and Atmospheric Administration (NOAA).
.. _examples-wmts:
Downloading and plotting tiles
==============================
"""

import cartopy.crs as ccrs
Expand Down

0 comments on commit b621060

Please sign in to comment.