Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Background
A while ago the need to bundle together multiple mdBooks arose for me. I did some digging but I could only find a number of feature requests in the issues list. So I decided to try and prototype something myself. Adding a 'shelf' command to the CLI.
Strategy
The feature is based around a shelf.toml file which contains a number of books to include in your bookshelf. They can either be locally present on the filesystem or a git repository. If you use a git repository you can optionally provide a path inside git repository where the file is present and a branch.
These books are then build by the shelf command.
In addition to this one more book is built, the actual "shelf". This is also an mdBook. It will will contain an index and a separate page for each book containing a bit more information.
Every book built by the shelf command will have an additional icon in the top right corner of a book. Clicking this will bring you back to the bookshelf.
It is the fa-book icon. I would have liked to use something more like this: https://fontawesome.com/icons/books?f=classic&s=solid but all those seem to be "Pro".
You can see a working example here:
https://coi-l.github.io/mdBook/bookshelf/index/book/index.html
or here:
https://coi-l.github.io/mdBook/bookshelf-multi/index/book/index.html
These to sites display the two options available. The first simple one with just one "shelf" in the bookshelf, and the seconds with multiple "shelves". This second option can be used to categorize the mdBooks.
Trying it out
You can try this out for yourself by checking out the PR code and building the mdBook binary.
Then navigate to the 'test_shelf' directory where there is a shelf.toml file prepared. Run the mdBook binary with 'shelf' as the command. This will build the same bookshelf as provided in the link above.
Summing it up
What I am looking for is comments regarding the PR.
First and foremost if this is something that is desired. There seems to be a number of feature requests for this, but maybe this strategy is not the way to go about it?
If you think this sounds like a good way forward I'd appreciate feedback on the code and on the actual design of the shelf book and UI in general. I don't mind polishing this to make it look good. Perhaps tables would be better or something.
Maybe the book icon in the books should produce a dropdown instead so you can easily select another book, or move back to the bookshelf.
The actual directory structure that the shelf command produces can also be adjusted.
Issues I think are requesting something like this, but I might have misunderstood:
#1748
#1347
#1666
#1042