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

Extending the plugin to include other repositories documentation for merging #57

Open ravichauhan03 opened 2 years ago

ravichauhan03 commented 2 years ago

Currently, it serves the documentation from the same repo from different folders. Can we extend this to serve from differnt repositories as well.

whiskeysierra commented 2 years ago

We're already doing that in my company by just checking out all repos. They are just folders at that point.

natcl commented 2 years ago

You can do this with submodules.

jdoiro3 commented 2 years ago

Not sure where this will go but I started mkdocs-multirepo-plugin the other day to try and implement this. The idea is to have one site for various projects/microservices but the underlying docs live as close to the code as possible.

The plugin lets you either define the imports in the nav or if you'd rather omit the nav, you can define it in the plugin section.

method 1

nav:
  - Home: 'index.md'
  - MicroService: '!import https://github.com/{user}/{repo name}@{branch}'

method 2

plugins:
  - multirepo:
      cleanup: True # (optional) tells multirepo to cleanup the temporary directory where other repo docs are imported to
      folder_name: multirepo_docs # (optional) tells multirepo what the temp directory should be called
      repos:
        - section: Backstage
          import_url: 'https://github.com/backstage/backstage'
        - section: Monorepo
          import_url: 'https://github.com/backstage/mkdocs-monorepo-plugin'
        - section: 'Techdocs-cli'
          import_url: 'https://github.com/backstage/techdocs-cli@main'

Some things I'm trying to figure out are how tech writers can point to their own local copy of the repo for testing the site before pushing changes to the respective repo.

cas-- commented 2 years ago

@jdoiro3 Were you aware of https://github.com/wilhelmer/mkdocs-multirepo is what you are working on different to that?

jdoiro3 commented 2 years ago

@cas--, I didn't know about this project but after briefly looking at it, it looks like this builds multiple mkdocs sites, giving them all one landing page. mkdocs-multirepo-plugin takes documentation in multiple repos and builds one site. So, for example you could search across projects since it's all in one index. Material for Mkdocs did some optimizations to search for large indexes. Just an FYI.

Thanks for pointing this out though. I will look at it some more to make sure I'm not reinventing the wheel.