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 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
.
plugins:
- search
- exclude-search:
exclude:
- first.md
- dir/second.md
- third.md#some-heading
- dir2/*
- /*/fifth.md
ignore:
- dir/second.md#some-heading
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.
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.5.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7b0b6d8f7c0ce690dc242d07b98ea1bfb56b1ca1c6b68e9d70bee40f05abcf83 |
|
MD5 | 8d24dd4e5f0ba2a71a4da7d761a7f2cc |
|
BLAKE2b-256 | ff8402317655b8b3c94f6c3ef8484bc77b9203c34ae121b43428dfca46cfab0f |
Hashes for mkdocs_exclude_search-0.5.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ab3075ed73eeebf5819811105b1b292b90ce23e17508a9c2266c968d46739d89 |
|
MD5 | ddbe0dadb0a7e3be38b066e577812284 |
|
BLAKE2b-256 | 7a284c65c977d915614b41161c057576bceef1c849a1d0c3fe73c7bde8044e10 |