Check links for Markdown-based site
Project description
Linkchecker for Markdown-based static generated sites
Blazing-fast Python asyncio / aiohttp based simple check of links in Markdown .md files only. This tool is very helpful for large Markdown-based Jekyll and Hugo sites. It is very fast and simple--it's what we use to check https://www.scivision.dev
Install
for latest release:
python -m pip install linkcheckmd
or for latest development version.
git clone https://github.com/scivision/linkchecker-markdown
pip install -e linkchecker-markdown
Usage
The static site generator does NOT have to be running for these tests--it looks at the .md files directly. The examples assume webpage Markdown files have top-level directory ~/web.
This program may be invoked by either:
linkcheckMarkdown
or
python -m linkcheckmd
-
Jekyll
python -m linkcheckmd ~/web/_posts
-
Hugo
python -m linkcheckmd ~/web/content
The -v
--verbose
options prints the URLs as they are checked.
Observe that URLs from different markdown files are interleaved, showing the asynchronous nature of this program.
Benchmark
For benchmarking and reference, we include a synchronous Requests-based method. For a website with 100+ pages, compare times of:
Git precommit
See ./examples/pre-commit script for a Git hook pre-commit Python script.
Alternatives
Strict anti-leeching methods can cause false positives with this and other link checking programs.
Alternative solutions include:
- asyncio-based web browser interface like Arsenic
- Go-based htmltest.
- GitHub Action for checking links in Markdown files.
- Netlify link-check plugin
- LinkChecker.py: too many false positives/negatives, very slow and only works with HTML.
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
File details
Details for the file linkcheckmd-1.2.1.tar.gz
.
File metadata
- Download URL: linkcheckmd-1.2.1.tar.gz
- Upload date:
- Size: 9.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/2.0.0 pkginfo/1.6.0 requests/2.24.0 setuptools/50.3.0.post20201103 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d2eff0f4329ab3f479bec7e3e6e55f39c3721ac67b480183571f06f9435f12a6 |
|
MD5 | a26a11242adf08248de52f8bb89568c0 |
|
BLAKE2b-256 | 623879af628d4ac292b94ffc7294e64083e9efc9b15b0772e3395fee9d5c5fac |