Skip to content

Commit 368dc6a

Browse files
authored
Merge branch 'master' into no-attrdict
2 parents c391f1b + c14b8fa commit 368dc6a

Some content is hidden

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

43 files changed

+742
-216
lines changed

.flake8

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

.github/workflows/tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,10 @@ jobs:
6161
steps:
6262
- name: Checkout source
6363
uses: actions/checkout@v2
64-
- name: Set up Python 3.7
64+
- name: Set up Python
6565
uses: actions/setup-python@v2
6666
with:
67-
python-version: 3.7
67+
python-version: 3.8
6868
- name: Build package
6969
run: |
7070
pip install wheel

.mypy.ini

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

.pre-commit-config.yaml

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,22 +20,37 @@ repos:
2020
- id: trailing-whitespace
2121

2222
- repo: https://github.com/mgedmin/check-manifest
23-
rev: "0.44"
23+
rev: "0.46"
2424
hooks:
2525
- id: check-manifest
26+
args: [--no-build-isolation]
27+
additional_dependencies: [setuptools>=46.4.0]
28+
29+
# this is not used for now,
30+
# since it converts mdit-py-plugins to mdit_py_plugins and removes comments
31+
# - repo: https://github.com/asottile/setup-cfg-fmt
32+
# rev: v1.17.0
33+
# hooks:
34+
# - id: setup-cfg-fmt
35+
36+
- repo: https://github.com/timothycrosley/isort
37+
rev: 5.8.0
38+
hooks:
39+
- id: isort
2640

2741
- repo: https://github.com/psf/black
2842
rev: 20.8b1
2943
hooks:
3044
- id: black
3145

3246
- repo: https://gitlab.com/pycqa/flake8
33-
rev: 3.8.4
47+
rev: 3.9.1
3448
hooks:
3549
- id: flake8
50+
additional_dependencies: [flake8-bugbear==21.3.1]
3651

3752
- repo: https://github.com/pre-commit/mirrors-mypy
38-
rev: v0.790
53+
rev: v0.812
3954
hooks:
4055
- id: mypy
41-
additional_dependencies: [markdown-it-py>=0.6.0]
56+
additional_dependencies: [markdown-it-py~=1.0]

.readthedocs.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
version: 2
2+
3+
python:
4+
version: 3
5+
install:
6+
- method: pip
7+
path: .
8+
extra_requirements: [rtd]
9+
10+
sphinx:
11+
builder: html
12+
fail_on_warning: true

CHANGELOG.md

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

3+
## 0.2.8 - 2021-05-03
4+
5+
🐛 FIX: `wordcount` update of minutes
6+
7+
## 0.2.7 - 2021-05-03
8+
9+
- ⬆️ UPDATE: markdown-it-py~=1.0
10+
- ✨ NEW: Add `wordcount_plugin`
11+
- 👌 IMPROVE: `dollarmath`: Allow inline double-dollar
12+
- 👌 IMPROVE: `myst_blocks`: Parse multiline comments
13+
- 👌 IMPROVE: Replace use of `env` as an `AttrDict`
14+
- 🐛 FIX: `front_matter`: don't duplicate content storage in `Token.meta`
15+
316
## 0.2.6 - 2021-03-17
417

518
👌 IMPROVE: Remove direct use of `Token.attrs`

MANIFEST.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
exclude docs
2+
recursive-exclude docs *
13
exclude tests
24
recursive-exclude tests *
35

docs/conf.py

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
project = "mdit-py-plugins"
2+
copyright = "2020, Executable Book Project"
3+
author = "Executable Book Project"
4+
5+
master_doc = "index"
6+
7+
extensions = [
8+
"sphinx.ext.autodoc",
9+
"sphinx.ext.viewcode",
10+
"sphinx.ext.intersphinx",
11+
"myst_parser",
12+
]
13+
14+
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
15+
16+
intersphinx_mapping = {
17+
"python": ("https://docs.python.org/3.8", None),
18+
"markdown_it": ("https://markdown-it-py.readthedocs.io/en/latest", None),
19+
}
20+
21+
html_title = "mdit-py-plugins"
22+
html_theme = "sphinx_book_theme"
23+
html_theme_options = {
24+
"single_page": True,
25+
"use_edit_page_button": True,
26+
"repository_url": "https://github.com/executablebooks/mdit-py-plugins",
27+
"repository_branch": "master",
28+
"path_to_docs": "docs",
29+
}

