Skip to content

Commit e9a051b

Browse files
PipKatRevathyvenugopal162RobPasMue
authored
Doc/fix minor formatting and style issues (#443)
* Minor fixes * Minor fixes based on skimming rendered doc * Additional edits * Fix Vale issues * Resolve doc build errors * Edit to add-sphinx-extensions * Resolve link issues causing doc build failure * Fix mistake * Apply suggestions from code review Add corrections for mistakes found by Roberto and Revathy Co-authored-by: Revathy Venugopal <104772255+Revathyvenugopal162@users.noreply.github.com> Co-authored-by: Roberto Pastor Muela <37798125+RobPasMue@users.noreply.github.com> --------- Co-authored-by: Revathy Venugopal <104772255+Revathyvenugopal162@users.noreply.github.com> Co-authored-by: Roberto Pastor Muela <37798125+RobPasMue@users.noreply.github.com>
1 parent ac227cc commit e9a051b

35 files changed

+306
-229
lines changed

doc/source/coding-style/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ formatting with the libraries for the "big three" data science packages: `NumPy`
2525
The purpose of this section is not to repeat coding style documentation
2626
but rather to describe coding best practices applicable to the `PyAnsys`_ project when there are any
2727
delineations, clarifications, or additional procedures above and
28-
beyond `PEP 8`_. For example, this section provides a topic on deprecation
28+
beyond PEP 8. For example, this section provides a topic on deprecation
2929
best practices because there is no official guidance on deprecating features
3030
within Python.
3131

doc/source/coding-style/pep8.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ PEP 8
22
=====
33

44
This section summarizes important coding style guidelines from `PEP 8`_
5-
and how they apply to PyAnsys libraries. The Python community devised `PEP 8`_
5+
and how they apply to PyAnsys libraries. The Python community devised PEP 8
66
to increase the readability of Python code. Some of the most popular
7-
packages within the Python ecosystem have adopted `PEP 8`_,
7+
packages within the Python ecosystem have adopted PEP 8,
88
including `NumPy`_, `SciPy`_, and `pandas`_.
99

1010
Imports
@@ -177,7 +177,7 @@ global rules to determine the correct names:
177177
Variables
178178
~~~~~~~~~
179179

180-
Do not use the characters ``"l"`, ``"O"``, or ``"I"`` as single-character
180+
Do not use the characters ``"l"``, ``"O"``, or ``"I"`` as single-character
181181
variable names. In some fonts, these characters are indistinguishable from the
182182
numerals one and zero.
183183

@@ -424,7 +424,7 @@ letter.
424424
Here are general guidelines for writing comments:
425425

426426
- Always try to explain yourself in code by making it
427-
self-documenting with clear variable names.
427+
self-documenting with clear variable names.
428428
- Don't be redundant.
429429
- Don't add obvious noise.
430430
- Don't use closing brace comments.

doc/source/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
from sphinx_gallery.sorting import FileNameSortKey
1717

1818
# Project information
19-
project = "PyAnsys Developer's Guide"
19+
project = "PyAnsys developer's guide"
2020
copyright = f"(c) {datetime.now().year} ANSYS, Inc. All rights reserved"
2121
author = "Ansys Inc."
2222
release = version = datetime.now().strftime("%Y-%m-%d")
24.8 KB
Loading

doc/source/content-writing/content-how-tos/add-sphinx-extensions.rst

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,9 @@ template, the ``extensions`` variable lists these extensions by default:
2323
Extensions with names beginning with ``sphinx_ext`` are native (built-in) and are
2424
available for Sphinx's use without any additional installation. Extensions with names
2525
that do not begin with ``sphinx_ext`` are external extensions and require installation.
26-
If an extension is not configured properly, attempts to build the documentation fail
27-
because Sphinx cannot find the needed extension.
26+
If a non-native extension is not installed but added to the :file:`conf.py` file in the
27+
``doc/source`` directory, attempts to build the documentation fail because Sphinx cannot
28+
find the needed extension.
2829

2930
.. _links_to_objects_in_other_doc:
3031

@@ -131,9 +132,16 @@ the external `sphinx-design <Sphinx_ext_sphinx_design_>`_ extension for use:
131132

132133
python -m pip install <external-extension-name>
133134

134-
For example, to install the external ``sphinx-design`` extension, run this command::
135+
Examples follow for some of the external extensions mentioned in this
136+
documentation.
137+
138+
- To install the external ``sphinx-design`` extension, run this command::
139+
140+
python -m pip install sphinx-design
135141

136-
python -m pip install sphinx-design
142+
- To install the external ``sphinx_toolbox.collapse`` extension, run this command::
143+
144+
python -m pip install sphinx_toolbox.collapse
137145

138146
#. Add the external extension to the ``extensions`` variable in your project's
139147
:file:`conf.py` file.
@@ -151,8 +159,8 @@ building the documentation. Depending on the project's configuration, you list t
151159
packages in either the :file:`pyproject.toml` file or the :file:`requirements_doc_txt`
152160
file.
153161

154-
``pyproject.toml`` file
155-
~~~~~~~~~~~~~~~~~~~~~~~
162+
The ``pyproject.toml`` file
163+
~~~~~~~~~~~~~~~~~~~~~~~~~~~
156164

157165
Most projects specify documentation requirements in a :file:`pyproject.toml` file, which
158166
resides in the root folder. In this file, the ``doc`` variable defines the required ``pip``
@@ -183,8 +191,8 @@ packages and their versions like this.
183191
"vtk==9.2.6",
184192
]
185193
186-
``requirements_doc_txt`` file
187-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
194+
The ``requirements_doc_txt`` file
195+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
188196

189197
Some projects specify documentation requirements in a :file:`requirements_doc_txt`
190198
file. The root folder of such a project typically has a ``requirements`` directory
@@ -213,14 +221,16 @@ Learn more about extensions
213221
---------------------------
214222

215223
As you can see, PyAnsys projects add many extensions to their :file:`conf.py` files
216-
and documentation requirements. Here are some additional extensions that you might see:
224+
and documentation requirements. Here are some other native and non-native extensions
225+
that you might see:
217226

218227
- ``sphinx.ext.coverage``
219228
- ``sphinx.ext.doctest``
220229
- ``sphinx.ext.extlinks``
221230
- ``sphinx.ext.graphviz``
222231
- ``sphinx.ext.napoleon``
223232
- ``sphinx.ext.viewcode``
233+
- ``sphinx_toolbox.collapse``
224234

225235
For more information on extensions, see `Extensions <Sphinx_extensions_>`_ in the
226236
Sphinx documentation. In addition to the external (third-party) extensions collected

doc/source/content-writing/content-how-tos/resolve-issues-causing-check-failures.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ and lines where you must resolve them.
2828

2929
Your objective should always be to eliminate or mitigate issues before creating
3030
or pushing changes to a PR. For example, running ``pre-commit`` and Vale locally
31-
allows you to proactively resolve typos and trailing whitespaces. However,
31+
lets you proactively resolve typos and trailing whitespaces. However,
3232
oftentimes, you must resolve issues that cause the checks run by the CI/CD
3333
process to fail.
3434

doc/source/content-writing/content-how-tos/view-revision-history.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
View revision history on GitHub
44
===============================
55

6-
GitHub *blame* is a feature that allows you to view the revision history of a
6+
GitHub *blame* is a feature that lets you view the revision history of a
77
file in a repository to see who made changes and when these changes were
88
made. You can use the GitHub blame feature for a variety of use cases, including
99
these:

doc/source/content-writing/content-how-tos/work-around-Vale.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Work around Vale issues
66
Some issues that Vale raises may not be considered problematic in PyAnsys
77
projects. This page describes some common workarounds.
88

9-
Turn Vale on and off
9+
Turn Vale off and on
1010
--------------------
1111

1212
If Vale flags content as an issue but you know that this content is
@@ -19,10 +19,10 @@ before the flagged content and then back on again after it::
1919

2020
.. vale on
2121

22-
As shown in the preceding example , you must insert blank lines to separate the
23-
directives for tuning Vale off and off from your documentation content.
22+
As shown in the preceding example, you must insert blank lines to separate the
23+
directives for tuning Vale off and on from your documentation content.
2424

25-
In an MD file, the syntax for these two Vale directives looks like this::
25+
In an Markdown (MD) file, the syntax for these two Vale directives looks like this::
2626

2727
<!-- vale off -->
2828

doc/source/content-writing/examples-writers/index.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
Content in examples
44
===================
55

6-
Many PyAnsys libraries have an "Example" section. The `sphinx_gallery <Sphinx_ext_sphinx_gallery_>`_
7-
extension (Sphinx-Gallery) are typically used to generate standalone, downloadable Python scripts
6+
Many PyAnsys libraries have an "Example" section. The `Sphinx-Gallery <Sphinx_ext_sphinx_gallery_>`_
7+
extension (``sphinx_gallery``) is typically used to generate standalone, downloadable Python scripts
88
(PY files) or Jupyter notebooks (IPYNB files) that you can run. However, some
99
PyAnsys libraries use the `nbsphinx <Sphinx_nbsphinx_extension_>`_ extension,
1010
which is specifically designed for working with and integrating Jupyter notebooks

doc/source/content-writing/py-files-writers/docstring-format-rules.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,7 @@ back to them as needed:
446446
- Enclose all code entities in double backticks. If you surround a code entity in only a single
447447
backtick (:code:`\``), it is incorrectly rendered in italics in the documentation.
448448

449-
- Use the present tense for verbs. Occurrences of ``will`` cause `Vale <Vale_>`_ to
449+
- Use the present tense for verbs. Occurrences of ``will`` cause `Vale`_ to
450450
raise warnings about not using phrases expressing future actions.
451451

452452
- When documenting variable length positional or keyword arguments, leave the leading single

0 commit comments

Comments
 (0)