Skip to content

Commit

Permalink
feat: restore mdformat-gfm dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
KyleKing committed Jan 30, 2024
1 parent a98730f commit 32cf4e1
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 181 deletions.
3 changes: 0 additions & 3 deletions mdformat_mkdocs/_copy_of_mdformat_gfm/__init__.py

This file was deleted.

152 changes: 0 additions & 152 deletions mdformat_mkdocs/_copy_of_mdformat_gfm/plugin.py

This file was deleted.

6 changes: 0 additions & 6 deletions mdformat_mkdocs/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
from mdformat.renderer.typing import Postprocess, Render
from mdformat_admon import RENDERERS as ADMON_RENDERS # type: ignore[import-untyped]

from ._copy_of_mdformat_gfm import GFM_POSTPROCESSORS, GFM_RENDERERS, gfm_update_mdit
from ._normalize_list import normalize_list as unbounded_normalize_list
from ._postprocess_inline import postprocess_inline
from .mdit_plugins import content_tabs_plugin, mkdocs_admon_plugin
Expand Down Expand Up @@ -44,9 +43,6 @@ def update_mdit(mdit: MarkdownIt) -> None:
False,
)

# HACK: Only temporary pending the mdformat-gfm release
gfm_update_mdit(mdit)


# A mapping from `RenderTreeNode.type` to a `Render` function that can
# render the given `RenderTreeNode` type. These override the default
Expand All @@ -56,7 +52,6 @@ def update_mdit(mdit: MarkdownIt) -> None:
"admonition_mkdocs_title": ADMON_RENDERS["admonition_title"],
"content_tab_mkdocs": ADMON_RENDERS["admonition"],
"content_tab_mkdocs_title": ADMON_RENDERS["admonition_title"],
**GFM_RENDERERS, # HACK: Only temporary pending the mdformat-gfm release
}


Expand All @@ -79,5 +74,4 @@ def check_if_align_semantic_breaks_in_lists() -> bool:
"bullet_list": normalize_list,
"inline": postprocess_inline,
"ordered_list": normalize_list,
**GFM_POSTPROCESSORS, # HACK: Only temporary pending the mdformat-gfm release
}
6 changes: 2 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,8 @@ requires-python = ">=3.8.4"
dependencies = [
"mdformat >= 0.7.16",
"mdformat-admon >= 2.0.1",
"more-itertools >= 10.2.0",
# "mdformat-gfm >= 0.4.0", TODO: Pending release (https://github.com/hukkin/mdformat-gfm/issues/31)
"markdown-it-py[linkify] >= 3.0.0 ", # HACK: Only temporary pending the mdformat-gfm release
"mdformat-tables >= 0.4.1", # HACK: Only temporary pending the mdformat-gfm release
"mdformat-gfm >= 0.3.6",
"more-itertools >= 10.2.0"
]
dynamic = ["version", "description"]

Expand Down
10 changes: 5 additions & 5 deletions tests/fixtures-semantic-indent.md
Original file line number Diff line number Diff line change
Expand Up @@ -258,9 +258,9 @@ Table
|:---------------|---------:|:---------------------|
| Name | 2| <!-- Comment --> |
.
| Label | Rating | Comment |
| :---- | -----: | :--------------- |
| Name | 2 | <!-- Comment --> |
| Label | Rating | Comment |
|:---------------|---------:|:---------------------|
| Name | 2| <!-- Comment --> |
.

Floating Link
Expand Down Expand Up @@ -306,8 +306,8 @@ Task List / Check List (WARN: escaping is prevented by mdformat-gfm. Tested by p
- [x] #739
- [ ] Add delight to the experience when all tasks are complete :tada:
.
- [x] #739
- [ ] Add delight to the experience when all tasks are complete :tada:
- \[x\] #739
- \[ \] Add delight to the experience when all tasks are complete :tada:
.

Footnotes (WARN: escaping is prevented by mdformat-gfm. Tested by py#-hook)
Expand Down
14 changes: 7 additions & 7 deletions tests/format/fixtures/text.md
Original file line number Diff line number Diff line change
Expand Up @@ -251,15 +251,15 @@ Nested semantic lines (https://github.com/KyleKing/mdformat-mkdocs/issues/7)
.


Table (with GFM formatting)
Table
.
| Label | Rating | Comment |
|:---------------|---------:|:---------------------|
| Name | 2| <!-- Comment --> |
.
| Label | Rating | Comment |
| :---- | -----: | :--------------- |
| Name | 2 | <!-- Comment --> |
| Label | Rating | Comment |
|:---------------|---------:|:---------------------|
| Name | 2| <!-- Comment --> |
.

Floating Link
Expand Down Expand Up @@ -300,13 +300,13 @@ Headings
###### \[h6\] The smallest heading
.

Task List / Check List (temporarily fixed with mdformat-gfm HACK)
Task List / Check List (WARN: escaping is prevented by mdformat-gfm. Tested by py#-hook)
.
- [x] #739
- [ ] Add delight to the experience when all tasks are complete :tada:
.
- [x] #739
- [ ] Add delight to the experience when all tasks are complete :tada:
- \[x\] #739
- \[ \] Add delight to the experience when all tasks are complete :tada:
.

Footnotes (WARN: escaping is prevented by mdformat-gfm. Tested by py#-hook)
Expand Down
4 changes: 2 additions & 2 deletions tests/pre-commit-test-numbered.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
list item 2
2. If you store artifacts in the
repository, you need to remember to
compile the application before every
commit.
compile the application before
every commit.
3. Compiled application.
6 changes: 4 additions & 2 deletions tests/test_wrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
# Content
- Test Testing Test Testing Test Testing
Test Testing Test Testing Test Testing
Test Testing Test Testing Test
Testing
- Test Testing Test Testing Test
Testing Test Testing Test Testing
Test Testing Test Testing Test
Expand Down Expand Up @@ -58,7 +59,8 @@
# Content
- Test Testing Test Testing Test Testing
Test Testing Test Testing Test Testing
Test Testing Test Testing Test
Testing
- Test Testing Test Testing Test
Testing Test Testing Test Testing
Test Testing Test Testing Test
Expand Down

0 comments on commit 32cf4e1

Please sign in to comment.