Write Books With the Block Editor

If you need a little push to start writing this winter, in the comfort of your familiar editor, here it is! You can now use the Block Editor to create electronic books and other documents—all completely offline. What a full circle moment for Gutenberg!

The Block Editor contains so many features I miss when writing in other editors. It produces clean, semantic markup. You can paste in content from anywhere and the editor will clean it up for you, or paste a link onto selected text to auto-link. The List View and Outline panels allow you to easily navigate and inspect the content. And we’re constantly iterating on the Block Editor: more features and improvements are on the way, such as refined drag and drop interactions coming in early 2025.

All this inspired me to wrap our editor in an app that can read and write local files—just as other document editors do. It turns out that EPUB is the best file format to store the content, because EPUB is an open standard for e-books that is essentially a ZIP file containing HTML and media—HTML like your WordPress posts!

And just like that, the WordPress Block Editor can also be used to write books! The cool thing about EPUB files is that any e-book app, such as Kindle and Apple Books, can open it. So even if someone doesn’t have this editor, they can still easily read the content, which makes the files it produces portable.

The editor allows you to create a cover, so you can easily distinguish between the books or documents you write. It will also treat each heading as a chapter so you can easily navigate content when opened in an e-book reader.

The term “book” should be taken broadly. While the file that the Block Editor produces is primarily used for e-books, you can create any document with it. It’s possible to export your document to a DOCX file in case you need it, though the more complex blocks are not supported yet.

It is still very much a nascent project. There’s many features left to be added, such as revisions and the ability to open any externally created EPUB files, or even DOCX files, so keep an eye out for these in the coming weeks and months! If you’re interested in this editor, it’s all open source, and I welcome any kind of help.

For now, the demo editor is installable as a Progressive Web App (PWA) in Chrome. While it’s totally usable without installation, it does give you some nice benefits such as allowing you to open the EPUB files directly from your OS. In the future we might wrap it in proper native apps. Your feedback is welcome on GitHub!

Leave a Comment