Spellcheck your docs using a LanguageTool server
Project description
MkDocs LanguageTool Plugin
This is currently a prototype. It aims to provide high quality spell checking for your documentation.
Installation
Install it with pip:
pip install mkdocs-languagetool-plugin
Usage
First as with all MkDocs plugins, add it to your mkdocs.yml:
plugins:
- search
- languagetool
In addition to adding the plugin to your docs, you need to run (or specify) a languagetool server.
Local languagetool server with docker
You can easily do this with docker:
docker run --rm -it -p 8081:8010 --name mkdocs-languagetool -e Java_Xmx=2g -d erikvl87/languagetool
After you are done, you can stop the languagetool container:
docker stop mkdocs-languagetool
Remote languagetool server
This can for example be useful if your company / network has a shared languagetool server running somewhere.
You can specify it like this in your mkdocs.yml:
plugins:
- search
- languagetool:
languagetool_host: YOUR_SERVERS_IP_OR_HOSTNAME
Conditional spell checking
Spellchecking causes a lot of CPU load and slows down site builds.
So you may want to only run it at certain times (like before creating a new release).
This can be done using environment variables that enable or disable the plugin.
For example you could use the following snippet in your mkdocs.yml:
plugins:
- search
- languagetool:
enabled: !ENV [SPELLCHECK, false]
languagetool_url: http://YOUR_SERVERS_IP_OR_HOSTNAME:8081/v2/check
Then a normal build (mkdocs build) would not enable the plugin.
But if you want to do the spell checking, you can set the SPELLCHECK variable:
SPELLCHECK=true mkdocs serve
Notable changes
Version 0.1.0
- Split
languagetool_urlintolanguagetool_protocol,languagetool_hostandlanguagetool_port. - Added option
custom_known_words_directoryto add known words to all or specific languages. - Added option
languagetool_docker_imageto overwrite which docker image (or tag) to use. - Added option
write_unknown_words_to_fileto automatically generate a list of unknown / potentially misspelled words. - Added options to ignore specific files (
ignore_files) and specific spelling rules (ignore_rules). - Added support for automatically starting the LanguageTool server via docker (
start_languagetoolsetting). - Added parallelized spell checking (via
async_threads) and enabled it by default.
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_languagetool_plugin-0.1.0.tar.gz.
File metadata
- Download URL: mkdocs_languagetool_plugin-0.1.0.tar.gz
- Upload date:
- Size: 8.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.13.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
750bc2219184c4d696c15c5e885dfc435bc44f155963e03d5098c8e3eeec7a5b
|
|
| MD5 |
be4ffd267dfa977c57ec49dccb9f26d8
|
|
| BLAKE2b-256 |
556a9c4fb96fddd040618603509829efd4faf07411536690744b4ff7f5504070
|
File details
Details for the file mkdocs_languagetool_plugin-0.1.0-py3-none-any.whl.
File metadata
- Download URL: mkdocs_languagetool_plugin-0.1.0-py3-none-any.whl
- Upload date:
- Size: 9.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.13.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
91457f810cdcece3c4b32b5b849e969d0d69c98a3756158838451c302d7ce0d8
|
|
| MD5 |
8ca992357d31bd964870c905af22c10e
|
|
| BLAKE2b-256 |
f0c902dc2e5741ee3ff2239c80c70246020109dde5123844b4ecd1d484f079b0
|