Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 756efda

Browse files
committed
FIX: Use refs not links
1 parent af9ce8c commit 756efda

File tree

2 files changed

+49
-45
lines changed

2 files changed

+49
-45
lines changed

README.rst

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,14 @@ Who uses Sphinx-Gallery
3434
* `scikit-image <http://scikit-image.org/docs/dev/auto_examples/>`_
3535
* `Astropy <http://docs.astropy.org/en/stable/generated/examples/index.html>`_
3636
* `SunPy <http://docs.sunpy.org/en/stable/generated/gallery/index.html>`_
37+
* `PySurfer <https://pysurfer.github.io/>`_
3738

3839
Getting the package
3940
===================
4041

41-
You can do a direct install via pip by using::
42+
You can do a direct install via pip by using:
43+
44+
.. code-block:: bash
4245
4346
$ pip install sphinx-gallery
4447
@@ -64,7 +67,9 @@ You can get the latest development source from our `Github repository
6467

6568
You will also need to install the dependencies listed above and `pytest`
6669

67-
To install everything do::
70+
To install everything do:
71+
72+
.. code-block:: bash
6873
6974
$ git clone https://github.com/sphinx-gallery/sphinx-gallery
7075
$ cd sphinx-gallery
@@ -103,9 +108,7 @@ structure you get from executing ``sphinx-quickstart``.
103108

104109

105110
To get Sphinx-Gallery into your project we have to extend the Sphinx
106-
``doc/conf.py`` file with:
107-
108-
.. code-block:: python
111+
``doc/conf.py`` file with::
109112

110113
extensions = [
111114
...
@@ -117,9 +120,7 @@ This is to load Sphinx-Gallery as one of your extensions, the ellipsis
117120

118121
Now to declare your project structure, we add a configuration
119122
dictionary for Sphinx-Gallery. The examples directory ``../examples``
120-
is declared with a relative path from the ``conf.py`` file location.
121-
122-
.. code-block:: python
123+
is declared with a relative path from the ``conf.py`` file location::
123124

124125
sphinx_gallery_conf = {
125126
# path to your examples scripts
@@ -157,15 +158,19 @@ files.
157158
Building the documentation locally
158159
----------------------------------
159160

160-
In your sphinx documentation directory, ``doc`` execute::
161+
In your sphinx documentation directory, ``doc`` execute:
162+
163+
.. code-block:: bash
161164
162165
$ make html
163166
164167
This will start the build of your complete documentation including the examples
165168
gallery. Once documentation is build, our extension will have generated an ``auto_examples``
166169
directory and populated it with rst files containing the gallery and each example.
167170
Sphinx gives this files its regular processing and you can enjoy your
168-
generated gallery under the same path. That means you will find the gallery in the path::
171+
generated gallery under the same path. That means you will find the gallery in the path:
172+
173+
.. code-block:: bash
169174
170175
_build/html/auto_examples/index.html
171176
@@ -181,7 +186,9 @@ Extending your Makefile
181186
-----------------------
182187
Once your gallery is working you might need remove completely all generated files by
183188
sphinx-gallery to have a clean build, or you might want to build the gallery without
184-
running the examples files. For this you need to extend your ``Makefile`` with::
189+
running the examples files. For this you need to extend your ``Makefile`` with:
190+
191+
.. code-block:: bash
185192
186193
clean:
187194
rm -rf $(BUILDDIR)/*

doc/advanced_configuration.rst

Lines changed: 31 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,31 @@
22
Configuration
33
=============
44

5+
List of config options
6+
======================
7+
58
Most sphinx-gallery configuration options are set in the Sphinx ``conf.py``
69
file:
710

8-
- `examples_dirs and gallery_dirs <multiple_galleries_config>`_
9-
- `filename_pattern <build_pattern>`_
10-
- `subsection_order <sub_gallery_order>`_
11-
- `reference_url` <link_to_documentation>`_
12-
- `backreferences_dir and doc_module <references_to_examples> `_
13-
- `default_thumb_file <custom_default_thumb>`_
14-
- `line_numbers <adding_line_numbers>`_
15-
- `disable_joint_download <download_section_examples>`_
11+
- :ref:`examples_dirs and gallery_dirs <multiple_galleries_config>`
12+
- :ref:`filename_pattern <build_pattern>`
13+
- :ref:`subsection_order <sub_gallery_order>`
14+
- :ref:`reference_url <link_to_documentation>`
15+
- :ref:`backreferences_dir and doc_module <references_to_examples>`
16+
- :ref:`default_thumb_file <custom_default_thumb>`
17+
- :ref:`line_numbers <adding_line_numbers>`
18+
- :ref:`disable_joint_download <download_section_examples>`
1619

