Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
elpham6 authored and elpham6 committed May 9, 2024
1 parent d812c52 commit 61c3c4f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
11 changes: 7 additions & 4 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ Let's create a section for some example codes. We will use ``sphinx_gallery`` ex
}
4. In the ``examples`` folder, create a **README.rst** or **README.txt** file.
You can add anything; it is just a requirement for sphinx_gallery. For example:
A readme file is necessary for sphinx_gallery to generate documentation. Copy/paste this text:

.. code-block:: rst
Expand All @@ -262,7 +262,10 @@ You can add anything; it is just a requirement for sphinx_gallery. For example:
This folder contains example code for the **calculator.py** module.
5. In ``docs/index.rst``, add the new automatically created index file:
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.

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

.. code-block:: rst
Expand All @@ -278,12 +281,12 @@ You can add anything; it is just a requirement for sphinx_gallery. For example:
auto_examples/index
6. From ``docs``, run ``make html`` again.
7. From ``docs``, run ``make html`` again.

You can now see the example code, with links to download the module.

**Note**: the docstring at the top of **calc_example.py** is in .rst format. That is because Sphinx automatically generates a .rst file from the .py file.
You can see that this docstring became the title and content of the page. This leaves room for you to add more documentation or diagrams.
You can see that this docstring is formatted into the page. This means you can add other things, such as diagrams here as well.

There are a lot of other things you can do with Sphinx to customize your documentation website.

Expand Down
2 changes: 1 addition & 1 deletion examples/readme.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Calculator Examples
###################

This folder contains example code for the **calculator.py** module.
This contains example code for the **calculator.py** module.

0 comments on commit 61c3c4f

Please sign in to comment.