Skip to content

Commit 04bca45

Browse files
authored
chore(ci): checking links and spell checking (#417)
* chore(ci): checking links and spell checking * chore(ci): move markdown-link-check to GitHub ci Because pre-commit.ci does not have access to the internet... * fix(lib): revert `reverse-...` utils because of warnings * chore(ci): checking links and spell checking * chore(ci): move markdown-link-check to GitHub ci Because pre-commit.ci does not have access to the internet... * fix(docs): myst-parser xref cannot end with .html * fix(docs): oops
1 parent 4e7abe8 commit 04bca45

File tree

24 files changed

+134
-44
lines changed

24 files changed

+134
-44
lines changed

.bumpversion.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[bumpversion]
22
current_version = 5.1.4
33
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(-rc(?P<release>\d+))?
4-
serialize =
4+
serialize =
55
{major}.{minor}.{patch}-rc{release}
66
{major}.{minor}.{patch}
77
commit = True
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
"""Check that GitHub issues (and PR) links match the number in Markdown link."""
2+
3+
import glob
4+
import re
5+
import sys
6+
7+
if __name__ == "__main__":
8+
p = re.compile(
9+
r"\[#(?P<number1>[0-9]+)\]"
10+
r"\(https://github\.com/"
11+
r"(?:[a-zA-Z0-9_-]+)/(?:[a-zA-Z0-9_-]+)/"
12+
r"(?:(?:issues)|(?:pull))/(?P<number2>[0-9]+)\)"
13+
)
14+
15+
ret_code = 0
16+
17+
for glob_pattern in sys.argv[1:]:
18+
for file in glob.glob(glob_pattern, recursive=True):
19+
with open(file) as f:
20+
for i, line in enumerate(f):
21+
for m in p.finditer(line):
22+
if m.group("number1") != m.group("number2"):
23+
start, end = m.span()
24+
print(f"{file}:{i}: ", line[start:end], file=sys.stderr) # noqa: T201
25+
ret_code = 1
26+
27+
sys.exit(ret_code)

.github/workflows/tests.yml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646
if: matrix.os == 'windows-latest'
4747
run: echo "${HOME}/.local/bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
4848

49-
# OS depedencies
49+
# OS dependencies
5050
- name: Install manim dependencies on MacOS
5151
if: matrix.os == 'macos-latest'
5252
run: brew install ffmpeg py3cairo
@@ -86,3 +86,16 @@ jobs:
8686
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
8787
with:
8888
fail_ci_if_error: true
89+
90+
markdown-link-check:
91+
runs-on: ubuntu-latest
92+
steps:
93+
- name: Checkout repository
94+
uses: actions/checkout@v4
95+
96+
- name: Check links
97+
uses: gaurav-nelson/github-action-markdown-link-check@v1
98+
with:
99+
use-quiet-mode: yes
100+
use-verbose-mode: yes
101+
config-file: .mdlc.json

.mdlc.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"replacementPatterns": [
3+
{
4+
"pattern": "^/(?<path>.*)$",
5+
"replacement": "https://eertmans.be/manim-slides/latest/$<path>.html"
6+
}
7+
]
8+
}

.pre-commit-config.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,17 @@ repos:
2929
hooks:
3030
- id: mypy
3131
additional_dependencies: [types-requests, types-setuptools]
32+
- repo: https://github.com/codespell-project/codespell
33+
rev: v2.2.6
34+
hooks:
35+
- id: codespell
36+
additional_dependencies:
37+
- tomli
38+
- repo: local
39+
hooks:
40+
- id: github-issues
41+
name: GitHub issues link check
42+
description: Check issues (and PR) links are matching number.
43+
entry: python .github/scripts/check_github_issues.py
44+
language: system
45+
types: [markdown]

CHANGELOG.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1010
(unreleased)=
1111
## [Unreleased](https://github.com/jeertmans/manim-slides/compare/v5.1.4...HEAD)
1212

