mdBook icon indicating copy to clipboard operation
mdBook copied to clipboard

Feature request: serve multiple mdBooks in one site

Open rutrum opened this issue 6 years ago • 8 comments

I have a lot of mdbooks now. In particular, I use them for notes in my classes. I would love a way to have a single webpage serve multiple mdbooks. In particular, I wish there was a way to structure an mdbook project to serve multiple books (each with a distinct SUMMARY.md), so I could view all my class notes in one repository.

rutrum avatar Sep 29 '19 15:09 rutrum

Hello I'm also thinking about this, I have nginx installed locally on computer. From the documentation/guide I served both books like the example below mdbook serve path/to/book -p 8000 -n 127.0.0.1 --websocket-hostname 192.168.1.100 I used two different IP's but same port numbers, and also same IP different port numbers 8001 and 8002 but the port for incoming 3001 was already taken, it still worked though :)

Before this I did try serving the book via symbolic link to nginx root dir, and also at the same time I did 'mdbook serve' to serve a single book and it got served twice :) , idk, so I realised the built in engine is the way to go anyway, but since you have only one IP on a server, you could make different hostnames? And at this point i'm not sure if the 3001 websocket can be changed, it's getting late :).

If you did figure out anything in the mean time let me know too.


wow my comment isn't all that smart

commented on Mar 6, 2020 edited today Mar 6, 2023

GogoFC avatar Mar 06 '20 08:03 GogoFC

I'd be interested in this feature. My workflow involves switching between multiple books, and it's be great to have each subdirectory in a root directory have a different port number.

Possibly with a simple configuration file mapping subdirectories to ports or URLs.

I could write a patch, but I don't want to start on a feature that is a dead end. I don't have a good estimate of demand.

Thanks! Great project.

jgerrish avatar Mar 06 '23 21:03 jgerrish

I now host multiple mdbooks on one server. I have nginx running and each book is on a different subdomain and therefore also different directory. Since https runs on port 443 everything is on that port.

GogoFC avatar Mar 06 '23 22:03 GogoFC

I think my intention with this ticket was that the built site might have say, a top navigation bar, or a special drop down at the top, that would allow me to switch between books. Hosting multiple books behind nginx gets the job done, but it would be cool if the site itself also generated with links to navigate between books.

rutrum avatar Mar 07 '23 17:03 rutrum

This feature will be awesome! I am mostly being pushed to mkdocs because of lacking of this feature...

r12f avatar May 19 '23 23:05 r12f

This feature will be awesome! I am mostly being pushed to mkdocs because of lacking of this feature...

Similar situation here, so I've been thinking about this for a while. My aim was to build a nested series of books, essentially, for an internal knowledge base. So, a top-level overview of books in the nav bar would be great, as I think the tree view would actually encourage more self discovery if you had visibility on what existed at a glance.

DragosDumitrache avatar May 20 '23 07:05 DragosDumitrache