| 1 |
Metadata-Version: 2.1 |
| 2 |
Name: mkdocs-gen-files |
| 3 |
Version: 0.5.0 |
| 4 |
Summary: MkDocs plugin to programmatically generate documentation pages during the build |
| 5 |
Project-URL: Documentation, https://oprypin.github.io/mkdocs-gen-files/ |
| 6 |
Project-URL: Source, https://github.com/oprypin/mkdocs-gen-files |
| 7 |
Project-URL: Issues, https://github.com/oprypin/mkdocs-gen-files/issues |
| 8 |
Project-URL: History, https://github.com/oprypin/mkdocs-gen-files/releases |
| 9 |
Author-email: Oleh Prypin <[email protected]> |
| 10 |
License-Expression: MIT |
| 11 |
License-File: LICENSE.md |
| 12 |
Keywords: mkdocs,mkdocs-plugin |
| 13 |
Classifier: Development Status :: 5 - Production/Stable |
| 14 |
Classifier: Environment :: Console |
| 15 |
Classifier: Environment :: Web Environment |
| 16 |
Classifier: Intended Audience :: Developers |
| 17 |
Classifier: License :: OSI Approved :: MIT License |
| 18 |
Classifier: Operating System :: OS Independent |
| 19 |
Classifier: Programming Language :: Python |
| 20 |
Classifier: Programming Language :: Python :: 3.7 |
| 21 |
Classifier: Programming Language :: Python :: 3.8 |
| 22 |
Classifier: Programming Language :: Python :: 3.9 |
| 23 |
Classifier: Programming Language :: Python :: 3.10 |
| 24 |
Classifier: Programming Language :: Python :: 3.11 |
| 25 |
Classifier: Topic :: Documentation |
| 26 |
Classifier: Topic :: Software Development :: Documentation |
| 27 |
Classifier: Topic :: Text Processing :: Markup :: Markdown |
| 28 |
Classifier: Typing :: Typed |
| 29 |
Requires-Python: >=3.7 |
| 30 |
Requires-Dist: mkdocs>=1.0.3 |
| 31 |
Description-Content-Type: text/markdown |
| 32 |
|
| 33 |
# mkdocs-gen-files |
| 34 |
|
| 35 |
**[Plugin][] for [MkDocs][] to programmatically generate documentation pages during the build** |
| 36 |
|
| 37 |
[](https://pypi.org/project/mkdocs-gen-files/) |
| 38 |
[](https://github.com/oprypin/mkdocs-gen-files/blob/master/LICENSE.md) |
| 39 |
[](https://github.com/oprypin/mkdocs-gen-files/actions?query=event%3Apush+branch%3Amaster) |
| 40 |
|
| 41 |
```shell |
| 42 |
pip install mkdocs-gen-files |
| 43 |
``` |
| 44 |
|
| 45 |
**Continue to the [documentation site][].** |
| 46 |
|
| 47 |
[mkdocs]: https://www.mkdocs.org/ |
| 48 |
[plugin]: https://www.mkdocs.org/user-guide/plugins/ |
| 49 |
[documentation site]: https://oprypin.github.io/mkdocs-gen-files |
| 50 |
|
| 51 |
## Usage |
| 52 |
|
| 53 |
Activate the plugin in **mkdocs.yml** (`scripts` is a required list of Python scripts to execute, always relative to **mkdocs.yml**): |
| 54 |
|
| 55 |
```yaml |
| 56 |
plugins: |
| 57 |
- search |
| 58 |
- gen-files: |
| 59 |
scripts: |
| 60 |
- gen_pages.py # or any other name or path |
| 61 |
``` |
| 62 |
|
| 63 |
Then create such a script **gen_pages.py** (this is relative to the root, *not* to the **docs** directory). |
| 64 |
|
| 65 |
```python |
| 66 |
import mkdocs_gen_files |
| 67 |
|
| 68 |
with mkdocs_gen_files.open("foo.md", "w") as f: |
| 69 |
print("Hello, world!", file=f) |
| 70 |
``` |
| 71 |
|
| 72 |
This added a programmatically generated page to our site. That is, the document doesn't actually appear in our source files, it only *virtually* becomes part of the site to be built by MkDocs. |
| 73 |
|
| 74 |
**Continue to the [documentation site][].** |