A MkDocs plugin that validates URL in rendered HTML files
Project description
mkdocs-htmlproofer-plugin 
A MkDocs plugin that validates URLs, including anchors, in rendered html files.
Installation
- Prerequisites
- Python >= 3.6
- MkDocs >= 0.17
- Install the package with pip:
pip install mkdocs-htmlproofer-plugin
- 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
pluginsentry in your config file yet, you'll likely also want to add thesearchplugin. MkDocs enables it by default if there is nopluginsentry set, but now you have to enable it explicitly.
To enable cross-page anchor validation, you must set use_directory_urls = False in mkdocs.yml:
use_directory_urls: False
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mkdocs-htmlproofer-plugin-0.6.0.tar.gz.
File metadata
- Download URL: mkdocs-htmlproofer-plugin-0.6.0.tar.gz
- Upload date:
- Size: 4.6 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
437e737085dac1aff75cbb8b139316d295dc7296885f6b311d8b9e122b31d04c
|
|
| MD5 |
171c79f05ad07f2d652a83cf7b619db4
|
|
| BLAKE2b-256 |
09f23a9137a1fc0145ce73e4a05472364f036fab770580855e0c18344931c61c
|
File details
Details for the file mkdocs_htmlproofer_plugin-0.6.0-py3-none-any.whl.
File metadata
- Download URL: mkdocs_htmlproofer_plugin-0.6.0-py3-none-any.whl
- Upload date:
- Size: 5.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8245f03b4abdd684bef1df0cd49774a0976fad256d5cec8a0d99d63dfbde6a32
|
|
| MD5 |
93426dc06fe86605279fa98bf72937a5
|
|
| BLAKE2b-256 |
68fd4526f060a9cc99c534d43e27be7395f76b2d867324c37ecb1ae321473ce8
|