Linking to other galleries¶
You can insert the links to the example galleries in other projects using the
linkgalleries
directive. This will insert all the thumbnails and the
titles of the examples in a list. You can find an example
below.
- .. linkgalleries::¶
Insert links to other example galleries generated with the sphinx-nbexamples extension.
The directive takes no arguments and the options are the same as for the figure directive. By default, we use a width of 160px and the
align
parameter is set to'left'
.Each line of the content for this package must be the name of a package as it is registered in the
intersphinx_mapping
configuration value by thesphinx.ext.intersphinx
extension. Optionally you can also provide the folder for the examples.Warning
This directive only works well for examples that have a thumbnail associated with them, i.e. not with code examples (see Choosing the thumbnail).
Examples
To insert links to the examples of the sphinx-nbexamples gallery you can either use
.. linkgalleries:: sphinx_nbexamples
or more explicit
.. linkgalleries:: sphinx_nbexamples examples
Linked gallery example¶
The outputs of
.. linkgalleries::
psyplot
are links to the examples in psyplots example gallery.
This then transforms to
In the conf.py
script, the intersphinx_mapping
configuration
value then looks like
intersphinx_mapping = {
'psyplot': ('http://psyplot.readthedocs.io/en/latest/', None),
}
We can also insert links into the library of the current project by just inserting the name of the project.
In our case (sphinx-nbexamples
) this then looks like
The linkgalleries
directive also accepts multiple packages, e.g.
.. linkgalleries::
psyplot
sphinx-nbexamples