Skip to content

Commit

Permalink
change format
Browse files Browse the repository at this point in the history
  • Loading branch information
elpham6 authored and elpham6 committed May 9, 2024
1 parent b498ce2 commit 529088c
Showing 1 changed file with 17 additions and 20 deletions.
37 changes: 17 additions & 20 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -238,33 +238,30 @@ Let's create a section for some example codes. We will use ``sphinx_gallery`` ex

3. Add the sphinx_gallery config to **conf.py**:

.. code-block:: python
sphinx_gallery_conf = {
# path to your example scripts
'examples_dirs': ['../examples'],
# path to where to save gallery generated output
'gallery_dirs': ['auto_examples'],
'filename_pattern': '.py',
'plot_gallery': 'False',
}
.. code-block:: python
sphinx_gallery_conf = {
# path to your example scripts
'examples_dirs': ['../examples'],
# path to where to save gallery generated output
'gallery_dirs': ['auto_examples'],
'filename_pattern': '.py',
'plot_gallery': 'False',
}
4. In the ``examples`` folder, create a **README.rst** or **README.txt** file.
A readme file is necessary for sphinx_gallery to generate documentation. Copy/paste this text:

.. code-block:: rst
Calculator Examples
###################
This folder contains example code for the **calculator.py** module.
A readme file is necessary for sphinx_gallery to generate documentation. Copy/paste this text:

.. code-block:: rst
Calculator Examples
###################
This folder contains example code for the **calculator.py** module.
5. From ``docs``, run ``make html``. There is a new folder called ``auto_examples`` created in ``docs``, with all the generated
documentation for modules in the ``examples`` folder.
documentation for modules in the ``examples`` folder.


6. In ``docs/index.rst``, add the new automatically created index file:

Expand Down

0 comments on commit 529088c

Please sign in to comment.