Skip to content

Commit d54b172

Browse files
authored
Make various documentation related updates.
* Document various policies which we have already been following: * Document release notes in Contributing Guide. * Add some additional notes regarding issues and PRs to contributing guide. * Comment on Commonmark on frontpage of docs (in Goals). * Autolink to issues in release notes using mdx_gh_links. Also abandon the `doc-requirements.txt` file for a `docs` entry in `pyproject.toml` under `[project.optional-dependencies]`. We are now consistently defining optional dependencies project-wide. Note that the dependencies can be installed with `pip install .[docs]`. * Update development environment documentation. * Set min version of mkdocs theme.
1 parent ff88261 commit d54b172

File tree

9 files changed

+113
-22
lines changed

9 files changed

+113
-22
lines changed

.github/workflows/deploy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
- name: Install dependencies
4040
run: |
4141
python -m pip install --upgrade pip setuptools
42-
python -m pip install -r doc-requirements.txt
42+
python -m pip install .[docs]
4343
- name: Build
4444
run: |
4545
python -m mkdocs build --clean --verbose

.github/workflows/manual_deploy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
- name: Install dependencies
1717
run: |
1818
python -m pip install --upgrade pip setuptools
19-
python -m pip install -r doc-requirements.txt
19+
python -m pip install .[docs]
2020
- name: Build
2121
run: |
2222
python -m mkdocs build --clean --verbose

.spell-dict

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ CLI
2222
CodeHilite
2323
codehilite
2424
Cogumbreiro
25+
CommonMark
2526
convertFile
2627
CSS
2728
dedent

doc-requirements.txt

Lines changed: 0 additions & 2 deletions
This file was deleted.

docs/contributing.md

Lines changed: 85 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,16 @@ library. Keeping new feature requests implemented as third party extensions
5656
allows us to keep the maintenance overhead of Python-Markdown to a minimum, so
5757
that the focus can be on continued stability, bug fixes, and documentation.
5858

59-
Closing an issue does not necessarily mean the end of a discussion. If you
60-
believe your issue has been closed incorrectly, explain why and we'll consider
61-
if it needs to be reopened.
59+
If you intend to submit a fix for your bug or provide an implementation of your
60+
feature request, it is not necessary to first open an issue. You can report a
61+
bug or make a feature request as part of a pull request. Of course, if you want
62+
to receive feedback on how to implement a bug-fix or feature before submitting
63+
a solution, then it would be appropriate to open an issue first and ask your
64+
questions there.
65+
66+
Having your issue closed does not necessarily mean the end of a discussion. If
67+
you believe your issue has been closed incorrectly, explain why and we'll
68+
consider if it needs to be reopened.
6269

6370
## Pull Requests
6471

@@ -99,6 +106,12 @@ GitHub interface to ensure that all tests are running as expected. If any checks
99106
fail, you may push additional commits to your branch. GitHub will add those
100107
commits to the pull request and rerun the checks.
101108

109+
It is generally best not to squash multiple commits and force-push your changes
110+
to a pull request. Instead, the maintainers would like to be able to follow the
111+
series of commits along with the discussion about those changes as they
112+
progress over time. If your pull request is accepted, it will be squashed at
113+
that time if deemed appropriate.
114+
102115
## Style Guides
103116

