mkdocs-monorepo-plugin icon indicating copy to clipboard operation
mkdocs-monorepo-plugin copied to clipboard

Extending the plugin to include other repositories documentation for merging

Open ravichauhan03 opened this issue 3 years ago • 5 comments

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

ravichauhan03 avatar Oct 05 '21 17:10 ravichauhan03

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

whiskeysierra avatar Oct 05 '21 18:10 whiskeysierra

You can do this with submodules.

natcl avatar Nov 29 '21 20:11 natcl

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.

jdoiro3 avatar Dec 19 '21 20:12 jdoiro3

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

cas-- avatar Dec 21 '21 18:12 cas--

@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.

jdoiro3 avatar Dec 21 '21 19:12 jdoiro3