Skip to main content

A MkDocs plugin that validates URL in rendered HTML files

Project description

mkdocs-htmlproofer-plugin PyPI - Version

GitHub Actions

A MkDocs plugin that validates URL in rendered html files

Installation

  1. Prerequisites
  • Python >= 3.6
  • MkDocs >= 0.17
  1. Install the package with pip:
pip install mkdocs-htmlproofer-plugin
  1. Enable the plugin in your mkdocs.yml:
plugins:
    - search
    - htmlproofer

Optionally, you may raise error and fail the build on bad url status.

plugins:
    - search
    - htmlproofer:
        raise_error: True

That can be switched off for combinations of urls ('*' means all urls) and status codes with raise_error_excludes.

plugins:
    - search
    - htmlproofer:
        raise_error: True
        raise_error_excludes: 
          504: ['https://www.mkdocs.org/']
          404: ['https://github.com/manuzhang/mkdocs-htmlproofer-plugin']
          400: ['*']

Note: If you have no plugins entry in your config file yet, you'll likely also want to add the search plugin. MkDocs enables it by default if there is no plugins entry set, but now you have to enable it explicitly.

More information about plugins in the MkDocs documentation

Acknowledgement

This work is based on the mkdocs-markdownextradata-plugin project and the Finding and Fixing Website Link Rot with Python, BeautifulSoup and Requests article.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mkdocs-htmlproofer-plugin-0.4.0.tar.gz (3.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mkdocs_htmlproofer_plugin-0.4.0-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

File details

Details for the file mkdocs-htmlproofer-plugin-0.4.0.tar.gz.

File metadata

  • Download URL: mkdocs-htmlproofer-plugin-0.4.0.tar.gz
  • Upload date:
  • Size: 3.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.10

File hashes

Hashes for mkdocs-htmlproofer-plugin-0.4.0.tar.gz
Algorithm Hash digest
SHA256 fbf14394d996246451172d3b7db10eb290e693d5d23046707ea65a1fb923162f
MD5 d17805ea336d645847f6c5c829d8973e
BLAKE2b-256 595f8443b897d68515824badf22723066cb69b9ce29cc765d4ad96a742a4bc74

See more details on using hashes here.

File details

Details for the file mkdocs_htmlproofer_plugin-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: mkdocs_htmlproofer_plugin-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 4.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.10

File hashes

Hashes for mkdocs_htmlproofer_plugin-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 926c1948c3fa516f777d7137c126de6462eba272405096ddae8acf33939019bb
MD5 b4751c4be16fc91077b57bcae34cfcff
BLAKE2b-256 23052fcd3763f45417aab90e5fe607dad192071eae2a0d6e064df0b48e18c948

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page