13+
(unreleased-chore)=
14+
### Chore
15+
16+
- Added CI for broken HTML links and fixed, plus spell checking.
17+
[#417](https://github.com/jeertmans/manim-slides/pull/417)
18+
1319

1420
(v5.1.4)=
1521
## [v5.1.4](https://github.com/jeertmans/manim-slides/compare/v5.1.3...v5.1.4)
@@ -191,7 +197,7 @@ In an effort to better document changes, this CHANGELOG document is now created.
191197
but the new player should be much easier to maintain and more performant,
192198
than its predecessor.
193199
[#243](https://github.com/jeertmans/manim-slides/pull/243)
194-
- Changed the slide config format to exclude unecessary information.
200+
- Changed the slide config format to exclude unnecessary information.
195201
`StypeType` is removed in favor to one boolean `loop` field. This is
196202
a **breaking change** and one should re-render the slides to apply changes.
197203
[#243](https://github.com/jeertmans/manim-slides/pull/243)

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,15 @@ for detailed install instructions.
4949
Using Manim Slides is a two-step process:
5050
1. Render animations using `Slide` (resp. `ThreeDSlide`) as a base class instead
5151
of `Scene` (resp. `ThreeDScene`), and add calls to `self.next_slide()`
52-
everytime you want to create a new slide.
52+
every time you want to create a new slide.
5353
2. Run `manim-slides` on rendered animations and display them like a
5454
*PowerPoint* presentation.
5555

5656
The documentation is available [online](https://eertmans.be/manim-slides/).
5757

5858
### Basic Example
5959

60-
Call `self.next_slide()` everytime you want to create a pause between
60+
Call `self.next_slide()` every time you want to create a pause between
6161
animations, and `self.next_slide(loop=True)` if you want the next slide to loop
6262
over animations until the user presses continue:
6363

@@ -118,7 +118,7 @@ manim-slides BasicExample
118118
</p>
119119

120120
For detailed usage documentation, run `manim-slides --help`, or go to the
121-
[documentation](https://eertmans.be/manim-slides/reference/cli.html).
121+
[documentation](https://eertmans.be/manim-slides/latest/reference/cli.html).
122122

123123
## Interactive Tutorial
124124

@@ -170,7 +170,7 @@ in *Settings*->*Display*.
170170
## Contributing
171171

172172
Contributions are more than welcome! Please read through
173-
[our contributing section](https://eertmans.be/manim-slides/contributing/index.html).
173+
[our contributing section](https://eertmans.be/manim-slides/latest/contributing/index.html).
174174

175175
### Reporting an Issue
176176

docs/source/_static/template.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@
261261
mouseWheel: {{ mouse_wheel }},
262262

263263
// Opens links in an iframe preview overlay
264-
// Add `data-preview-link` and `data-preview-link="false"` to customise each link
264+
// Add `data-preview-link` and `data-preview-link="false"` to customize each link
265265
// individually
266266
previewLinks: {{ preview_links }},
267267

docs/source/contributing/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ workflow
1818
internals
1919
```
2020

21-
[Workflow](./workflow)
21+
[Workflow](/contributing/workflow)
2222
: how to work on this project. Start here if you're a new contributor.
2323

24-
[Internals](./internals)
24+
[Internals](/contributing/internals)
2525
: how Manim Slides is built and how the various parts of it work.
2626

2727
## Reporting an Issue

docs/source/contributing/workflow.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ Useful links:
1818
* [GitHub's Hello World](https://docs.github.com/en/get-started/quickstart/hello-world).
1919
* [GitHub Pull Request in 100 Seconds](https://www.youtube.com/watch?v=8lGpZkjnkt4&ab_channel=Fireship).
2020

21-
Once you feel comfortable with git and GitHub, [fork](https://github.com/jeertmans/manim-slides/fork) the repository, and clone it locally.
21+
Once you feel comfortable with git and GitHub,
22+
[fork](https://github.com/jeertmans/manim-slides/fork)
23+
the repository, and clone it locally.
2224

2325
As for every Python project, using virtual environment is recommended to avoid
2426
conflicts between modules.
@@ -36,7 +38,7 @@ pdm install
3638
This, however, only installs the minimal set of dependencies to run the package.
3739

3840
If you would like to install Manim or ManimGL,
39-
as documented in the [quickstart](../quickstart),
41+
as documented in the [quickstart](/quickstart),
4042
you can use the `-G|--group` option:
4143

4244
```bash
@@ -45,7 +47,7 @@ pdm install -Gmanim # For Manim
4547
pdm install -Gmanimgl # For ManimGL
4648
```
4749

48-
Additionnally, Manim Slides comes with groups of dependencies for development purposes:
50+
Additionally, Manim Slides comes with groups of dependencies for development purposes:
4951

5052
```bash
5153
pdm install -Gdev # For linters and formatters

0 commit comments

Comments
 (0)