docs/index.md

Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
# Markdown-It-Py Plugin Extensions
2+
3+
## Built-in
4+
5+
The following plugins are embedded within the core package:
6+
7+
- [tables](https://help.github.com/articles/organizing-information-with-tables/) (GFM)
8+
- [strikethrough](https://help.github.com/articles/basic-writing-and-formatting-syntax/#styling-text) (GFM)
9+
10+
These can be enabled individually:
11+
12+
```python
13+
from markdown_it import MarkdownIt
14+
md = MarkdownIt("commonmark").enable('table')
15+
```
16+
17+
or as part of a configuration:
18+
19+
```python
20+
from markdown_it import MarkdownIt
21+
md = MarkdownIt("gfm-like")
22+
```
23+
24+
```{seealso}
25+
See [](markdown_it:using)
26+
```
27+
28+
## mdit-py-plugins package
29+
30+
The [`mdit_py_plugins`](https://github.com/executablebooks/mdit-py-plugins), contains a number of common plugins.
31+
They can be chained and loaded *via*:
32+
33+
```python
34+
from markdown_it import MarkdownIt
35+
from mdit_py_plugins import plugin1, plugin2
36+
md = MarkdownIt().use(plugin1, keyword=value).use(plugin2, keyword=value)
37+
html_string = md.render("some *Markdown*")
38+
```
39+
40+
## Front-Matter
41+
42+
```{eval-rst}
43+
.. autofunction:: mdit_py_plugins.front_matter.front_matter_plugin
44+
```
45+
46+
## Footnotes
47+
48+
```{eval-rst}
49+
.. autofunction:: mdit_py_plugins.footnote.footnote_plugin
50+
```
51+
52+
## Definition Lists
53+
54+
```{eval-rst}
55+
.. autofunction:: mdit_py_plugins.deflist.deflist_plugin
56+
```
57+
58+
## Task lists
59+
60+
```{eval-rst}
61+
.. autofunction:: mdit_py_plugins.tasklists.tasklists_plugin
62+
```
63+
64+
## Heading Anchors
65+
66+
```{eval-rst}
67+
.. autofunction:: mdit_py_plugins.anchors.anchors_plugin
68+
```
69+
70+
## Word Count
71+
72+
```{eval-rst}
73+
.. autofunction:: mdit_py_plugins.wordcount.wordcount_plugin
74+
```
75+
76+
## Containers
77+
78+
```{eval-rst}
79+
.. autofunction:: mdit_py_plugins.container.container_plugin
80+
```
81+
82+
## Math
83+
84+
```{eval-rst}
85+
.. autofunction:: mdit_py_plugins.texmath.texmath_plugin
86+
```
87+
88+
```{eval-rst}
89+
.. autofunction:: mdit_py_plugins.dollarmath.dollarmath_plugin
90+
```
91+
92+
```{eval-rst}
93+
.. autofunction:: mdit_py_plugins.amsmath.amsmath_plugin
94+
```
95+
96+
## MyST plugins
97+
98+
`myst_blocks` and `myst_role` plugins are also available, for utilisation by the [MyST renderer](https://myst-parser.readthedocs.io/en/latest/using/syntax.html)
99+
100+
```{eval-rst}
101+
.. autofunction:: mdit_py_plugins.myst_role.myst_role_plugin
102+
.. autofunction:: mdit_py_plugins.myst_blocks.myst_block_plugin
103+
```
104+
105+
## Write your own
106+
107+
Use the `mdit_py_plugins` as a guide to write your own, following the [markdown-it design principles](markdown_it:architecture).
108+
109+
There are many other plugins which could easily be ported from the JS versions (and hopefully will):
110+
111+
- [subscript](https://github.com/markdown-it/markdown-it-sub)
112+
- [superscript](https://github.com/markdown-it/markdown-it-sup)
113+
- [abbreviation](https://github.com/markdown-it/markdown-it-abbr)
114+
- [emoji](https://github.com/markdown-it/markdown-it-emoji)
115+
- [insert](https://github.com/markdown-it/markdown-it-ins)
116+
- [mark](https://github.com/markdown-it/markdown-it-mark)
117+
- ... and [others](https://www.npmjs.org/browse/keyword/markdown-it-plugin)

mdit_py_plugins/__init__.py

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

0 commit comments

Comments
 (0)