A mkdocs plugin that lets you exclude selected files or sections from the search index.
Project description
mkdocs-exclude-search
A mkdocs plugin that lets you exclude selected files or sections from the search index.
Setup
Install the plugin using pip:
pip install mkdocs-exclude-search
Activate the plugin in mkdocs.yml
:
plugins:
- search
- exclude-search
Note: If you have no
plugins
entry in your config file yet, you'll likely also want to add thesearch
plugin. MkDocs enables it by default if there is noplugins
entry set, but now you have to enable it explicitly.
More information about plugins in the MkDocs documentation.
Config
- List the markdown files to be excluded under
exclude
using the formatfilename.md
. Don't provide the directory of the file! - Exclude specific heading subsections using the format
filename.md#some-heading
. Chapter names are all lowercase,-
as separator, no spaces. - Exclude all markdown files within a directory with
dirname/*.md
ordirname/dirname2/*.md
. - To only include a specific heading subsection of an excluded file, list the subsection under
ignore
.
plugins:
- search
- exclude-search:
exclude:
- second.md # Do not provide the directory of the file, only the filename!
- third.md#some-heading
- dir/*.md # Only to exclude all files within a directory provide the directory!
- dir2/sub/*.md
ignore:
- second.md#another-heading
nav:
- Home: index.md
- First chapter: first.md
- Second chapter: second.md
- Third chapter: third.md
- Fourth chapter: some_directory/fourth.md
This example would exclude:
- the second chapter (but still include its
another-heading
subsection) - the
some-heading
subsection of the third chapter. - all markdown files within
dir
anddir2/sub
.
See Also
More information about templates here.
More information about blocks here.
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
Hashes for mkdocs-exclude-search-0.2.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | b56a8c6cb2b13d2da36c6fbbe109bb035877efc25d827e347377e068852b52e8 |
|
MD5 | 4bcea928b152494ae6eca045528cd097 |
|
BLAKE2b-256 | 4878ef01d5ec843ef0c2ee53a37535c06b70caa7c711dbc39a1eeac2ed8b5357 |
Hashes for mkdocs_exclude_search-0.2.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6c83146d3c1c9329cd5b7858a82c6c9a5e9f299f6f989adfffbf3ba9fcdf3943 |
|
MD5 | c8a4f38c08f2839b5332e09af39f933b |
|
BLAKE2b-256 | c5df869e69c6c3ced2abf71410e51ddc915d43bce4e7d062bd04adc866d83e09 |