-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Set up doc for Ansys Sphinx theme like PyAnsys libraries (#103)
* Set up doc for Ansys Sphinx theme like PyAnsys libraries * Fix missing config file and clean up based on rendering * Apply suggestions from code review Incorporate Roberto's feedback Co-authored-by: Roberto Pastor Muela <[email protected]> * Update doc/source/User_guide/options.rst Incorporate missed change. Co-authored-by: Roberto Pastor Muela <[email protected]> * Add "boolean" to accept.txt Google style guide: When referring to the abstract data type, use lowercase. (In the unlikely event that you refer to Boolean mathematics or Boolean logic, use uppercase.) * Renaming folders Co-authored-by: RobPasMue <[email protected]>
- Loading branch information
Showing
12 changed files
with
256 additions
and
210 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
.. _ref_getting_started: | ||
|
||
=============== | ||
Getting started | ||
=============== | ||
`Sphinx <https://www.sphinx-doc.org/en/master/>`_ is a Python documentation | ||
generator for creating documentation. If you are new to using Sphinx, see | ||
`Sphinx Getting Started <https://www.sphinx-doc.org/en/master/usage/quickstart.html>`_. | ||
|
||
This section explains how to install the Ansys Sphinx theme and then set up your | ||
Sphinx ``conf.py`` file to use this theme to generate your documentation. | ||
|
||
Install the theme | ||
----------------- | ||
Install the Ansys Sphinx theme with: | ||
|
||
.. code:: | ||
pip install ansys-sphinx-theme | ||
Modify the ``conf.py`` file | ||
--------------------------- | ||
To use this theme, modify your Sphinx ``conf.py`` file:: | ||
|
||
html_theme ='ansys_sphinx_theme' | ||
|
||
Consider using the ``conf.py`` for this repository: | ||
|
||
.. literalinclude:: ../conf.py | ||
:language: python | ||
|
||
.. toctree:: | ||
:hidden: | ||
:maxdepth: 2 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,17 @@ | ||
********* | ||
404 pages | ||
********* | ||
.. _ref_user_guide_404_page: | ||
|
||
******** | ||
404 page | ||
******** | ||
Because Sphinx does not create a 404 page by default, you can use the | ||
`sphinx-notfound-page | ||
<https://sphinx-notfound-page.readthedocs.io/en/latest/index.html>`_ extension | ||
for 404 pages. While originally developed to be used with `Read the Docs <https://readthedocs.org/>`_, | ||
this extension can be used in other hosting services. For more | ||
information, see the extension's `documentation <https://sphinx-notfound-page.readthedocs.io/en/latest/how-it-works.html>`_. | ||
|
||
Installation | ||
------------ | ||
Install the extension | ||
--------------------- | ||
Install and enable the ``sphinx-notfound-page`` extension with: | ||
|
||
.. code-block:: text | ||
|
@@ -18,8 +20,8 @@ Install and enable the ``sphinx-notfound-page`` extension with: | |
Consider adding this extension to your ``requirements_doc.txt`` file. | ||
|
||
Configuration | ||
------------- | ||
Add the extension to the ``conf.py`` file | ||
----------------------------------------- | ||
After installing the ``sphinx-notfound-page`` extension, add it to | ||
your ``conf.py`` file: | ||
|
||
|
@@ -37,10 +39,14 @@ your ``conf.py`` file: | |
"contact_mail": "[email protected]", | ||
} | ||
Default 404 page | ||
---------------- | ||
To use the default 404 page that the ``ansys-sphinx-theme`` package supplies, | ||
add the following lines in ``conf.py``: | ||
Configure your 404 page | ||
----------------------- | ||
You can use the default 404 page that the ``ansys-sphinx-theme`` package supplies | ||
or create and use a custom 404 page. | ||
|
||
Use the default 404 page | ||
~~~~~~~~~~~~~~~~~~~~~~~~ | ||
To use the default 404 page, add the following lines in the ``conf.py`` file: | ||
|
||
.. code-block:: | ||
|
@@ -52,25 +58,26 @@ add the following lines in ``conf.py``: | |
.. _sphinx-notfound-page: https://sphinx-notfound-page.readthedocs.io/en/latest/index.html | ||
|
||
Custom 404 page | ||
--------------- | ||
To create a custom 404 page for your project, start by creating a ``404.rst`` | ||
file next to the ``conf.py`` file. Make sure you include the ``:orphan:`` attribute | ||
at the top of this ``404.rst`` file to suppress the spurious ``document isn't | ||
included in any toctree`` Sphinx warning. | ||
|
||
.. code-block:: rst | ||
:orphan: | ||
Error 404 Not Found | ||
=================== | ||
The page you are requesting does not exist. | ||
Update the ``notfound_template`` variable in the ``conf.py`` to the location of your | ||
``404.rst`` file: | ||
|
||
.. code-block:: rst | ||
# Configure sphinx-notfound-page | ||
notfound_template = "path/to/404.rst" | ||
Create and use a custom 404 page | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
To create and use a custom 404 page, do the following: | ||
|
||
#. Create a ``404.rst`` file next to the ``conf.py`` file. | ||
#. To suppress the spurious ``document isn't included in any toctree`` Sphinx | ||
warning, include the ``:orphan:`` attribute at the top of this ``404.rst`` file: | ||
|
||
.. code-block:: rst | ||
:orphan: | ||
Error 404 Not Found | ||
=================== | ||
The page you are requesting does not exist. | ||
#. Update the ``notfound_template`` variable in the ``conf.py`` to the location of | ||
your ``404.rst`` file: | ||
|
||
.. code-block:: rst | ||
# Configure sphinx-notfound-page | ||
notfound_template = "path/to/404.rst" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
.. _ref_user_guide: | ||
|
||
========== | ||
User guide | ||
========== | ||
The Ansys Sphinx theme is based on the `PyData Sphinx theme <https://github.com/pydata/pydata-sphinx-theme>`_. | ||
For more information on its configuration, see | ||
`Configuration <https://pydata-sphinx-theme.readthedocs.io/en/stable/user_guide/configuring.html>`_. | ||
|
||
While the Ansys Sphinx theme is often used as is, you can customize the following: | ||
|
||
- :ref:`ref_user_guide_css` | ||
- :ref:`ref_user_guide_html_theme` | ||
- :ref:`ref_user_guide_pdf_cover` | ||
- :ref:`ref_user_guide_404_page` | ||
|
||
.. toctree:: | ||
:hidden: | ||
:maxdepth: 2 | ||
|
||
css | ||
options | ||
404_page | ||
|
Oops, something went wrong.