Skip to content

Commit 0a7a8b5

Browse files
author
Micah Scott @ MongoDB
authored
DRIVERS-3010 reformat specs for improved mkdocs rendering (#1678)
* mdformat: bump mdformat to version 0.7.18 * mdformat: add mdformat-mkdocs plugin (enforcing 4-space indent) * mkdocs: add superfences extension, to fix indented fenced code * mkdocs: add arithmatex (and MathJax) for math mode support * mkdocs: add escapeall extension to fix rendering of escaped angle brackets * mkdocs: enable markdown footnote support * mkdocs: add extra.css rules to improve table and list readability * ci: git diff when pre-commit fails, so that mdformat disagreements are visible in the log * readme: suggest installing dependencies from requirements.txt * tag all fenced code blocks with a language (mkdocs leaves hljs configured to guess a language, not leave untagged code unformatted) * use code blocks for code more, especially to avoid unintended math mode * convert remaining unclosed div elements to closed span * additional manual indentation fixes
1 parent 24817a5 commit 0a7a8b5

File tree

94 files changed

+5428
-5300
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

94 files changed

+5428
-5300
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ Please complete the following before merging:
66
- [ ] Make sure there are generated JSON files from the YAML test files.
77
- [ ] Test changes in at least one language driver.
88
- [ ] Test these changes against all server versions and topologies (including standalone, replica set, sharded
9-
clusters, and serverless).
9+
clusters, and serverless).
1010

1111
<!-- See also: https://wiki.corp.mongodb.com/pages/viewpage.action?pageId=80806719 -->

.github/workflows/lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
- name: "Run pre-commit"
1818
run: |
1919
pip install -U -q pre-commit
20-
pre-commit run --all-files --hook-stage manual
20+
pre-commit run --all-files --hook-stage manual || (git diff; false)
2121
2222
mkdocs:
2323
runs-on: ubuntu-latest

.pre-commit-config.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,16 @@ repos:
2323
stages: [manual]
2424

2525
- repo: https://github.com/executablebooks/mdformat
26-
rev: 0.7.17
26+
rev: 0.7.18
2727
hooks:
2828
- id: mdformat
2929
args: ["--wrap=120", "--number"]
3030
additional_dependencies:
31-
[mdformat-gfm, mdformat-frontmatter, mdformat-footnote, mdformat-gfm-alerts]
31+
- mdformat-footnote
32+
- mdformat-frontmatter
33+
- mdformat-gfm
34+
- mdformat-gfm-alerts
35+
- mdformat-mkdocs~=3.0
3236

3337
- repo: local
3438
hooks:

LICENSE.md

Lines changed: 150 additions & 148 deletions
Large diffs are not rendered by default.

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,11 @@ entire test with a note (e.g. *Removed*).
4646

4747
## Building Documents
4848

49-
We use [mkdocs](https://www.mkdocs.org/) to render the documentation. To see a live view of the documentation, run:
49+
We use [mkdocs](https://www.mkdocs.org/) to render the documentation. To see a live view of the documentation, in a
50+
Python [venv](https://docs.python.org/3/library/venv.html) run:
5051

5152
```bash
52-
pip install mkdocs
53+
pip install -r source/requirements.txt
5354
mkdocs serve
5455
```
5556

mkdocs.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,19 @@ nav:
44
- 'index.md'
55
markdown_extensions:
66
- admonition
7+
- footnotes
8+
- pymdownx.superfences
9+
- pymdownx.arithmatex
10+
- pymdownx.escapeall
711
- toc:
812
permalink:
913
plugins:
1014
- gh-admonitions
1115
validation:
1216
absolute_links: warn
1317
unrecognized_links: warn
14-
anchors: warn
18+
anchors: warn
19+
extra_javascript:
20+
- 'https://cdn.jsdelivr.net/npm/mathjax@2/MathJax.js?config=TeX-AMS_CHTML'
21+
extra_css:
22+
- extra.css

scripts/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ python3 scripts/migrate_to_md.py "source/<path_to_rst_file>"
3131
- Ensure that the generated markdown file is properly formatted.
3232

3333
- Ensure that the links in the new file are working, by running `pre-commit run markdown-link-check` and addressing
34-
failures until that passes.
34+
failures until that passes.
3535

3636
- Remove the rst file using `git rm`.
3737

source/atlas-data-lake-testing/tests/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,4 +67,4 @@ configuration and execute a ping command. Repeat this test using SCRAM-SHA-256.
6767
- 2022-10-05: Add spec front matter
6868

6969
- 2020-07-15: Link to CRUD test runner implementation and note that the collection under test must not be dropped before
70-
each test.
70+
each test.

0 commit comments

Comments
 (0)