Skip to content

Add a formatting step using mdformat as part of generate_mkdocs.py#10484

Merged
charliermarsh merged 4 commits intoastral-sh:mainfrom
augustelalande:mdformat-rule-docs
Mar 21, 2024
Merged

Add a formatting step using mdformat as part of generate_mkdocs.py#10484
charliermarsh merged 4 commits intoastral-sh:mainfrom
augustelalande:mdformat-rule-docs

Conversation

@augustelalande
Copy link
Copy Markdown
Contributor

Summary

The purpose of this change is mainly to address one of the issues outlined in #10427. Namely, some lists in the docs were not rendering properly when preceded by a text block without a newline character. This PR adds mdformat as a final step to the rule documentation script, so that any missing newlines will be added.

NB: The default behavior of mdformat is to escape markdown special characters found in text such as <. This resulted in some misformatted docs. To address this I implemented an ad-hoc mdformat plugin to override the behavior. This may be considered a bit 'hacky', but I think it's a good solution. Nevertheless, if someone has a better idea, let me know.

Test Plan

This change is hard to test systematically, however, I tried my best to look at the before and after diffs to ensure no unwanted changes were made to the docs.

@zanieb zanieb self-assigned this Mar 20, 2024
@zanieb zanieb added the documentation Improvements or additions to documentation label Mar 20, 2024
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 20, 2024

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

Formatter (stable)

✅ ecosystem check detected no format changes.

Formatter (preview)

✅ ecosystem check detected no format changes.

Copy link
Copy Markdown
Member

@charliermarsh charliermarsh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@charliermarsh charliermarsh enabled auto-merge (squash) March 21, 2024 00:30
@charliermarsh charliermarsh merged commit a5f41e8 into astral-sh:main Mar 21, 2024
@augustelalande augustelalande deleted the mdformat-rule-docs branch March 21, 2024 00:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants