backstage / mkdocs-monorepo-plugin

✚ Build multiple documentation folders in a single Mkdocs. Designed for large codebases.
https://backstage.github.io/mkdocs-monorepo-plugin/
Apache License 2.0
319 stars 74 forks source link

Add ability to run script to generate docs #104

Open jdoiro3 opened 1 year ago

jdoiro3 commented 1 year ago

This PR adds the ability for users to define a mono_gen_docs_hook entry in sub-directory (mono package) mkdocs.yml files. When merging the docs into the temp directory the script will be called and generated docs will be included in the built site.

Example

root mkdocs.yml

plugins:
  - monorepo
  - literate-nav:
      nav_file: SUMMARY.md

sub directory mkdocs.yml

mono_gen_docs_hook:
  hook:
    # writes doc files to the temp docs dir
    - scripts/docs/generate_datamodel_docs.py
    - --doc-dir
    # the env variable is set by the monorepo plugin to be the temp dir
    - $TEMP_DOCS_DIR/datamodel
  python_path: .venv/bin/python

nav:
  - Home: index.md
  - Data Model: datamodel/*
jdoiro3 commented 1 year ago

Is this project still being maintained?

bih commented 9 months ago

The project is still being maintained, but I'm not entirely sure I'm sold on this implementation. Can you share more on the use cases you plan on building with this?