plugin
¤
MkDocs SpellCheck package.
A spell checker plugin for MkDocs.
Classes:
Name | Description |
---|---|
SpellCheckPlugin | A |
Functions:
Name | Description |
---|---|
load_backend | Load the specified backend. |
SpellCheckPlugin()
¤
Bases: BasePlugin
A mkdocs
plugin.
This plugin defines the following event hooks:
on_config
on_page_content
Check the Developing Plugins page of mkdocs
for more information about its plugin system.
Methods:
Name | Description |
---|---|
on_config | Load words to ignore. |
on_page_content | Spell check everything. |
Source code in src/mkdocs_spellcheck/plugin.py
76 77 78 |
|
on_config(config: MkDocsConfig) -> MkDocsConfig | None
¤
Load words to ignore.
Hook for the on_config
event.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
config | MkDocsConfig | The MkDocs config object. | required |
Returns:
Type | Description |
---|---|
MkDocsConfig | None | The modified config. |
Source code in src/mkdocs_spellcheck/plugin.py
80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 |
|
on_page_content(html: str, page: Page, **kwargs: Any) -> None
¤
Spell check everything.
Hook for the on_page_content
event.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
html | str | The HTML text. | required |
page | Page | The page instance. | required |
**kwargs | Any | Additional arguments passed by MkDocs. | {} |
Source code in src/mkdocs_spellcheck/plugin.py
123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 |
|
load_backend(name: str) -> type[Backend]
¤
Load the specified backend.
This function imports the specified backend and returns its class. It is important not to import the backends at the top level, as they may not be installed.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name | str | The name of the backend to load. | required |
Returns:
Type | Description |
---|---|
type[Backend] | The backend class. |
Source code in src/mkdocs_spellcheck/plugin.py
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
|