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

[feature] Add a sorting option for `*include` #124

Open adainese opened 5 months ago

adainese commented 5 months ago

Summary

Request to add a sorting option when including folders through the *include syntax

Details

When including a set of folder using the *include syntax, they are added to the nav in lexicographic (default order of ls, I think). I'd like to have some way to sort the entries in a different order, a couple of simple flags should be enough.

Proposal

Just as an example, I can suggest something like this:

# /mkdocs.yml
site_name: Cats System

nav:
  - Intro: 'index.md'
  - Components: '*include -n -r ./components/*/mkdocs.yml'

Where -n means using numerical order and -r means reverse order (same flags as ls)