Skip to content

Commit 1b1ef4d

Browse files
authored
Merge branch 'master' into patch-1
2 parents 22cf638 + 6649229 commit 1b1ef4d

Some content is hidden

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

57 files changed

+308
-422
lines changed

.github/workflows/tests.yml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
push:
88
branches: [master]
99
tags:
10-
- 'v*'
10+
- "v[0-9]+.[0-9]+.[0-9]+*"
1111
pull_request:
1212
schedule:
1313
- cron: '0 0 * * 0' # every week
@@ -113,19 +113,19 @@ jobs:
113113
steps:
114114
- name: Checkout source
115115
uses: actions/checkout@v2
116-
- name: Set up Python 3.7
116+
- name: Set up Python 3.8
117117
uses: actions/setup-python@v2
118118
with:
119-
python-version: '3.7'
120-
- name: Build package
119+
python-version: '3.8'
120+
- name: install flit
121121
run: |
122-
pip install build
123-
python -m build
124-
- name: Publish
125-
uses: pypa/gh-action-pypi-publish@v1.1.0
126-
with:
127-
user: __token__
128-
password: ${{ secrets.PYPI_KEY }}
122+
pip install flit~=3.4
123+
- name: Build and publish
124+
run: |
125+
flit publish
126+
env:
127+
FLIT_USERNAME: __token__
128+
FLIT_PASSWORD: ${{ secrets.PYPI_KEY }}
129129

130130
allgood:
131131
runs-on: ubuntu-latest

.pre-commit-config.yaml

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -16,40 +16,31 @@ exclude: >
1616
repos:
1717

1818
- repo: https://github.com/pre-commit/pre-commit-hooks
19-
rev: v3.4.0
19+
rev: v4.2.0
2020
hooks:
2121
- id: check-json
2222
- id: check-yaml
2323
- id: end-of-file-fixer
2424
- id: trailing-whitespace
2525

26-
- repo: https://github.com/mgedmin/check-manifest
27-
rev: "0.46"
26+
- repo: https://github.com/pycqa/isort
27+
rev: 5.10.1
2828
hooks:
29-
- id: check-manifest
30-
args: [--no-build-isolation]
31-
additional_dependencies: [setuptools>=46.4.0]
32-
33-
# this is not used for now,
34-
# since it converts markdown-it-py to markdown_it_py and removes comments
35-
# - repo: https://github.com/asottile/setup-cfg-fmt
36-
# rev: v1.17.0
37-
# hooks:
38-
# - id: setup-cfg-fmt
29+
- id: isort
3930

4031
- repo: https://github.com/psf/black
41-
rev: 20.8b1
32+
rev: 22.3.0
4233
hooks:
4334
- id: black
4435

4536
- repo: https://gitlab.com/pycqa/flake8
46-
rev: 3.9.1
37+
rev: 3.9.2
4738
hooks:
4839
- id: flake8
4940
additional_dependencies: [flake8-bugbear==21.3.1]
5041

5142
- repo: https://github.com/pre-commit/mirrors-mypy
52-
rev: v0.812
43+
rev: v0.942
5344
hooks:
5445
- id: mypy
5546
additional_dependencies: [attrs]

MANIFEST.in

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

benchmarking/bench_core.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from pathlib import Path
2+
23
import pytest
34

45
import markdown_it

benchmarking/bench_packages.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
from pathlib import Path
2-
import pytest
32
from shutil import which
43

4+
import pytest
5+
56

67
@pytest.fixture
78
def spec_text():

docs/_static/custom.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
.code-cell > .highlight > pre {
2+
border-left-color: green;
3+
border-left-width: medium;
4+
border-left-style: solid;
5+
}

docs/architecture.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
# markdown-it design principles
44

5+
(md/data-flow)=
56
## Data flow
67

78
Input data is parsed via nested chains of rules. There are 3 nested chains -
@@ -157,10 +158,9 @@ renderer override, but can be more simple.
157158
You also can write your own renderer to generate other formats than HTML, such as
158159
JSON/XML... You can even use it to generate AST.
159160

160-
161161
## Summary
162162

