Skip to content

Commit 93fbf64

Browse files
authored
πŸš€ Release v0.5.0 (#126)
To comply with markdown-it-py v4.0.0, and drops Python 3.9, which is EoL next month <https://devguide.python.org/versions>
1 parent 91264a6 commit 93fbf64

File tree

21 files changed

+58
-41
lines changed

21 files changed

+58
-41
lines changed

β€Ž.github/workflows/tests.ymlβ€Ž

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ jobs:
1818

1919
steps:
2020
- uses: actions/checkout@v4
21-
- name: Set up Python 3.8
21+
- name: Set up Python
2222
uses: actions/setup-python@v5
2323
with:
24-
python-version: 3.8
24+
python-version: "3.10"
2525
- uses: pre-commit/action@v3.0.1
2626

2727
tests:
@@ -30,7 +30,7 @@ jobs:
3030
strategy:
3131
fail-fast: false
3232
matrix:
33-
python-version: ['pypy-3.8', '3.8', '3.9', '3.10', '3.11', '3.12']
33+
python-version: ['pypy-3.10', '3.10', '3.11', '3.12', '3.13']
3434

3535
steps:
3636
- uses: actions/checkout@v4
@@ -46,13 +46,13 @@ jobs:
4646
run: |
4747
pytest --cov=mdit_py_plugins --cov-report=xml --cov-report=term-missing
4848
- name: Upload to Codecov
49-
uses: codecov/codecov-action@v3
49+
uses: codecov/codecov-action@v5
5050
if: github.event.pull_request.head.repo.full_name == github.repository
5151
with:
5252
token: ${{ secrets.CODECOV_TOKEN }}
5353
name: mdit-py-plugins-pytests
5454
flags: pytests
55-
file: ./coverage.xml
55+
files: ./coverage.xml
5656
fail_ci_if_error: true
5757

5858
allgood:
@@ -75,7 +75,7 @@ jobs:
7575
- name: Set up Python
7676
uses: actions/setup-python@v5
7777
with:
78-
python-version: "3.8"
78+
python-version: "3.10"
7979
- name: install flit
8080
run: |
8181
pip install flit~=3.4

β€Ž.pre-commit-config.yamlβ€Ž

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,22 @@ exclude: >
1212
repos:
1313

1414
- repo: https://github.com/pre-commit/pre-commit-hooks
15-
rev: v4.6.0
15+
rev: v6.0.0
1616
hooks:
1717
- id: check-json
1818
- id: check-yaml
1919
- id: end-of-file-fixer
2020
- id: trailing-whitespace
2121

2222
- repo: https://github.com/astral-sh/ruff-pre-commit
23-
rev: v0.4.4
23+
rev: v0.12.8
2424
hooks:
2525
- id: ruff
2626
args: [--fix]
2727
- id: ruff-format
2828

2929
- repo: https://github.com/pre-commit/mirrors-mypy
30-
rev: v1.10.0
30+
rev: v1.17.1
3131
hooks:
3232
- id: mypy
3333
additional_dependencies: [markdown-it-py~=3.0]

β€Ž.readthedocs.ymlβ€Ž

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ version: 2
33
build:
44
os: ubuntu-22.04
55
tools:
6-
python: "3.8"
6+
python: "3.10"
77

88
python:
99
install:
@@ -12,5 +12,6 @@ python:
1212
extra_requirements: [rtd]
1313

1414
sphinx:
15+
configuration: docs/conf.py
1516
builder: html
1617
fail_on_warning: true

β€ŽCHANGELOG.mdβ€Ž

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Change Log
22

3+
## 0.5.0 - 2025-08-11
4+
5+
- ⬆️ Drop Python 3.9, which is EoL next month <https://devguide.python.org/versions> and allow for the, soon to be released, markdown-it-py v4.
6+
- ✨ NEW: Add plugin & tests to render subscripts, thanks to @miteshashar
7+
38
## 0.4.2 - 2024-09-09
49

510
- πŸ‘Œ Improve parsing of nested amsmath

β€Žmdit_py_plugins/__init__.pyβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "0.4.2"
1+
__version__ = "0.5.0"

β€Žmdit_py_plugins/admon/index.pyβ€Ž

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22

33
from __future__ import annotations
44

5+
from collections.abc import Callable, Sequence
56
from contextlib import suppress
67
import re
7-
from typing import TYPE_CHECKING, Callable, Sequence
8+
from typing import TYPE_CHECKING
89

910
from markdown_it import MarkdownIt
1011
from markdown_it.rules_block import StateBlock

β€Žmdit_py_plugins/amsmath/__init__.pyβ€Ž

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22

33
from __future__ import annotations
44

5+
from collections.abc import Callable, Sequence
56
import re
6-
from typing import TYPE_CHECKING, Callable, Sequence
7+
from typing import TYPE_CHECKING
78

89
from markdown_it import MarkdownIt
910
from markdown_it.common.utils import escapeHtml

β€Žmdit_py_plugins/anchors/index.pyβ€Ž

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1+
from collections.abc import Callable
12
import re
2-
from typing import Callable, List, Optional, Set
33

44
from markdown_it import MarkdownIt
55
from markdown_it.rules_core import StateCore
@@ -10,7 +10,7 @@ def anchors_plugin(
1010
md: MarkdownIt,
1111
min_level: int = 1,
1212
max_level: int = 2,
13-
slug_func: Optional[Callable[[str], str]] = None,
13+
slug_func: Callable[[str], str] | None = None,
1414
permalink: bool = False,
1515
permalinkSymbol: str = "ΒΆ",
1616
permalinkBefore: bool = False,
@@ -58,15 +58,15 @@ def anchors_plugin(
5858

5959

6060
def _make_anchors_func(
61-
selected_levels: List[int],
61+
selected_levels: list[int],
6262
slug_func: Callable[[str], str],
6363
permalink: bool,
6464
permalinkSymbol: str,
6565
permalinkBefore: bool,
6666
permalinkSpace: bool,
6767
) -> Callable[[StateCore], None]:
6868
def _anchor_func(state: StateCore) -> None:
69-
slugs: Set[str] = set()
69+
slugs: set[str] = set()
7070
for idx, token in enumerate(state.tokens):
7171
if token.type != "heading_open":
7272
continue
@@ -119,7 +119,7 @@ def slugify(title: str) -> str:
119119
return re.sub(r"[^\w\u4e00-\u9fff\- ]", "", title.strip().lower().replace(" ", "-"))
120120

121121

122-
def unique_slug(slug: str, slugs: Set[str]) -> str:
122+
def unique_slug(slug: str, slugs: set[str]) -> str:
123123
uniq = slug
124124
i = 1
125125
while uniq in slugs:

β€Žmdit_py_plugins/attrs/index.pyβ€Ž

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
from __future__ import annotations
22

3+
from collections.abc import Sequence
34
from functools import partial
4-
from typing import Any, Sequence
5+
from typing import Any
56

67
from markdown_it import MarkdownIt
78
from markdown_it.rules_block import StateBlock

β€Žmdit_py_plugins/attrs/parse.pyβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ class <- '.' name
2222

2323
from __future__ import annotations
2424

25+
from collections.abc import Callable
2526
from enum import Enum
2627
import re
27-
from typing import Callable
2828

2929

3030
class State(Enum):

0 commit comments

Comments
Β (0)