From cf57a5084f9227a84f1e2b86a0b12ad06ab7af84 Mon Sep 17 00:00:00 2001 From: Waylan Limberg Date: Tue, 1 Oct 2024 11:21:48 -0400 Subject: [PATCH 1/3] fix broken links in docs --- docs/change_log/release-2.4.md | 2 +- docs/change_log/release-2.5.md | 2 +- docs/change_log/release-2.6.md | 4 ++-- docs/extensions/api.md | 3 ++- docs/extensions/md_in_html.md | 4 ++-- 5 files changed, 8 insertions(+), 7 deletions(-) diff --git a/docs/change_log/release-2.4.md b/docs/change_log/release-2.4.md index 1f4ab2390..7d5faa68b 100644 --- a/docs/change_log/release-2.4.md +++ b/docs/change_log/release-2.4.md @@ -50,7 +50,7 @@ What's New in Python-Markdown 2.4 Blocks] section for details. Thanks to [ryneeverett] for implementing this feature. -[Markdown Inside HTML Blocks]: ../extensions/extra.md#nested-markdown-inside-html-blocks +[Markdown Inside HTML Blocks]: ../extensions/md_in_html.md [ryneeverett]: https://github.com/ryneeverett * The code blocks now support emphasizing some of the code lines. To use this diff --git a/docs/change_log/release-2.5.md b/docs/change_log/release-2.5.md index 519f013b1..095f17d26 100644 --- a/docs/change_log/release-2.5.md +++ b/docs/change_log/release-2.5.md @@ -103,7 +103,7 @@ Backwards-incompatible Changes a string to the extension name will be deprecated in Python-Markdown version 2.6 and will raise a **`PendingDeprecationWarning`** in 2.5. The [`extension_configs`](../reference.md#extension_configs) keyword should - be used instead. See the [documentation](../reference.md#extension-configs) + be used instead. See the [documentation](../reference.md#extension_configs) for a full explanation of the current behavior. What's New in Python-Markdown 2.5 diff --git a/docs/change_log/release-2.6.md b/docs/change_log/release-2.6.md index f117eb8c5..3019e012a 100644 --- a/docs/change_log/release-2.6.md +++ b/docs/change_log/release-2.6.md @@ -137,7 +137,7 @@ The previously documented method of appending the extension configuration options as a string to the extension name is deprecated and will raise a **`DeprecationWarning`** in version 2.6 and an error in 2.7. The [`extension_configs`](../reference.md#extension_configs) keyword should be used -instead. See the [documentation](../reference.md#extension-configs) for a full +instead. See the [documentation](../reference.md#extension_configs) for a full explanation of the current behavior. ### HeaderId Extension Pending Deprecation @@ -214,7 +214,7 @@ Note the call to `super` to get the benefits of configuration handling from the parent class. See the [documentation][config] for more information. [config]: ../extensions/api.md#configsettings -[mext]: ../extensions/api.md#makeextension +[mext]: ../extensions/api.md#dot_notation ## What's New in Python-Markdown 2.6 diff --git a/docs/extensions/api.md b/docs/extensions/api.md index 56f825015..1cf18bb43 100644 --- a/docs/extensions/api.md +++ b/docs/extensions/api.md @@ -801,7 +801,7 @@ When `markdown.Markdown` is passed the "name" of your extension as a dot notatio (for example `path.to.module`), it will import the module and call the `makeExtension` function to initiate your extension. -## Registries +## Registries { #registry } The `markdown.util.Registry` class is a priority sorted registry which Markdown uses internally to determine the processing order of its various processors and patterns. @@ -884,3 +884,4 @@ assert someitem in registry [setuptools]: https://packaging.python.org/key_projects/#setuptools [Entry points]: https://setuptools.readthedocs.io/en/latest/setuptools.html#dynamic-discovery-of-services-and-plugins [Packaging and Distributing Projects]: https://packaging.python.org/tutorials/distributing-packages/ +[Inline Patterns]: #inline-patterns diff --git a/docs/extensions/md_in_html.md b/docs/extensions/md_in_html.md index 978f5c378..06a01d763 100644 --- a/docs/extensions/md_in_html.md +++ b/docs/extensions/md_in_html.md @@ -13,7 +13,7 @@ enabled, the content of a raw HTML block-level element can be parsed as Markdown on the opening tag. The `markdown` attribute will be stripped from the output, while all other attributes will be preserved. -The `markdown` attribute can be assigned one of three values: [`"1"`](#1), [`"block"`](#block), or [`"span"`](#span). +The `markdown` attribute can be assigned one of three values: [`"1"`](#markdown1), [`"block"`](#block), or [`"span"`](#span). !!! note @@ -21,7 +21,7 @@ The `markdown` attribute can be assigned one of three values: [`"1"`](#1), [`"bl according to the HTML specification. Whereas the `"span"` and `"block"` values assigned to the `markdown` attribute refer to the Markdown parser's behavior. -### `markdown="1"` { #1 } +### `markdown="1"` { #markdown1 } When the `markdown` attribute is set to `"1"`, then the parser will use the default behavior for that specific tag. From aa8192af4792eae9e10ece887d4ae2584abbd7b8 Mon Sep 17 00:00:00 2001 From: Waylan Limberg Date: Tue, 1 Oct 2024 11:30:40 -0400 Subject: [PATCH 2/3] update mkdocstring template overrides --- .../python/nature/{attribute.html => attribute.html.jinja} | 2 +- docs/templates/python/nature/{class.html => class.html.jinja} | 2 +- .../nature/docstring/{admonition.html => admonition.html.jinja} | 0 .../python/nature/{function.html => function.html.jinja} | 2 +- docs/templates/python/nature/{module.html => module.html.jinja} | 2 +- 5 files changed, 4 insertions(+), 4 deletions(-) rename docs/templates/python/nature/{attribute.html => attribute.html.jinja} (95%) rename docs/templates/python/nature/{class.html => class.html.jinja} (87%) rename docs/templates/python/nature/docstring/{admonition.html => admonition.html.jinja} (100%) rename docs/templates/python/nature/{function.html => function.html.jinja} (89%) rename docs/templates/python/nature/{module.html => module.html.jinja} (85%) diff --git a/docs/templates/python/nature/attribute.html b/docs/templates/python/nature/attribute.html.jinja similarity index 95% rename from docs/templates/python/nature/attribute.html rename to docs/templates/python/nature/attribute.html.jinja index 906d292b7..a40d6728c 100644 --- a/docs/templates/python/nature/attribute.html +++ b/docs/templates/python/nature/attribute.html.jinja @@ -1,4 +1,4 @@ -{% extends "_base/attribute.html" %} +{% extends "_base/attribute.html.jinja" %} {% block heading scoped %} ‹› diff --git a/docs/templates/python/nature/class.html b/docs/templates/python/nature/class.html.jinja similarity index 87% rename from docs/templates/python/nature/class.html rename to docs/templates/python/nature/class.html.jinja index dc8b58511..4cf19ec8d 100644 --- a/docs/templates/python/nature/class.html +++ b/docs/templates/python/nature/class.html.jinja @@ -1,4 +1,4 @@ -{% extends "_base/class.html" %} +{% extends "_base/class.html.jinja" %} {% block heading scoped %} ‹› diff --git a/docs/templates/python/nature/docstring/admonition.html b/docs/templates/python/nature/docstring/admonition.html.jinja similarity index 100% rename from docs/templates/python/nature/docstring/admonition.html rename to docs/templates/python/nature/docstring/admonition.html.jinja diff --git a/docs/templates/python/nature/function.html b/docs/templates/python/nature/function.html.jinja similarity index 89% rename from docs/templates/python/nature/function.html rename to docs/templates/python/nature/function.html.jinja index 9703647e5..8bbca47d8 100644 --- a/docs/templates/python/nature/function.html +++ b/docs/templates/python/nature/function.html.jinja @@ -1,4 +1,4 @@ -{% extends "_base/function.html" %} +{% extends "_base/function.html.jinja" %} {% block heading scoped %} ‹› diff --git a/docs/templates/python/nature/module.html b/docs/templates/python/nature/module.html.jinja similarity index 85% rename from docs/templates/python/nature/module.html rename to docs/templates/python/nature/module.html.jinja index 0b9b9f099..465ef1d9f 100644 --- a/docs/templates/python/nature/module.html +++ b/docs/templates/python/nature/module.html.jinja @@ -1,4 +1,4 @@ -{% extends "_base/module.html" %} +{% extends "_base/module.html.jinja" %} {% block heading scoped %} ‹› From 20fbaab85f5fda664e9d0a08882806f2a4e94a23 Mon Sep 17 00:00:00 2001 From: Waylan Limberg Date: Tue, 1 Oct 2024 12:01:30 -0400 Subject: [PATCH 3/3] Use mkdocs' builtin link checking --- .github/workflows/docs.yml | 21 --------------------- .github/workflows/tox.yml | 2 +- mkdocs.yml | 6 ++++++ pyproject.toml | 2 +- tox.ini | 6 +++--- 5 files changed, 11 insertions(+), 26 deletions(-) delete mode 100644 .github/workflows/docs.yml diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml deleted file mode 100644 index cd153d29b..000000000 --- a/.github/workflows/docs.yml +++ /dev/null @@ -1,21 +0,0 @@ -name: docs - -on: - pull_request: - branches: - - '**' - # Only run when changes are made to the docs. - paths: - - 'docs/**' - -jobs: - markdown-link-check: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: gaurav-nelson/github-action-markdown-link-check@v1 - with: - use-quiet-mode: yes - use-verbose-mode: yes - check-modified-files-only: yes - base-branch: master diff --git a/.github/workflows/tox.yml b/.github/workflows/tox.yml index 8f45e22e6..bf7e529d5 100644 --- a/.github/workflows/tox.yml +++ b/.github/workflows/tox.yml @@ -71,7 +71,7 @@ jobs: fail-fast: false max-parallel: 4 matrix: - tox-env: [flake8, pep517check, checkspelling] + tox-env: [flake8, pep517check, checklinks, checkspelling] env: TOXENV: ${{ matrix.tox-env }} diff --git a/mkdocs.yml b/mkdocs.yml index 51fbdd67c..92f6ccc80 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -52,6 +52,12 @@ nav: not_in_nav: | change_log/ +validation: + omitted_files: warn + absolute_links: warn + unrecognized_links: warn + anchors: warn + markdown_extensions: - extra - admonition diff --git a/pyproject.toml b/pyproject.toml index fa88f8318..088e242af 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -53,7 +53,7 @@ testing = [ 'pyyaml' ] docs = [ - 'mkdocs>=1.5', + 'mkdocs>=1.6', 'mkdocs-nature>=0.6', 'mdx_gh_links>=0.2', "mkdocstrings[python]", diff --git a/tox.ini b/tox.ini index d071054ea..31525091b 100644 --- a/tox.ini +++ b/tox.ini @@ -29,13 +29,13 @@ skip_install = true extras = docs deps = pyspelling commands = - {envpython} -m mkdocs build --strict --config-file {toxinidir}/mkdocs.yml + {envpython} -m mkdocs build --config-file {toxinidir}/mkdocs.yml {envpython} -m pyspelling --config {toxinidir}/.pyspelling.yml [testenv:checklinks] -whitelist_externals = markdown-link-check +extras = docs deps = -commands = {toxinidir}/checklinks.sh +commands = {envpython} -m mkdocs build --strict --config-file {toxinidir}/mkdocs.yml [testenv:pep517check] deps = pep517