Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reformat markdown files with mdformat. (#185)
* Reformat markdown files with mdformat. * Move paper. * Fix quote.
- Loading branch information
1 parent
20f33e5
commit 071e373
Showing
14 changed files
with
125 additions
and
32 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
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
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
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
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
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 |
---|---|---|
|
@@ -23,3 +23,4 @@ Discussion | |
alex/index.rst | ||
github_actions/index.rst | ||
readthedocs/index.rst | ||
mdformat/index.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
.. _mdformat-discussion: | ||
|
||
Ensuring consistent markdown format with mdformat | ||
================================================= | ||
|
||
From the :code:`mdformat`'s `documentation page | ||
<https://mdformat.readthedocs.io/en/stable/>`_: | ||
|
||
.. pull-quote:: | ||
|
||
"Mdformat is an opinionated Markdown formatter that can be used to enforce a | ||
consistent style in Markdown files. Mdformat is a Unix-style command-line | ||
tool as well as a Python library." | ||
|
||
The rationale for using :code:`mdformat` is the same as the one for using | ||
:ref:`black <black-discussion>` which is to avoid spending any time thinking | ||
about the formatting of source files. | ||
|
||
Examples of choices that :code:`mdformat` will make: | ||
|
||
.. code-block:: md | ||
# Hello world | ||
Here is how to write some python code: | ||
print("Hello Nashpy!) | ||
become: | ||
|
||
.. code-block:: md | ||
# Hello world | ||
Here is how to write some python code: | ||
``` | ||
print("Hello Nashpy!) | ||
``` |
32 changes: 32 additions & 0 deletions
32
docs/contributing/how-to/how-to-format-markdown-files/index.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
How to format markdown files | ||
============================ | ||
|
||
The markdown files are all formatted according to a consistent style using | ||
`mdformat <https://mdformat.readthedocs.io/en/stable/>`_. | ||
|
||
How to install mdformat | ||
----------------------- | ||
|
||
To install :code:`mdformat` run:: | ||
|
||
$ python -m pip install mdformat | ||
|
||
How to format all markdown files | ||
-------------------------------- | ||
|
||
To run :code:`mdformat` on a specific :code:`<file>`:: | ||
|
||
$ python -m mdformat <file> | ||
|
||
This will reformat :code:`<file>` in place. | ||
|
||
To run :code:`mdformat` recursively from the current directory:: | ||
|
||
$ python -m mdformat . | ||
|
||
How to check markdown files | ||
--------------------------- | ||
|
||
To check the format of :code:`<file>`:: | ||
|
||
$ python -m mdformat --check <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
File renamed without changes.