163-
This was mentioned in [Data flow](#data-flow), but let's repeat sequence again:
163+
This was mentioned in [Data flow](md/data-flow), but let's repeat sequence again:
164164

165165
1. Blocks are parsed, and top level of token stream filled with block tokens.
166166
2. Content on inline containers is parsed, filling `.children` properties.

docs/conf.py

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,25 +33,25 @@
3333
"sphinx.ext.autodoc",
3434
"sphinx.ext.viewcode",
3535
"sphinx.ext.intersphinx",
36-
"myst_nb",
36+
"myst_parser",
3737
"sphinx_copybutton",
38-
"sphinx_panels",
38+
"sphinx_design",
3939
]
4040

41-
# Add any paths that contain templates here, relative to this directory.
42-
templates_path = ["_templates"]
43-
4441
# List of patterns, relative to source directory, that match files and
4542
# directories to ignore when looking for source files.
4643
# This pattern also affects html_static_path and html_extra_path.
4744
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
4845

46+
nitpicky = True
4947
nitpick_ignore = [
5048
("py:class", "Match"),
49+
("py:class", "Path"),
5150
("py:class", "x in the interval [0, 1)."),
5251
("py:class", "markdown_it.helpers.parse_link_destination._Result"),
5352
("py:class", "markdown_it.helpers.parse_link_title._Result"),
5453
("py:class", "MarkdownIt"),
54+
("py:class", "RuleFunc"),
5555
("py:class", "_NodeType"),
5656
("py:class", "typing_extensions.Protocol"),
5757
]
@@ -70,7 +70,8 @@
7070
"repository_branch": "master",
7171
"path_to_docs": "docs",
7272
}
73-
panels_add_boostrap_css = False
73+
html_static_path = ["_static"]
74+
html_css_files = ["custom.css"]
7475

7576
# Add any paths that contain custom static files (such as style sheets) here,
7677
# relative to this directory. They are copied after the builtin static files,
@@ -91,6 +92,7 @@ def run_apidoc(app):
9192
"""
9293
import os
9394
import shutil
95+
9496
import sphinx
9597
from sphinx.ext import apidoc
9698

@@ -100,7 +102,7 @@ def run_apidoc(app):
100102
this_folder = os.path.abspath(os.path.dirname(os.path.realpath(__file__)))
101103
api_folder = os.path.join(this_folder, "api")
102104
module_path = os.path.normpath(os.path.join(this_folder, "../"))
103-
ignore_paths = ["../setup.py", "../conftest.py", "../tests", "../benchmarking"]
105+
ignore_paths = ["../profiler.py", "../conftest.py", "../tests", "../benchmarking"]
104106
ignore_paths = [
105107
os.path.normpath(os.path.join(this_folder, p)) for p in ignore_paths
106108
]
@@ -120,6 +122,7 @@ def run_apidoc(app):
120122

121123
argv = ["-M", "--separate", "-o", api_folder, module_path] + ignore_paths
122124

125+
apidoc.OPTIONS.append("ignore-module-all")
123126
apidoc.main(argv)
124127

125128
# we don't use this
@@ -131,3 +134,17 @@ def setup(app):
131134
"""Add functions to the Sphinx setup."""
132135
if os.environ.get("SKIP_APIDOC", None) is None:
133136
app.connect("builder-inited", run_apidoc)
137+
138+
from sphinx.directives.code import CodeBlock
139+
140+
class CodeCell(CodeBlock):
141+
"""Custom code block directive."""
142+
143+
def run(self):
144+
"""Run the directive."""
145+
self.options["class"] = ["code-cell"]
146+
return super().run()
147+
148+
# note, these could be run by myst-nb,
149+
# but currently this causes a circular dependency issue
150+
app.add_directive("code-cell", CodeCell)

docs/contributing.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ It can be setup by:
2929
Editors like VS Code also have automatic code reformat utilities, which can adhere to this standard.
3030

3131
All functions and class methods should be annotated with types and include a docstring.
32-
The preferred docstring format is outlined in `markdown-it-py/docstring.fmt.mustache` and can be used automatically with the [autodocstring](https://marketplace.visualstudio.com/items?itemName=njpwerner.autodocstring) VS Code extension.
3332

3433
## Testing
3534

docstring.fmt.mustache

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

0 commit comments

Comments
 (0)