rust-lang / mdBook

Create book from markdown files. Like Gitbook but implemented in Rust
https://rust-lang.github.io/mdBook/
Mozilla Public License 2.0
17.61k stars 1.61k forks source link

Single-Page Application (SPA) Mode #982

Open heyakyra opened 5 years ago

heyakyra commented 5 years ago

It would be nice to be able to render the entire book into a SPA that doesn't load a new html file for each page and instead uses JavaScript to switch pages.

WofWca commented 5 years ago

Related (dup?) #546

heyakyra commented 5 years ago

Hm, I suppose #546 is one possible way to achieve this. Another would be a virtual DOM similar to what Elm or React would provide.

doregex commented 2 years ago

Hi, I have implemented a new flag that does something similar in this fork doregex/mdBook. It can be added to the book.toml like:

[output.html]
single-page = true

By enabling it the pages are rendered inside the index.html, the search has also been modified to output results that are clickable using hashes. The feature is just an add-on that doesn't affect the behaviour. I would like to open a PR to merge this function.

segeljakt commented 1 year ago

Any chance this could be turned into a custom renderer backend?