generated from executablebooks/mdformat-plugin
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #44 from KyleKing/fix-admon-22
- Loading branch information
Showing
27 changed files
with
586 additions
and
109 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
# Answer file maintained by Copier for: https://github.com/KyleKing/mdformat-plugin-template | ||
# DO NOT MODIFY THIS FILE. Edit by re-running copier and changing responses to the questions | ||
# Check into version control. | ||
_commit: 1.0.2 | ||
_commit: 1.1.4 | ||
_src_path: gh:KyleKing/mdformat-plugin-template | ||
author_email: [email protected] | ||
author_name: Kyle King | ||
|
@@ -13,4 +13,5 @@ plugin_name: mkdocs | |
repository_namespace: kyleking | ||
repository_provider: https://github.com | ||
repository_url: https://github.com/kyleking/mdformat-mkdocs | ||
sync_admon_factories: true | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,12 @@ | ||
--- | ||
name: CI | ||
|
||
"on": | ||
push: | ||
branches: [main] | ||
tags: [v*] | ||
pull_request: null | ||
|
||
jobs: | ||
pre-commit: | ||
runs-on: ubuntu-latest | ||
|
@@ -15,6 +17,7 @@ jobs: | |
with: | ||
python-version: 3.12 | ||
- uses: pre-commit/[email protected] | ||
|
||
tests: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
|
@@ -30,22 +33,20 @@ jobs: | |
- name: Installation (deps and package) | ||
# We install with flit --pth-file, so that coverage will be recorded for the module | ||
# Flit could be installed with pipx and use '--python=$(which python)', but | ||
# there are issues with the Windows Runner | ||
# there were issues with the Windows Runner | ||
run: | | ||
pip install flit~=3.9 | ||
pip install flit~=3.10.1 | ||
flit install --deps=production --extras=test --pth-file | ||
- name: Run pytest | ||
run: | | ||
pytest --cov=$(ls | grep "mdformat_" | head) --cov-report=xml --cov-report=term-missing | ||
# Not currently configured | ||
# - name: Upload to Codecov | ||
# if: matrix.os == 'ubuntu-latest' && matrix.python-version == 3.12 | ||
# uses: codecov/codecov-action@v1 | ||
pytest --cov | ||
# # Not currently configured | ||
# - name: Report coverage | ||
# if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.12' | ||
# uses: codecov/codecov-action@v4 | ||
# with: | ||
# name: pytests-py3.12 | ||
# flags: pytests | ||
# file: ./coverage.xml | ||
# fail_ci_if_error: true | ||
# token: ${{ secrets.CODECOV_TOKEN }} | ||
|
||
pre-commit-hook: | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
@@ -61,6 +62,7 @@ jobs: | |
- name: run pre-commit with plugin | ||
run: | | ||
pre-commit run --config .pre-commit-test.yaml --all-files --verbose --show-diff-on-failure | ||
publish: | ||
name: Publish to PyPi | ||
needs: [pre-commit, tests, pre-commit-hook] | ||
|
@@ -74,7 +76,7 @@ jobs: | |
uses: actions/checkout@v4 | ||
- name: install flit | ||
run: | | ||
pipx install flit~=3.9 | ||
pipx install flit~=3.10.1 | ||
- name: Build and publish | ||
run: | | ||
flit publish | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Admonition/Callout Factories | ||
|
||
This code is useful to format and render admonitions similar to Python Markdown's format | ||
|
||
If you are looking to add `mdformat` to your project to format a specific syntax, you will want to use one of the below plugins: | ||
|
||
- [`mdformat-admon`](https://github.com/KyleKing/mdformat-admon) | ||
- [`python-markdown` admonitions](https://python-markdown.github.io/extensions/admonition) | ||
- [`mdformat-mkdocs`](https://github.com/KyleKing/mdformat-mkdocs) | ||
- [MKDocs Admonitions](https://squidfunk.github.io/mkdocs-material/reference/admonitions) | ||
- [`mdformat-gfm-alerts`](https://github.com/KyleKing/mdformat-gfm-alerts) | ||
- Primarily supports [Github "Alerts"](https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax#alerts), but indirectly also supports | ||
- [Microsoft "Alerts"](https://learn.microsoft.com/en-us/contribute/content/markdown-reference#alerts-note-tip-important-caution-warning) | ||
- [Mozilla Callouts](https://developer.mozilla.org/en-US/docs/MDN/Writing_guidelines/Howto/Markdown_in_MDN#notes_warnings_and_callouts) | ||
- [`mdformat-obsidian`](https://github.com/KyleKing/mdformat-obsidian) | ||
- [Obsidian Callouts](https://help.obsidian.md/How+to/Use+callouts) | ||
|
||
However, directive-style admonition formats are not known to be supported by an existing mdformat plugin nor by the utility code in this directory as it exists today: | ||
|
||
- [node.js markdown-it-container](https://github.com/markdown-it/markdown-it-container) | ||
- [MyST](https://myst-parser.readthedocs.io/en/latest/syntax/roles-and-directives.html) | ||
- [Sphinx Directives](https://www.sphinx-doc.org/en/master/usage/restructuredtext/directives.html) | ||
- [reStructuredText](https://docutils.sourceforge.io/docs/ref/rst/directives.html#specific-admonitions) | ||
- [pymdown-extensions](https://facelessuser.github.io/pymdown-extensions/extensions/blocks/plugins/admonition) | ||
- [PyMDown](https://facelessuser.github.io/pymdown-extensions/extensions/blocks/plugins/admonition) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
from ._whitespace_admon_factories import ( | ||
AdmonitionData, | ||
admon_plugin_factory, | ||
new_token, | ||
parse_possible_whitespace_admon_factory, | ||
parse_tag_and_title, | ||
) | ||
|
||
__all__ = ( | ||
"AdmonitionData", | ||
"admon_plugin_factory", | ||
"new_token", | ||
"parse_possible_whitespace_admon_factory", | ||
"parse_tag_and_title", | ||
) |
Oops, something went wrong.