Web e-reader that you can deploy anywhere
typeset.js reads EPUB, Word and Markdown in the browser: a typesetting engine in Rust, compiled to WebAssembly, and three HTML elements. Install it from npm, serve it as static files from any host, and put a book on a page with one tag. Open source, MIT licensed.
npm install typeset.js
The reader itself, embedded on this page with:
<typeset-book src="/sample.epub"
paper="page"></typeset-book>
Put a book on your site
The reader is a folder of static files that you host beside your books, on any host: GitHub Pages, Netlify, Cloudflare or your own server. No account, no tracking, nothing loaded from elsewhere.
-
Add the reader
In a project with npm:
npm install typeset.js npx typeset.js public/typesetNo npm? Download typeset.js.zip, unzip it, and upload the
typesetfolder to your site. -
Put a book on a page
Upload your book, then add this:
<script type="module" src="/typeset/typeset.js"> </script> <typeset-book src="/books/my-book.epub"> </typeset-book>It fills the width of its column; give it a height in CSS to change its size.
-
Choose what it shows
Attributes set the rest:
chapters="1-3"- only these chapters
theme="linen"- one of six themes
paper="page"- your page’s own colour
end-href="/shop"- a link at the end, named by
end-label off="highlights"- features to leave out
Everything else, with events and methods for scripts, is in the reference.
A cover that opens the book
Shows the book’s own cover; a press opens the reader over the whole window, and × or the browser’s Back returns to the page.
<typeset-open
src="/books/my-book.epub">
</typeset-open>
A shelf of books
A list of your books, as JSON, becomes a shelf of covers, each opened in place.
<typeset-library
src="/books.json">
</typeset-library>
- Engine
- Rust, compiled to WebAssembly: about 850 KB compressed, in a worker.
- Typesetting
- Paragraphs broken whole and hyphenated; words shaped by HarfRust.
- Formats
- EPUB 2 and 3 with their own styles, Word (.docx), Markdown.
- Licence
- MIT. The source is on GitHub.
The Volumen app
Your library
Add EPUB, Word and Markdown files and read them in the browser, online or off. Highlights, notes and bookmarks stay on your device, and export as Markdown or JSON.
Sharing a manuscript
Send a draft as a private link and get readers’ notes back beside your text. The book is encrypted on your device; its key is in the link and never reaches the server. By invitation, for now.
Find and search
Find in a book with Ctrl F, or search the full text of every book at once. Notes find their place again in a revised draft.
In the browser
Volumen installs from the browser as an app of its own, which opens in its own window and reads offline. Open the library, then use the browser’s install or Add to Home Screen.
Other devices
- iPhone and iPad
- Open the library in Safari, tap Share, then Add to Home Screen.
- Android
- In Chrome, Install app in the menu.
- Mac
- Open the library in Safari and choose File, Add to Dock; in Chrome, the install button in the address bar.
- Windows and Linux
- In Chrome or Edge, the install button in the address bar.
Desktop app
The same reader as an app for Linux, macOS and Windows, with your computer’s own fonts.
Linux: an AppImage, or a .deb for Debian and Ubuntu. The installers are not yet signed: macOS asks once to allow Volumen in System Settings, Privacy & Security; Windows shows a SmartScreen notice (More info, then Run anyway). All releases