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
314 stars 75 forks source link

Add support for wildcard include statements #67

Closed TeamTeaTime closed 2 years ago

TeamTeaTime commented 2 years ago

This is a proposed addition that supports new syntax to enable including all of the docs for subdirectories using a wildcard syntax rather than explicitly. It finds directories matching the wildcard pattern and adds them using site_name as the key. This may be related to this issue. The sample project has been modified to demonstrate the usage and tests were added.

The intended use case for this is a project with a large number of subcomponents containing their own documentation. By using the wildcard include, the scope of changes can be limited to the subcomponent and the root mkdocs.yml file does not need to grow unnecessarily large.

site_name: Cats API

nav:
  - Intro: 'index.md'
  - Authentication: 'authentication.md'
  - '*include ./components/*/ Components': '!include mkdocs.yml'
...

plugins:
  - monorepo