Skip to content

Versioning with Multirepo and Monorepo #852

Closed

Description

@sebdeckers

🚀 Feature

Combine docs from several modules into a single site. Docs may exist in separate repos or a monorepo.

Have you read the Contributing Guidelines on issues?

👍🏻

Motivation

I maintain a project comprised of several modules, each in their own versioning and documented repository. Other projects may manage multiple modules as a monorepo.

Pitch

Users expect a single documentation website where they can learn about all modules.

I would like to declare each module's repo URL, git submodule, or local directory path. Docusaurus should process any content files from the external modules with proper versioning and translation support.

Activity

  1. added
    feature
    on Jul 15, 2018
  2. k4b7 commented on Sep 4, 2018

    @k4b7

    I would love to use Docusaurus but am in the same situation. Would there be any interest in a pull request to add this feature?

  3. JoelMarcey commented on Sep 12, 2018

    @JoelMarcey
    Contributor

    @kevinbarabash Would love a pull request if you are willing? 👍

  4. k4b7 commented on Sep 13, 2018

    @k4b7

    Cool! I'm not sure when I'll be able to get to this, but hopefully before the end of the year. 🤞

    We were looking at building a custom documentation tool because of this requirement as well as others. I'd rather augment an existing tool than build something from scratch though. 🙂

  5. vjpr commented on Jun 9, 2020

    @vjpr

    I wonder if this could be achieved with a plugin in Docosaurus v2.

  6. slorber commented on Jun 9, 2020

    @slorber
    Collaborator

    We have the goal to make the docs plugin less "global", which means you should be able to use it multiple time on the same D2 site.

    This way you could have /module1Docs + /module2Docsurl prefix, and put the markdowns in a git submodules if you want (the source directory is configurable already).

    For translations, it might be more complicated, need to think about this.

  7. vjpr commented on Jun 9, 2020

    @vjpr

    I started building a simple plugin to pull in the readme.md and docs folder for each package in my monorepo.

    Would you suggest waiting a bit until the docs plugin is made more global? It did look like it was going to be a bit tricky because the docs plugin is rather complex.

  8. slorber commented on Jun 9, 2020

    @slorber
    Collaborator

    I have not started the work on the docs plugin, and yes it might be tricky.

    I think in the meantime you could have a build script that would just take all md's from submodules and copy the files to a non-versioned /docs folder. Each git submodule could be a subfolder of the /docs folder.

    You won't have much flexibility over the docs urls (ie a single /docs prefix) and doc ids, but that should be a good workaround in the meantime.

  9. slorber commented on Aug 14, 2020

    @slorber
    Collaborator

    Hey there

    Can you read this RFC and tell me if you think it could be suitable for your usecases?

    #3285

  10. slorber commented on Aug 14, 2020

    @slorber
    Collaborator

    Note, it's possible to use multiple times the doc plugin on the same site now, I think it could be useful if you want to aggregate multiple docs in a same. site with different versioning. For example, iOS SDK in v1, v2, v3, and Android SDK in v1, v1.1...

    See #2528 (comment)

  11. slorber commented on Jun 10, 2021

    @slorber
    Collaborator

    I believe it's already possible to assemble multiple git repos into a single Docusaurus site (some of our users actually do that).

    • You can assemble the final doc as a pre-build step and put the md files are the correct location
    • You can have multiple docs plugins instances, each one targeting a different git submodule/repo with the path options

    We may still have missing configuration options to make life easier in some use-cases: in this case please open an issue explaining a concrete problem you encountered while trying to use multiple repos with Docusaurus, and we'll see how to unlock your usecase.

    Personal note: it may take time to build a site containing multiple versioned docs. Sharding your site into multiple smaller instances can be more scalable. You can share your site config and custom CSS across site instances so that they somehow look the same and the transition from one to another is not too noticeable.

  12. ksandhya9 commented on Jun 5, 2023

    @ksandhya9

    I believe it's already possible to assemble multiple git repos into a single Docusaurus site (some of our users actually do that).

    • You can assemble the final doc as a pre-build step and put the md files are the correct location
    • You can have multiple docs plugins instances, each one targeting a different git submodule/repo with the path options

    We may still have missing configuration options to make life easier in some use-cases: in this case please open an issue explaining a concrete problem you encountered while trying to use multiple repos with Docusaurus, and we'll see how to unlock your usecase.

    Personal note: it may take time to build a site containing multiple versioned docs. Sharding your site into multiple smaller instances can be more scalable. You can share your site config and custom CSS across site instances so that they somehow look the same and the transition from one to another is not too noticeable.

    Hi @slorber

    Could you please kindly share any example for multiple docs plugin if possible?
    You can have multiple docs plugins instances, each one targeting a different git submodule/repo with the path options

  13. slorber commented on Jun 7, 2023

    @slorber
    Collaborator

    We document "multiple docs plugins" as here: https://docusaurus.io/docs/docs-multi-instance

    Git and submodules are outside the scope of Docusaurus. Docusaurus works as long as the files exist on the filesystem at the correct place. How you bring them there is not Docusaurus.

  14. ksandhya9 commented on Jun 10, 2023

    @ksandhya9

    Thank you @slorber

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions