diff --git a/doc/conf.py b/doc/conf.py index 6651383fcacb..96106c2d1f33 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -299,6 +299,7 @@ def autodoc_process_bases(app, name, obj, options, bases): 'doc_module': ('matplotlib', 'mpl_toolkits'), 'examples_dirs': example_dirs, 'filename_pattern': '^((?!sgskip).)*$', + 'ignore_pattern': r'(__init__|basic_units)\.py', 'gallery_dirs': gallery_dirs, 'image_scrapers': (matplotlib_reduced_latex_scraper, ), 'image_srcset': ["2x"], @@ -314,7 +315,7 @@ def autodoc_process_bases(app, name, obj, options, bases): 'thumbnail_size': (320, 224), 'within_subsection_order': gallery_order_subsectionorder, 'capture_repr': (), - 'copyfile_regex': r'.*\.rst', + 'copyfile_regex': r'(.*\.rst|.*basic_units\.(py|ipynb))', } if parse_version(sphinx_gallery.__version__) >= parse_version('0.17.0'): diff --git a/galleries/examples/units/basic_units.ipynb b/galleries/examples/units/basic_units.ipynb new file mode 100644 index 000000000000..3eecc79137c8 --- /dev/null +++ b/galleries/examples/units/basic_units.ipynb @@ -0,0 +1,25 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Basic units\n", + "\n", + "This notebook accompanies `basic_units.py`, the helper module used by the units gallery examples." + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "name": "python" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/galleries/users_explain/axes/axes_units.py b/galleries/users_explain/axes/axes_units.py index 2cabb0de350a..4f2ffb02c574 100644 --- a/galleries/users_explain/axes/axes_units.py +++ b/galleries/users_explain/axes/axes_units.py @@ -267,7 +267,7 @@ # # The support for dates and categories is part of "units" support that is built # into Matplotlib. This is described at `.matplotlib.units` and in the -# :ref:`basic_units` example. +# :ref:`units examples `. # # Unit support works by querying the type of data passed to the plotting # function and dispatching to the first converter in a list that accepts that