Skip to content

Commit

Permalink
Add a style guide for grammar to our style documentation (#49)
Browse files Browse the repository at this point in the history
* Add grammar style guide

* Add line length, additional guidelines

* Fix space after equation, rst warnings
  • Loading branch information
Michael-T-McCann authored Oct 22, 2021
1 parent 8029386 commit 27d01ab
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/source/functional.rst
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ An instance of :class:`.Functional`, ``f``, may provide three core operations.
* Proximal operator
- ``f.prox(v, lam)`` returns the result of the scaled proximal operator
at ``v`` with scale ``lam``.
- The proximal operator of a functional :math:`f : \mathbb{R}^n \to \mathbb{R}` is the mapping
- The proximal operator of a functional :math:`f : \mathbb{R}^n \to \mathbb{R}` is the mapping
:math:`\mathrm{prox}_f : \mathbb{R}^n \times \mathbb{R} \to \mathbb{R}^n` defined as

.. math::
Expand Down
2 changes: 1 addition & 1 deletion docs/source/op_linop.rst
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ we have


Defining A New Linear Operator
-----------------------------
------------------------------

To define a new linear operator,
pass a callable to the :class:`.LinearOperator` constructor
Expand Down
28 changes: 28 additions & 0 deletions docs/source/style.rst
Original file line number Diff line number Diff line change
Expand Up @@ -423,3 +423,31 @@ An example of this is complicated operations which most likely require a block o
i = i & (i-1) == 0: # true if i is 0 or a power of 2 [explains the concept not the code]
If a comment consists of one or more full sentences (as is typically the case for *block* comments), it should start with an upper case letter and end with a period. *Inline* comments often consist of a brief phrase which is not a full sentence, in which case they should have a lower case initial letter and not have a terminating period.

Documentation Pages
-------------------
Documentation that is separate from code (like this page)
should follow the
`IEEE Style Manual
<https://journals.ieeeauthorcenter.ieee.org/your-role-in-article-production/ieee-editorial-style-manual/>`_.
For additional grammar and usage guidance,
refer to `The Chicago Manual of Style <https://www.chicagomanualofstyle.org/>`_.
A few notable guidelines:

* Equations which conclude a sentence should end with a period,
e.g., "Poisson's equation is

.. math::
\Delta \varphi = f \;."
* Do not capitalize acronyms or inititalisms when defining them,
e.g., "computer-aided system engineering (CASE),"
"fast Fourier transform (FFT)."

* Avoid capitalization in text except where absolutely necessary,
e.g., "Newton’s first law."


The source code (`.rst` files) for these pages does not have a line-length guideline,
but line breaks at or before 79 characters are encouraged.

0 comments on commit 27d01ab

Please sign in to comment.