Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/apenwarr/mkdocs-exclude
A mkdocs plugin that lets you exclude files or trees from your output.
https://github.com/apenwarr/mkdocs-exclude
Last synced: 4 days ago
JSON representation
A mkdocs plugin that lets you exclude files or trees from your output.
- Host: GitHub
- URL: https://github.com/apenwarr/mkdocs-exclude
- Owner: apenwarr
- License: apache-2.0
- Created: 2019-01-07T19:02:19.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2023-02-02T15:29:32.000Z (almost 2 years ago)
- Last Synced: 2025-01-08T04:26:56.553Z (11 days ago)
- Language: Python
- Size: 6.84 KB
- Stars: 87
- Watchers: 7
- Forks: 10
- Open Issues: 12
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- jimsghstars - apenwarr/mkdocs-exclude - A mkdocs plugin that lets you exclude files or trees from your output. (Python)
README
# File exclude plugin for mkdocs
`mkdocs-exclude` is a
[mkdocs plugin](http://www.mkdocs.org/user-guide/plugins/) that allows you
to exclude files from your input using unix-style wildcards (globs) or
regular expressions (regexes).This implements what people were asking for in some mkdocs bugs, such as
and
.## Quick start
1. Install the module using pip: `pip3 install mkdocs-exclude`
2. In your project, add a plugin configuration to `mkdocs.yml`:
```yaml
plugins:
- exclude:
glob:
- exclude/this/path/*
- "*.tmp"
- "*.pdf"
- "*.gz"
regex:
- '.*\.(tmp|bin|tar)$'
```You can provide zero or more patterns of each type. (If you don't provide
any patterns, then nothing will happen!)Note! Because of peculiarity of yaml syntax, the `glob:` and `regex:` lines
**must not** start with a dash, but the lines under them **must** start with
a dash.Also because of yaml, patterns that start with a punctuation mark must be
quoted.When writing regexes, it's best to use single quotes rather than double
quotes, so that your regex backslash escapes are preserved correctly without
having to be doubled up.