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

Import docs outside of nav section

Open A-Baji opened this issue 2 years ago • 0 comments

I'd like to import my docs to a section besides the nav. For example if I have a H2 in my index.md labeled Projects, I'd like to list the documentation for various projects under it. Clicking on these will send you to the home page of the docs for that project. This would also update the top header bar for the docs you are currently accessing. I have an example of this here, using a different multirepo tool. The issue with this is that the top level search does not work, meaning I can't search through child docs from the parent. The implementation is also quite messy.

Is this something that would be possible with the current implementation? Perhaps you could add a new key to the repos section under plugins to target a html element with a given id, and then on build create a list of doc links within that html element for all repos that target its id.

For example:

index.md

## Projects
<section id="project_docs"></section>

mkdocs.yml

plugins:
  - search
  - multirepo:
      cleanup: false
      repos:
        - section: Repo 1
          import_url: 'https://github.com/A-Baji/mk-docs-sample1'
          html_id: project_docs
        - section: Repo 2
          import_url: 'https://github.com/A-Baji/mk-docs-sample2'
          html_id: project_docs
        - section: Repo 3
          import_url: 'https://github.com/A-Baji/mk-docs-sample3'
          html_id: project_docs

This would then list the docs under the Projects header rather than in the navigation menu. The only thing I am unsure of is how this would affect the top level search, as that is an important feature to include.

A-Baji avatar Jun 23 '22 19:06 A-Baji