# -*- coding: utf-8 -*-
from setuptools import setup

packages = \
['mkdocs_file_filter_plugin']

package_data = \
{'': ['*']}

install_requires = \
['igittigitt>=2.1.2,<3.0.0',
 'mkdocs>=1.4.0,<2.0.0',
 'pyyaml-env-tag>=0.1,<0.2',
 'pyyaml>=6.0,<7.0',
 'schema>=0.7.5,<0.8.0']

entry_points = \
{'mkdocs.plugins': ['file-filter = '
                    'mkdocs_file_filter_plugin.plugin:FileFilter']}

setup_kwargs = {
    'name': 'mkdocs-file-filter-plugin',
    'version': '0.0.2',
    'description': 'A MkDocs plugin that lets you exclude/include docs files using globs, regexes, gitignore-style file and Markdown/Frontmatter tags metadata.',
    'long_description': '# mkdocs-file-filter-plugin\n\n[![PyPI - Version][pypi-v-image]][pypi-v-link]\n[![PyPI - Python Version][pypi-pyversions-image]][pypi-pyversions-link]\n\n> :exclamation: **This plugin is under early Alpha stage.** Significant changes may occur. It may not yet be fully compatible with other MkDocs configurations and thus may break with some advanced configs. Once these have been resolved and all bugs have been ironed out, it will be moved to an upper stage.\n\n---\n\n`mkdocs-file-filter-plugin` is a [mkdocs plugin][mkdocs-plugins] that allows you to exclude/include files using Unix-style wildcards (`globs`), regular expressions (`regexes`), `.mkdocsignore` ([gitignore-style][gitignore] file) or Markdown/FrontMatter `tags` metadata.\n\n- [Installation](#installation)\n  - [pip](#pip)\n  - [Poetry](#poetry)\n- [Configuration](#configuration)\n  - [Basic](#basic)\n  - [External config](#external-config)\n  - [Options](#options)\n- [Usage](#usage)\n  - [Globs](#globs)\n  - [Regexes](#regexes)\n  - [Tags](#tags)\n    - [Tags metadata property](#tags-metadata-property)\n    - [Custom metadata list](#custom-metadata-list)\n  - [.mkdocsignore](#mkdocsignore)\n  - [Conflict behavior](#conflict-behavior)\n- [License](#license)\n\n## Installation\n\nThis package requires Python >=3.8 and MkDocs version 1.4.0 or higher.\n\n### pip\n\nInstall the plugin using [pip][pip]:\n\n```console\npip install mkdocs-file-filter-plugin\n```\n\nOr include it in a `requirements.txt` file in your project:\n\n```python\nmkdocs==1.4.*\nmkdocs-file-filter-plugin==0.0.*\n```\n\nand run\n\n```console\npip install -r requirements.txt\n```\n\n### Poetry\n\nInstall the plugin using [Poetry][poetry]:\n\n```console\npoetry add mkdocs-file-filter-plugin\n```\n\n## Configuration\n\n### Basic\n\nAdd a plugin configuration to `mkdocs.yml` - below example contains only example, to adjust config for your needs read [Usage](#usage) section:\n\n```yaml\n# mkdocs.yml\nplugins:\n  - search # if you include another plugin, and want search you have to add it again\n  - file-filter:\n      exclude_glob:\n        - \'exclude/this/path/*\'\n        - \'exclude/this/file/draft.md\'\n        - \'*.tmp\'\n      exclude_regex:\n        - \'.*\\.(tmp|bin|tar)$\'\n      exclude_tag:\n        - draft\n        - preview\n      include_glob:\n        - \'include/this/path/*\'\n        - \'include/this/file/Code-of-Conduct.md\'\n        - \'*.png\'\n        - \'assets/**\' # the material theme requires this folder\n      include_regex:\n        - \'.*\\.(js|css)$\'\n      include_tag:\n        - released\n```\n\n> :warning: **NOTE**\n>\n> If you have no `plugins` entry in your config file yet, you\'ll likely also want to add the `search` plugin. MkDocs enables it by default if there is no `plugins` entry set, but now you have to enable it explicitly.\n>\n> More information about plugins in the [MkDocs documentation][mkdocs-plugins].\n\n### External config\n\nThe plugin supports external files for the plugin configuration. If the external config file is specified, then plugin\'s config properties from `mkdocs.yml` are overwritten.\n\n```yaml\n# mkdocs.yml\nplugins:\n  - search # if you include another plugin, and want search you have to add it again\n  - file-filter:\n      config: !ENV [MY_FILE_FILTER_CONFIG, \'mkdocs.file-filter.yml\']\n```\n\n> :bulb: **HINT**\n>\n> For external file config, you can use [MkDocs Environment Variables][mkdocs-envs] to set the desired file dynamically. A useful case for serving the site with different content based on stage/environment/etc. Works well with CI/CD automation.\n\nExternal plugin config file example:\n\n```yaml\n# mkdocs.file-filter.yml\nenabled: !ENV [CI, true]\nenabled_on_serve: true\nmkdocsignore: false\nexclude_glob:\n  - \'exclude/this/path/*\'\n  - \'exclude/this/file/draft.md\'\n  - \'*.tmp\'\nexclude_regex:\n  - \'.*\\.(tmp|bin|tar)$\'\nexclude_tag:\n  - draft\ninclude_glob:\n  - \'include/this/path/*\'\n  - \'include/this/file/Code-of-Conduct.md\'\n  - \'*.png\'\n  - \'assets/**\' # the material theme requires this folder\ninclude_regex:\n  - \'.*\\.(js|css)$\'\ninclude_tag:\n  - prod\n```\n\n> :warning: **NOTE**\n>\n> - External config uses exactly the same properties as plugin\'s config in the `mkdocs.yml` except `config` property.\n>\n> - External config support [MkDocs Environment Variables][mkdocs-envs] as well.\n\n### Options\n\nThe below table shows all supported options by the plugin.\n\n| Property | Type | Default | Description |\n| --- | --- | --- | --- |\n| `config` | string | *none* | Path to external plugin\'s configuration file |\n| `enabled` | bool | `true` | Turn on/off plugin without removing/adding plugin\'s config from `mkdocs.yml` |\n| `enabled_on_serve` | bool | `false` | Turn on/off plugin on `serve` command |\n| `mkdocsignore` | bool | `false` | Use gitignore-style file for patterns |\n| `mkdocsignore_file` | string | `.mkdocsignore` | Path to gitignore-style file with patterns |\n| `metadata_property` | string | `tags` | What Markdown/FrontMatter metadata property will be used for checking tags |\n| `exclude_tag` | [string] | *none* | List of excluded tags |\n| `include_tag` | [string] | *none* | List of included tags |\n| `exclude_glob` | [string] | *none* | Exclude glob patterns |\n| `include_glob` | [string] | *none* | Include glob patterns |\n| `exclude_regex` | [string] | *none* | Exclude regex patterns |\n| `include_regex` | [string] | *none* | Include regex patterns |\n\n## Usage\n\n> :warning: **NOTE**\n>\n> - If you do not provide patterns, everything will stay the same - standard MkDocs behavior - include all.\n>\n> - Because of the YAML syntax specifics, glob/regex patterns that start with a punctuation mark must be quoted.\n>\n> - The preferred way for quotes is to use single quotes `\'` rather than double quotes `"` - regex backslash escapes are preserved correctly without being doubled up.\n>\n> - You can combine all patterns - globs/regexes with tags, and mkdocsignore.\n\n### Globs\n\n```yaml\n# mkdocs.yml\nplugins:\n  - file-filter:\n      exclude_glob:\n        - \'drafts/**\'\n      include_glob:\n        - \'drafts/**/preview-*.md\'\n```\n\n**RESULT:** exclude all content from `drafts` and related subdirectories, but include all markdown files with prefix starting `preview` from `drafts` and related subdirectories.\n\n> :warning: **NOTE**\n>\n> **Glob** patterns relative to your [docs_dir][mkdocs-docs-dir] setting from `mkdocs.yml`\n\n### Regexes\n\n```yaml\n# mkdocs.yml\nplugins:\n  - file-filter:\n      exclude_regex:\n        - \'.*\\.(tmp|bin|tar)$\'\n      include_regex:\n        - \'.*\\.(js|css)$\'\n```\n\n**RESULT:** exclude all files with `tmp`, `bin` or `tar` extension and include all files with `js`, or `css` extension.\n\n> :warning: **NOTE**\n>\n> **Regex** patterns relative to your [docs_dir][mkdocs-docs-dir] setting from `mkdocs.yml`\n\n### Tags\n\nYou can filter your content based on the [Markdown metadata][mkdocs-metadata] (often called front-matter) keywords.\n\n#### Tags metadata property\n\nBy default plugin filter files using `tags` property of your Markdown metadata.\n\n```yaml\n# mkdocs.yml\nplugins:\n  - file-filter:\n      exclude_tag:\n        - abc\n        - draft\n        - alpha\n      include_tag:\n        - foo\n        - release\n        - beta\n```\n\n`fileA.md` metadata example:\n\n```markdown\n<!-- fileA.md -->\n---\ntags:\n  - foo\n  - bar\n---\n\n# Markdown with tags metadata\n\nLorem ipsum dolor sit amet...\n```\n\n`fileB.md` metadata example:\n\n```markdown\n<!-- fileB.md -->\n---\ntags:\n  - abc\n  - xyz\n---\n\n# Markdown with tags metadata\n\nLorem ipsum dolor sit amet...\n```\n\n**RESULT:** only `fileA.md` will be included.\n\n#### Custom metadata list\n\nBecause the `tags` property is very often used to render tags on the site, in some scenarios, you\'d like to filter files using specific tag keywords and avoid rendering them. In that case, you can create a custom metadata list and use it for filtering without affecting tags\' used for rendering.\n\nSet `metadata_property` with your custom list property, e.g., `labels` for this example.\n\n```yaml\n# mkdocs.yml\nplugins:\n  - file-filter:\n      metadata_property: labels\n      exclude_tag:\n        - foo\n        - draft\n        - alpha\n      include_tag:\n        - xyz\n        - release\n        - beta\n```\n\n`fileA.md` metadata example:\n\n```markdown\n<!-- fileA.md -->\n---\ntags:\n  - foo\n  - bar\nlabels:\n  - draft\n  - internal\n---\n\n# Markdown with metadata - tags and custom list\n\nLorem ipsum dolor sit amet...\n```\n\n`fileB.md` metadata example:\n\n```markdown\n<!-- fileB.md -->\n---\ntags:\n  - foo\n  - bar\nlabels:\n  - release\n  - v1\n---\n\n# Markdown with metadata - tags and custom list\n\nLorem ipsum dolor sit amet...\n```\n\n**RESULT:** only `fileB.md` will be included.\n\n### .mkdocsignore\n\nSetting `mkdocsignore` to `true` will exclude the dirs/files specified in the `.mkdocsignore`. Use the same syntax as you use for [gitignore][gitignore].\n\nOptionally you can set `mkdocsignore_file` parameter with your path to `.mkdocsignore` file. By default, the plugin uses `.mkdocsignore` from the root of your MkDocs.\n\nExample config for mkdocsignore.\n\n```yaml\n# mkdocs.yml\nplugins:\n  - file-filter:\n      mkdocsignore: true # default: false\n      mkdocsignore_file: \'custom/path/.myignore\' # optional, relative to mkdocs.yml, default: .mkdocsignore\n```\n\nExample `.mkdocsignore` file.\n\n```bash\n# MkDocs\ndocs/test/**\ndocs/**/draft-*.md\n```\n\n**RESULT:** exclude all content from `docs/test` and related subdirectories and all markdown files with prefix starting `draft` from `docs` and related subdirectories.\n\n> :warning: **NOTE**\n>\n> **.mkdocsignore** patterns relative to your root.\n\n### Conflict behavior\n\nIt is possible to exclude and include will have conflict. For example, you could exclude `drafts/**` but include `*.md`. In that case, **include** has higher priority over exclude. So all `*.md` files from the drafts folder will be **included**.\n\n## License\n\n`mkdocs-file-filter-plugin` is distributed under the terms of the [MIT][mit] license.\n\n[pypi-v-image]: https://img.shields.io/pypi/v/mkdocs-file-filter-plugin.svg\n[pypi-v-link]: https://pypi.org/project/mkdocs-file-filter-plugin\n[pypi-pyversions-image]: https://img.shields.io/pypi/pyversions/mkdocs-file-filter-plugin.svg\n[pypi-pyversions-link]: https://pypi.org/project/mkdocs-file-filter-plugin\n[mkdocs-plugins]: http://www.mkdocs.org/user-guide/plugins\n[mkdocs-envs]: https://www.mkdocs.org/user-guide/configuration/#environment-variables\n[mkdocs-metadata]: https://www.mkdocs.org/user-guide/writing-your-docs/#meta-data\n[mkdocs-docs-dir]: https://www.mkdocs.org/user-guide/configuration/#docs_dir\n[poetry]: https://python-poetry.org\n[pip]: https://pip.pypa.io\n[gitignore]: https://git-scm.com/docs/gitignore\n[mit]: https://spdx.org/licenses/MIT.html\n',
    'author': 'Dariusz Porowski',
    'author_email': 'None',
    'maintainer': 'None',
    'maintainer_email': 'None',
    'url': 'https://github.com/DariuszPorowski/mkdocs-file-filter-plugin',
    'packages': packages,
    'package_data': package_data,
    'install_requires': install_requires,
    'entry_points': entry_points,
    'python_requires': '>=3.8,<3.11',
}


setup(**setup_kwargs)
