You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* doc/refactor_doc_practices
* Incorporated review comments from greschd
* Promote use of "Create draft pull request" rather than adding WIP to PR title
General usage information and API descriptions should be placed within
138
-
``doc/source`` and docstrings. Full examples should be placed in
139
-
``examples/``.
138
+
Docstrings are included in the Python (PY) files for your API. General usage information
139
+
is provided in RST files that are placed in ``doc/source``. Full-fledged standalone examples
140
+
that are meant to be run as individual downloadable scripts are provided in PY files that are
141
+
placed in ``examples/``.
140
142
141
-
Adding a New Example
142
-
~~~~~~~~~~~~~~~~~~~~
143
-
Examples come in two formats:
144
-
145
-
- Basic code snippets demonstrating some functionality
146
-
- Full-fledged standalone examples meant to be run as individual downloadable scripts
147
-
148
-
While basic code snippets should be placed in the ``doc/source`` directory, full-fledged
149
-
standalone examples must be placed in the ``examples`` directory at the root of the repository.
150
-
151
-
When adding a standalone example, you add it to an applicable subfolder in the ``examples``
152
-
directory. If none of the existing directories match the category of your example, create
153
-
a new subfolder with a ``README.txt`` file describing the new category. As these examples
154
-
are built using the Sphinx gallery extension, you must follow `Sphinx gallery coding guidelines <https://sphinx-gallery.github.io/stable/index.html>_`.
155
-
156
-
PyMAPDL provides a self-demonstrating example of how to `add an example reference key <https://mapdldocs.pyansys.com/examples/03-tips-n-tricks/00-example-template.html#ref-how-to-add-an-example-reference-key>`_.
157
-
158
-
Documentation Style and Organization
159
-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
160
-
Docstrings should follow `numpydocs docstring <https://numpydoc.readthedocs.io/en/latest/format.html>`_
161
-
guidelines. Documentation within the ``doc/`` directory use the reStructuredText.
162
-
(RST) format. Examples within the ``examples/`` directory should be PEP 8-compliant
163
-
and will be compiled dynamically during the build process. Always ensure that
164
-
examples run properly locally because they will be verified through the CI performed
165
-
via GitHub Actions.
166
-
167
-
Documentation for the latest stable release of a PyAnsys library is accessible
168
-
from its repository. You can generally access the latest development version of the
169
-
documentation tracking the ``main`` branch by adding the prefix ``dev.`` to
170
-
the URL for the latest stable release. For example, the URL for documentation of the
171
-
latest stable release of PyAEDT is `<https://aedtdocs.pyansys.com/>`_, and
172
-
the URL for the latest documentation for the development version of PyAEDT is
173
-
`<https://dev.aedtdocs.pyansys.com/>`_. The latest development versions of both
174
-
the library and its documentation are kept up-to-date automatically via GitHub actions.
175
-
176
-
Building Documentation Locally
177
-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
178
-
You can build and verify the HTML documentation for a PyAnsys project locally
179
-
by installing Sphinx and other documentation build dependencies.
180
-
181
-
#. Optionally install the project in development mode:
182
-
183
-
.. code::
184
-
185
-
pip install -e .
186
-
187
-
#. Install the build requirements for documentation:
188
-
189
-
.. code::
190
-
191
-
pip install -r requirements_docs.txt
192
-
193
-
194
-
#. If running on Linux/Mac OS, build the documentation:
195
-
196
-
.. code::
197
-
198
-
make -C doc html
199
-
200
-
Otherwise, if running on Windows, build the documentation:
201
-
202
-
.. code::
203
-
204
-
cd doc
205
-
make.bat html
206
-
207
-
#. After documentation builds successfully locally, navigate to
208
-
``doc/_build/html/`` and use your browser to open the
209
-
``index.html`` so that you can review the documenation.
143
+
For comprehensive documentation guidelines, including how to build documentation locally,
144
+
see :ref:`doc_practices`.
210
145
211
146
Continuous Integration and Continuous Delivery (CI/CD)
0 commit comments