104117
In an effort to maintain consistency, Python-Markdown adheres to the following
@@ -224,6 +237,34 @@ Python-Markdown's [Admonition Extension]:
224237
This is the content of the note.
225238
```
226239

240+
#### Release Notes
241+
242+
Any commit/pull request which changes the behavior of the Markdown library in
243+
any way must include an entry in the release notes. If a change only alters the
244+
documentation or tooling for the project, then an entry in the release notes is
245+
not necessary. The release notes can be found at `docs/change_log`.
246+
247+
Each release must have an entry in `docs/change_log/index.md` which follows the
248+
format of the existing entries. A MAJOR release (`X.0.0`) and a MINOR release
249+
(`X.X.0`) should only include a single line in `docs/change_log/index.md` which
250+
links to a full document outlining all changes included in the release.
251+
However, a PATCH release (X.X.X) should include a list of single line entries
252+
summarizing each change directly in the file `docs/change_log/index.md` (see
253+
[Versions](#versions) for an explanation of MAJOR, MINOR, and PATCH releases).
254+
The description of each change should include a reference to the relevant
255+
GitHub issue in the format `#123` (where `123` is the issue number).
256+
257+
Prior to a version being released, the text `*under development*` should be
258+
used as a placeholder for the release date. That text will be replaced with the
259+
release date as part of the [release process](#release-process).
260+
261+
If a change is the first since the last release, then the appropriate entries
262+
and/or files may need to be created and included in a pull request. A pull
263+
request should not alter an entry for an existing version which has already
264+
been released, unless it is editing an error in the release notes for that
265+
version, or is otherwise expressly deemed appropriate by the project
266+
maintainers.
267+
227268
### Commit Message Style Guide
228269

229270
Use the present tense ("Add feature" not "Added feature").
@@ -280,7 +321,7 @@ working copy into the environment in [Development Mode] after activating the
280321
virtual environment for the first time:
281322

282323
```sh
283-
pip install --editable .
324+
pip install -e .
284325
```
285326

286327
Now any saved changes will immediately be available within the virtual
@@ -292,29 +333,63 @@ You can run the command line script with the following command:
292333
python -m markdown
293334
```
294335

336+
Before building the documentation for the first time, you will need to install
337+
some optional dependencies with the command:
338+
339+
```sh
340+
pip install -e .[docs]
341+
```
342+
343+
To build the documentation and serve it locally on a development server, run:
344+
345+
```sh
346+
mkdocs serve
347+
```
348+
349+
Then point your browser at `http://127.0.0.1:8000/`. For a complete list of
350+
options available, view MkDocs' help with the command:
351+
352+
```sh
353+
mkdocs --help
354+
```
355+
356+
Before running tests for the first time, you will need to install some optional
357+
dependencies with the command:
358+
359+
```sh
360+
pip install -e .[testing]
361+
```
362+
295363
And you can directly run the tests with:
296364

297365
```sh
298366
python -m unittest discover tests
299367
```
300368

369+
To get a coverage report after running the tests, use these commands instead:
370+
371+
```sh
372+
coverage run --source=markdown -m unittest discover tests
373+
coverage report --show-missing
374+
```
375+
301376
!!! note
302377

303378
Some tests require the [PyTidyLib] library, which depends on the [HTML Tidy]
304379
library. If you do not have PyTidyLib installed, the tests which depend upon
305380
it will be skipped. Given the difficulty in installing the HTML Tidy library
306381
on many systems, you may choose to leave both libraries uninstalled and
307-
depend on the Travis server to run those tests when you submit a pull
308-
request.
382+
depend on the continuous integration server to run those tests when you
383+
submit a pull request.
309384

310385
The above setup will only run tests against the code in one version of Python.
311386
However, Python-Markdown supports multiple versions of Python. Therefore, a
312387
[tox] configuration is included in the repository, which includes test
313388
environments for all supported Python versions, a [Flake8] test environment, and
314389
a spellchecker for the documentation. While it is generally fine to leave those
315-
tests for the Travis server to run when a pull request is submitted, for more
316-
advanced changes, you may want to run those tests locally. To do so, simply
317-
install tox:
390+
tests for the continuous integration server to run when a pull request is
391+
submitted, for more advanced changes, you may want to run those tests locally.
392+
To do so, simply install tox:
318393

319394
```sh
320395
pip install tox
@@ -337,7 +412,7 @@ with no arguments. See help (`tox -h`) for more options.
337412

338413
!!! seealso "See Also"
339414

340-
Python-Markdown provides [test tools] which simply testing Markdown syntax.
415+
Python-Markdown provides [test tools] which simply test Markdown syntax.
341416
Understanding those tools will often help in understanding why a test may be
342417
failing.
343418

docs/index.md

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,23 @@ The Python-Markdown project is developed with the following goals in mind:
2121
* Maintain a Python library (with an optional CLI wrapper) suited to use in web
2222
server environments (never raise an exception, never write to stdout, etc.) as
2323
an implementation of the markdown parser that follows the
24-
[syntax rules](https://daringfireball.net/projects/markdown/syntax) and the
25-
behavior of the original (markdown.pl) implementation as reasonably as
26-
possible (see [differences](#differences) for a few exceptions).
24+
[syntax rules][] and the behavior of the original (markdown.pl)
25+
implementation as reasonably as possible (see [differences](#differences) for
26+
a few exceptions).
2727

2828
* Provide an [Extension API](extensions/api.md) which makes it possible
2929
to change and/or extend the behavior of the parser.
3030

31+
!!! Note
32+
33+
*This is not a CommonMark implementation*; nor is it trying to be!
34+
Python-Markdown was developed long before the CommonMark specification was
35+
released and has always (mostly) followed the [syntax rules][] and behavior
36+
of the original reference implementation. No accommodations have been made
37+
to address the changes which CommonMark has suggested. It is recommended
38+
that you look elsewhere if you want an implementation which follows the
39+
CommonMark specification.
40+
3141
Features
3242
--------
3343

@@ -91,7 +101,7 @@ are summarized below:
91101
In the event that one would prefer different behavior,
92102
[tab_length](reference.md#tab_length) can be set to whatever length is
93103
desired. Be warned however, as this will affect indentation for all aspects
94-
of the syntax (including root level code blocks). Alternatively, a
104+
of the syntax (including root level code blocks). Alternatively, a
95105
[third party extension] may offer a solution that meets your needs.
96106

97107
* __Consecutive Lists__
@@ -109,4 +119,5 @@ Support
109119
You may report bugs, ask for help, and discuss various other issues on the [bug tracker][].
110120

111121
[third party extension]: https://github.com/Python-Markdown/markdown/wiki/Third-Party-Extensions
122+
[syntax rules]: https://daringfireball.net/projects/markdown/syntax
112123
[bug tracker]: https://github.com/Python-Markdown/markdown/issues

mkdocs.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,3 +62,6 @@ markdown_extensions:
6262
- codehilite
6363
- toc:
6464
permalink: true
65+
- mdx_gh_links:
66+
user: Python-Markdown
67+
repo: markdown

pyproject.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,11 @@ testing = [
5252
'coverage',
5353
'pyyaml',
5454
]
55+
docs = [
56+
'mkdocs>=1.0',
57+
'mkdocs-nature>=0.4',
58+
'mdx_gh_links>=0.2'
59+
]
5560

5661
[project.urls]
5762
'Homepage' = 'https://Python-Markdown.github.io/'

tox.ini

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,8 @@ commands = flake8 {toxinidir}/markdown {toxinidir}/tests
2626
skip_install = true
2727

2828
[testenv:checkspelling]
29-
deps =
30-
mkdocs
31-
mkdocs_nature
32-
pyspelling
29+
extras = docs
30+
deps = pyspelling
3331
commands =
3432
{envpython} -m mkdocs build --strict --config-file {toxinidir}/mkdocs.yml
3533
{envpython} -m pyspelling --config {toxinidir}/.pyspelling.yml

0 commit comments

Comments
 (0)