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 search
and exclude-search
plugins in mkdocs.yml
. search
is required, otherwise exclude-search
has no effect!
plugins:
- search
- exclude-search
More information about plugins in the MkDocs documentation.
Configuration
- List the markdown files to be excluded under
exclude
using the format<path>/<to>/filename.md
in the docs folder. - Exclude specific heading subsections using the format
<path>/<to>/filename.md#some-heading
. Chapter names are all lowercase,-
as separator, no spaces. - Exclude all markdown files within a directory (and its children) with
dirname/*
. - Exclude all markdown files with a specific name within all subdirectories with
dirname/*/filename.md
or/*/filename.md
. - To still include a subsection of an excluded file, list the subsection heading under
ignore
using the format<path>/<to>/filename.md#some-heading
. - To exclude all unreferenced files (markdown files not listed in mkdocs.yml nav section), use
exclude-unreferenced: true
. Default false.
plugins:
- search
- exclude-search:
exclude:
- first.md
- dir/second.md
- third.md#some-heading
- dir2/*
- /*/fifth.md
ignore:
- dir/second.md#some-heading
exclude-unreferenced: true
nav:
- Home: index.md
- First chapter: first.md
- Second chapter: dir/second.md
- Third chapter: third.md
- Fourth chapter: dir2/fourth.md
- Fifth chapter: subdir/fifth.md
This example would exclude:
- the first chapter.
- the second chapter (but still include its
some-heading
section). - the
some-heading
section of the third chapter. - all markdown files within
dir2
(and its children directories). - all markdown files named
fifth.md
within all subdirectories. - all unreferenced files
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
Close
Hashes for mkdocs-exclude-search-0.6.4.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1c4021509116636b109b37e4b535d043fdbb888c2281f07ff2895386ca52dcc2 |
|
MD5 | a398ecfaa4d2cd26cbb02e9a46c5b38d |
|
BLAKE2b-256 | 7ed58a371dd8a61678ae7d8573c801d3c02e36d5d3490640d3a767975f385858 |
Close
Hashes for mkdocs_exclude_search-0.6.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ed5f93efef1b7a253856a040f5f23e6b9b8e6e4c9f8f0413691aa29b3478ffbe |
|
MD5 | 1be0f44fbd0204a63d0329028e6a632b |
|
BLAKE2b-256 | f1bc62759a1479f804f1657b74ce0f30a16b31afeaffd69c6b7596f477a0b2f8 |