Skip to main content

A MkDocs plugin that validates URL in rendered HTML files

Project description

mkdocs-htmlproofer-plugin PyPI - Version

A MkDocs plugin that validates URL in rendered html files

Installation

  1. Prerequisites
  • Python >= 3.5
  • 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.3.0.tar.gz (3.2 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.3.0-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: mkdocs-htmlproofer-plugin-0.3.0.tar.gz
  • Upload date:
  • Size: 3.2 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.3.0.tar.gz
Algorithm Hash digest
SHA256 6c45c3101701ef3a48a5deef28596717d102042e7da405fd504798d95412821f
MD5 9dd98e9e9bd92295dd9520e3bdd1123e
BLAKE2b-256 66777614bd792580363bc312bfeac202ee3d2997a542ccfbcebfb6497436d5e5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mkdocs_htmlproofer_plugin-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 4.9 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.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 45b4f7d2b7d0ba2f79b228beff16a50508e8539d3f9e4d39f278ff78ebd11da6
MD5 534cededd0e125c1a8af3e351312639e
BLAKE2b-256 9e6f1ad1923a032f5d018961c10653bbb693732c74c49df8f6e82ac4cdc1921f

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