1720
Some options can also be set or overridden on a file-by-file basis:
1821

19-
- adding_line_numbers_
20-
- without_execution_
21-
- choosing_thumbnail_
22+
- :ref:`adding_line_numbers`
23+
- :ref:`without_execution`
24+
- :ref:`choosing_thumbnail`
2225

2326
And some options can be set during the build execution step:
2427

25-
- without_execution_
26-
- dealing_with_failures_
28+
- :ref:`without_execution`
29+
- :ref:`dealing_with_failures`
2730

2831
.. _multiple_galleries_config:
2932

@@ -51,9 +54,7 @@ Building examples matching a pattern
5154

5255
By default, Sphinx-Gallery execute only examples beginning with ``plot``. However,
5356
if this naming convention does not suit your project, you can modify this pattern
54-
in your Sphinx ``conf.py``. For example:
55-
56-
.. code-block:: python
57+
in your Sphinx ``conf.py``. For example::
5758

5859
sphinx_gallery_conf = {
5960
'filename_pattern': '/plot_compute_',
@@ -94,8 +95,7 @@ As the patterns are parsed as `regular expressions`_, users are advised to consu
9495

9596
.. _sub_gallery_order:
9697

97-
Sorting the subsections inside a gallery
98-
========================================
98+
Sorting gallery subsections
9999

100100
Gallery subsections are sorted by default alphabetically by their folder
101101
name, and as such you can always organize them by changing your folder
@@ -161,8 +161,8 @@ dictionary within your Sphinx ``conf.py`` file::
161161

162162
.. _references_to_examples:
163163

164-
References to examples (backreferences)
165-
=======================================
164+
Adding references to examples
165+
=============================
166166

167167
Sphinx-Gallery enables you, when documenting your modules, to
168168
reference to the examples that use a particular function. For example
@@ -270,8 +270,8 @@ configuration option setup for Sphinx-Gallery.
270270

271271
.. _custom_default_thumb:
272272

273-
Using a custom default thumbnail image
274-
======================================
273+
Using a custom default thumbnail
274+
================================
275275

276276
In case you want to use your own image for the thumbnail of examples that do
277277
not generate any plot, you can specify it by editing your Sphinx ``conf.py``
@@ -285,8 +285,8 @@ file. You need to add to the configuration dictionary a key called
285285

286286
.. _adding_line_numbers:
287287

288-
Adding line numbers to example listings
289-
=======================================
288+
Adding line numbers to examples
289+
===============================
290290

291291
Line numbers can be displayed in listings by adding the global ``line_numbers``
292292
setting::
@@ -306,8 +306,8 @@ original file.
306306

307307
.. _disable_joint_download:
308308

309-
Disable joint download of all gallery scripts
310-
=============================================
309+
Disabling joint download of scripts
310+
===================================
311311

312312
By default Sphinx-Gallery prepares zip files of all python scripts and
313313
all Jupyter notebooks for each gallery section and makes them
@@ -321,8 +321,8 @@ behavior add to the configuration dictionary in your ``conf.py`` file::
321321

322322
.. _choosing_thumbnail:
323323

324-
Choosing the thumbnail image from multiple figures
325-
==================================================
324+
Choosing the thumbnail image
325+
============================
326326

327327
For examples that generate multiple figures, the default behavior will use
328328
the first figure created in each as the thumbnail image displayed in the
@@ -340,8 +340,8 @@ of this functionality.
340340

341341
.. _without_execution:
342342

343-
Building the Gallery without executing the examples
344-
===================================================
343+
Building without executing examples
344+
===================================
345345

346346
Sphinx-Gallery can parse all your examples and build the gallery
347347
without executing any of the scripts. This is just for speed
@@ -417,10 +417,7 @@ It might be the case that you want to keep the gallery even with
417417
failed examples. Thus you can configure Sphinx-Gallery to allow
418418
certain examples to fail and still exit with a 0 exit code. For this
419419
you need to list all the examples you want to allow to fail during
420-
build. Change your `conf.py` accordingly:
421-
422-
423-
.. code-block:: python
420+
build. Change your `conf.py` accordingly::
424421

425422
sphinx_gallery_conf = {
426423
...

0 commit comments

Comments
 (0)