oprypin / mkdocs-gen-files

MkDocs plugin to programmatically generate documentation pages during the build
https://oprypin.github.io/mkdocs-gen-files
MIT License
98 stars 8 forks source link

Scripts relative to mkdocs.yml file? #5

Closed rudolfbyker closed 1 year ago

rudolfbyker commented 2 years ago

It would be great to be able to specify scripts relative to the mkdocs.yml file.

Use case

In my mkdocs.yml file:

plugins:
  - gen-files:
      scripts:
        - gen_pages.py

If the current working directory is the folder containing mkdocs.yml, this works:

mkdocs build

But if I want to run this from somewhere else, this does not work:

mkdocs build -f /absolute/path/to/mkdocs.yml

This is very cumbersome for all kinds of CI/CD situations. It would be nice for mkdocs-gen-files to be consistent with the rest of the ecosystem, where everything is relative to the mkdocs.yml file.

oprypin commented 1 year ago

Opened PR