Description
Hi,
Thanks a lot first of all for the amazing work with mdBook.
I wanted to discuss/check out with mdBook contributors if there is a way to solve the problem we are facing currently.
Basically, we have multiple repositories under a single github organization. Each repository has its own documentation. What we want is that - a single mdBook based book that would fetch documentations from all our repositories and show it to the user as a single book.
I will try to use example repositories to be more clear. Let’s say we have example
github organization, with x, y, z
repositories under it.
example
├── x
├── y
├── z
Our wish is - whenever there is a pull request in any of the x, y, z
repositories that introduces documentation changes, we want to have a preview with netlify on the corresponding repository. This brings the following problems:
- If we want to have netlify preview on each PR - that means we need to have all the html, css, etc files (generated by mdbook) for each
x, y, z
repository - Whenever, we do the preview for a single repo, we don’t have anymore the global view of the book, it will be narrowed down only to a single repo part
One way that we came up was that - we have a separate repo w for storing documentation of all the other repositories. But we are not moving the docs from x, y, x
to w but instead we clone x, y,
and z
as submodules into the w
repo. The reason for not moving them to the w
repo is because we would like to keep the documentation as close as possible to the repository that it corresponds to. This will work, we could start the mdbook from w
repo + including content of x, y, z
that we submoduled. And there will be automated CI that will be updating w
repo for example every night with the changes introduced in x, y, z
. But this also brings some problems when renewing a PR
- Example: there is a PR on
x
repo and we want to show the changes on netlify to the PR author. So, netlify will try to fetch the content from the w repository(which doesn’t include current commit inx
repo). But since w repo has no idea about the PR onx
repo, we can’t really show the preview with the actual changes being introduced with the current commit.
In short it is problematic to have a single book that will be sourcing contents from multiple repositories.
I would really love to hear your inputs and open for a discussion.
Thanks in advance.