Community Wishlist Survey 2020/Wikibooks/EPUB generation

From Meta, a Wikimedia project coordination wiki

EPUB generation

  • Problem: Currently it is difficult to create a non editable version of a completed book. In the past it was already possible for a short time to create EPUBs (of minor quality), this is gone now for a long time. Different from sometimes available PDF-versions EPUB works pretty good for reading offline and on monitors without printing. Meanwhile EPUB got quite popular for digital books with lots of readers, viewers, extensions for browsers. Static, versioned EPUB variants can be downloaded immediately by the audience, can be referenced predictable as sources without the risk of further changes for example for scientific or educational purposes in schools or universities.
  • Who would benefit: 1. The audience gets a stable version of the book to read offline, independent from wikibooks. 2. Authors can provide stable versions of their books in a defined way, including version numbers to be referenceable. 3. EPUBs can be sent as well to libraries like DNB for permanent access for a wide range audience.
  • Proposed solution: Proper, automatic EPUB3 generation: Provide a simple method to generate (and save, provide) static EPUB3 versions of a book, including the option to provide proper metadata in the OPF-file, choice of linear or non linear reading order; automatic aggregation of the complete book (currently one has to add each single chapter of the book manually for the PDF version). Note that SVGs, if used in the book, should be added as SVG files or SVG data islands within a figure of a chapter to get a proper book. Formulars can use MathML for proper markup. Addtionally EPUB3 uses the XML variant of HTML5, therefore usage of semantic markup is relevant for a meaningful, accessible book (elements like section, article, aside, nav, figure, figcaption, data, time, audio, video, table with caption, head, foot, body etc). Usage of semantic markup will require an update of the wiki-system as well to allow authors to generate proper semantic markup with new HTML5 elements, maybe additionally by adding RDFa attributes as well or the specific EPUB:type attribute. Helpful as well: An option to add (alternative) stylesheets for the EPUB.
  • More comments: Might be in general interesting to have an option to provide a book specific stylesheet already for the wikibook as well (maybe another proposal?)
  • Phabricator tickets:
  • Proposer: Doktorchen (talk) 13:44, 23 October 2019 (UTC)[reply]


  • We definitely need to do something here. Ever since we abandoned mwlib/PediaPress, things kept getting worse. The community has lost faith in any WMF-provided solution and has focused on tools like WSexport, which is great but probably harder to scale. Nemo 17:56, 25 October 2019 (UTC)[reply]
  • Agree. This would also be great for exporting wikijournal articles (currently hosted within Wikiversity and formatted using word documents). Ideally with some ability to edit the default formatting settings (e.g add custom header to each epub page from separate wiki page, definable text margins, definable image margins, single or double column). Also useful, but more difficult, the ability to modify the auto-generated epub (e.g. editable figure and table placement). T.Shafee(Evo﹠Evo)talk 12:15, 28 October 2019 (UTC)[reply]
    • It's shocking that any Wikimedia project should depend on proprietary software like Google to perform basic functions. We probably should provide hosted Nextcloud+Collabora to avoid such nefarious consequences in the interim, but an integrated solution is probably the only way to avoid the problem in the long run. Nemo 17:30, 28 October 2019 (UTC)[reply]
    • If one puts graphics and raster images within a figure element with a related class, it is quite simple to arrange this relative to the surrounding text with CSS, the same for margins different for semantic elementes like section, article, aside, blockquote etc. Rendition types like scrolling, columns can be suggested within the OPF-file, but are more critically for some user-agents, if the book contains more dimensioned features like figures, tables, long words etc. Different from word oder LibreOffice documents presentation can be quite different, much mor comfortable, flexible for the audience, therefore typically positioning of such objects might be restricted to simple media quieries to get something meaningful depending on the size of the viewport and user preferred font-size. If one has at least a generator to get all the content together within a basic EPUB, this would be already a good starting point to create a good EPUB from it manually with ebook-edit from calibre or a simple text editor. Therefore even the generation of a simple raw EPUB would be already a progress compared to the current situation. Doktorchen (talk) 17:52, 28 October 2019 (UTC)[reply]
  • I'd like to let my Wikibook accessible to print to my students or an EPUB format. Lgjunior