Pressbooks 4.0.0 “Slate”

We released Pressbooks 4.0.0 on GitHub earlier this week and finished deploying it across our hosted networks on Wednesday. Here’s what changed:

Key Features

Next-Generation REST API

Building on Brad Payne’s original REST API for Pressbooks, we’ve introduced an improved and expanded REST API based on the WordPress Core REST API infrastructure. The Pressbooks REST API v2 supports authenticated CRUD (Create, Read, Update, Destroy) access to all Pressbooks content types (front and back matter, parts, and chapters) as well as read-only access to book structure and metadata. For more information, see our REST API documentation. We’re excited to see what the Pressbooks Open Source community will do with these new API capabilities! Share your projects with us:

Enhanced LaTeX Rendering

Pressbooks’ core LaTeX renderer now produces high resolution output suitable for print! More improvements to come, and thanks for your patience as we’ve worked to improve this important feature.

Better Content Management

Want to mark all chapters for export on the Organize screen? You can do that now! Trashed something that you want back? Just navigate to Text → Trash and you can restore it. Many more improvements to come!

Pressbooks CLI

The Pressbooks command line interface is now part of Pressbooks. Want to make your own book theme? Run wp scaffold book-theme from the root of your Pressbooks install and take advantage of our intuitive SCSS-based theme structure. More commands to come — submit your ideas!

Detailed Changelog

NOTICE: Upon upgrading to Pressbooks 4.0, you will need to install the Pressbooks Book and Pressbooks Publisher themes along with any of our other open source book themes that were bundled with earlier versions of Pressbooks. For more information, see the upgrading instructions.

NOTICE: Pressbooks 4.0 requires WordPress 4.8.0.

  • Feature: REST API v2 (see #472, #763, #770, #771, #774, #778, #780, #781, #783, #785, #788, #798, #803, #804, #806, #807, #810, #812, #815, #816, #823, #832, and our API Docs
  • Feature: LaTeX outputs are now at a sufficient resolution for print applications (see #819).
  • Feature: You can now change statuses in bulk on the Organize page (see #249 and #822).
  • Feature: Deleted content can now be restored from Text → Trash (see 9283c26).
  • Enhancement: The Pressbooks CLI is now bundled in Pressbooks (see #464 and #826).
  • Enhancement: new \Pressbooks\Metadata() now returns book metadata as an implementation of JsonSerializeable (see #804 and #832).
  • Enhancement: Expanded metadata is now hidden on the Book Information page unless needed (see #804 and #832).
  • Enhancement: We now use the Human Made coding standards for PHP. Check your code before submitting a PR 👍.
  • Enhancement: We now use Laravel Mix to handle all plugin assets (see #769 and #795). Making a change in /assets/src/? With Yarn installed in your development environment, run yarn && yarn run build to build assets for distribution.
  • Enhancement: SCSS files can now be checked against our coding standards using stylelint with the command yarn run lint (see #743 and #817).
  • Enhancement: JS files have been updated to ES6 and can now be checked against our coding standards using eslint with the command yarn run lint (see #829).
  • Enhancement: Root and book themes are now distributed separately from the Pressbooks plugin — make sure you install the required themes when you upgrade! (See #756 and #799.)
  • Enhancement: Part content has been migrated to the standard content editor instead of a custom field (see #486 and #764).
  • Enhancement: The Search and Replace module has been heavily optimized, reducing memory usage by ~85% (see #759 and #793).
  • Enhancement: Additional post types can be added to the list of permitted post types for editing using the pb_supported_post_types filter (props to @SteelWagstaff, see #758).
  • Enhancement: We now use vanilla/htmlawed as our htmLawed provider (see #767).
  • Enhancement: Developers can now add new import types via the pb_import_table_cell and pb_initialize_import filter hooks (props @bdolor; see #802 and #811).
  • Enhancement: Releases are now packaged automatically via Travis (see #730 and #821).
  • Fix: DOCX and ODT files exported from Google Docs (which lack standard metadata) can now be imported without issue via the import module (see #837 and #838).
  • Fix: Images are now set to a prince-image-resolution of auto, normal rather than 300dpi for more reliably high-quality print PDF output (see #744 and #776).
  • Fix: Text suggesting that we offer printing services has been removed from the Publish page (see #784).
  • Fix: Export downloads from the webbook include the proper file extensions (props to @bdolor; see #808).
  • Fix: Current privacy settings are now displayed properly when updating book privacy from the Organize page (see #711 and #801).
  • Fix: The editor style is now enqueued with a version for cache busting (see #813 and #814).
  • Fix: The Search and Replace module no longer searches items in the trash (see 6978734).
  • Fix: Miscellaneous improvements to improve performance and reduce unnecessary error output.

Pressbooks 3.9.9

We just released Pressbooks 3.9.9 on GitHub and will be deploying it to and our other production networks today. Here’s what changed:

NOTICE: Pressbooks now requires WordPress 4.7.5.

  • Feature: A curated listed of recommended plugins is now displayed within the plugin installer (see #729).
  • Feature: Search and Replace now supports regular expressions (props to @stepmuel; see #754). This feature can be enabled by adding: define( 'PB_ENABLE_REGEX_SEARCHREPLACE', true ); to wp-config.php.
  • Enhancement: Updating a book theme will now trigger the regeneration of the webbook stylesheet (see #727 and #762).
  • Enhancement: There is now a specific template part, private.php, for the page that is displayed when a book is private (props to @stepmuel; see #755).
  • Enhancement: “Part” is now properly localized in the PDF Table of Contents (see #742).
  • Enhancement: Improved blank page rules in theme components.
  • Enhancement: The Ebook theme options tab is now hidden when Ebook dependencies are missing (props to @masaka222; see #745).
  • Enhancement: Dependency check results are now stored in site transients to reduce unnecessary function calls (see #749, #750).
  • Enhancement: Replaced variables with constants where appropriate (see #751).
  • Enhancement: Replaced uses of PATH_CURRENT_SITE with network_home_url() (props to @jeremyfelt; see #734).
  • Enhancement: Current $post is now included with wp_enqueue_media() in symbionts/custom-metadata (props to @jeremyfelt; see #735).
  • Fix: Removed the sticky navigation bar that overlapped webbook content (props to @pbstudent for the bug report; see #747 and #760).
  • Fix: Fixed an issue where running content strings would not be populated when a custom title page was used (see #496 and #761).
  • Fix: Fixed an issue where the book title would not update properly (see #542 and #746).
  • Fix: Fixed issues that arose when pb_language or user_interface_lang were not set (props to @monkecheese for initial bug report and testing; see #738, #739, #740).
  • Fix: Fixed an issue where a database error would be thrown when installing on a utf8mb4 MySQL instance (props to @jeremyfelt; see #733).

Pressbooks working with Ryerson University on eCampusOntario grant: “Open Publishing Infrastructure”

We are very very excited to announce that we’re working with eCampusOntario and Ryerson University to improve Pressbooks as an Open Textbook authoring tool, under the just-announced eCampusOntario project: "Open Publishing Infrastructure for Ontario Post-Secondary Educators, Learners."

Most of the development work we undertake under this grant will be released as open source improvements to the Pressbooks GPL codebase — so anyone using Pressbooks will benefit.

Pressbooks as we’ve dreamed since, well, 2010

This project is going to allow us to develop some of the most exciting capabilities of Pressbooks, something we have been dreaming of since, well, since I started working on Pressbooks way back in 2011.

In particular, we will be making some very visible improvements, including a redesign of the “webbook” interface (for reading Pressbooks books online) and a refresh of the standard catalog page for dedicated Pressbooks instances (such as this one, hosted by BCcampus).

APIs and Cloning

But the more exciting work is going on under the hood, where we’ll be migrating the Pressbooks API (built by Brad Payne from BCcampus) to the WordPress core REST API, extending the metadata capabilities, and building “cloning” of Pressbooks books into Pressbooks core (also leaning on work done by Brad).

This means that you’ll soon be able to point at any openly-licensed Pressbooks book in the universe, and pull it into your own Pressbooks environment, to enable the famous 5Rs of Open Educational Resources: Retain, Reuse, Revise, Remix, Redistribute.

An API for Books (finally!)

What does this mean? This means Pressbooks will, finally, be able to fulfill a promise I’ve been thinking about since I started Pressbooks back in 2011: an API for books.

Indeed, looking through some archives, I am gratified to see that we’ve managed to build a lot of what I laid out in my May 2010 (!!) article for O’Reilly: “An Open, Webby, Book-Publishing Platform.”

More exciting is that we are now poised to move beyond that initial set of ideas, and offer something I wrote about a year later, in September 2010 (!), An API for Books.

It’s taken a while, but we’re getting there!

The past number of years have been an exercise in patience: We have always had dedicated and faithful users—from self-publishers to academic presses—who love Pressbooks because of how easy it makes formatting books for print and ebook stores.

But the real power of Pressbooks, from my perspective, has always been hidden in the plain sight of the web: all Pressbooks books are web-native from the start.

Open Textbooks and the Web

The Open Textbook movement is really the first coherent usecase for Pressbooks that has emerged to embrace the potential in Open, webby book publishing systems. So, it’s been gratifying to see the Pressbooks open source software being adopted in the Open Textbook world, by such leading projects as: Lumen Learning, BCcampus, and OpenSUNY.

At the same time, it’s been a challenge for a small company like ours to support the exciting Open Textbook possibilities of Pressbooks with our limited resources. This new project will enable us to move much faster towards an Open Textbook future we hope for.

Working with Ryerson and eCampusOntario

We’re thrilled to be working with some great people at Ryerson University on this project: Wendy Freeman, Fangmin Wang, Ann Ludbrook, Sally Wilson, and the rest of their team. And we’re excited as well to be working on an eCampus Ontario project: David Porter and Lena Patterson have a a great vision for the future of Open Textbooks in Ontario, and we’re excited to be part of it.

If you’d like more information about Pressbooks and Open Textbooks, get in touch!

Dac is back!

Good news for Pressbooks, Dac is back! From the blog:

Big news at Pressbooks headquarters: Dac is back!

Dac Chartrand worked in the early days of Pressbooks (taking over from the also-awesome Janina Szkut), and did a huge job of re-architecting the system back in 2011, in particular moving Pressbooks from a LaTeX based PDF output system (ouch!) to an all-HTML+CSS system, including PDF. Yay, web technologies!

[more … ]


Pressbooks just went live on and all of our other production networks. Here’s what changed:

NOTICE: Pressbooks’ PHP version requirement (>= 5.6) and WordPress version requirement (>= 4.7.3) can no longer be overridden. Before installing Pressbooks 3.9.8, please ensure that your system has been upgraded accordingly.

  • Fix: Switched to an unmodified version of htmLawed to fix a regression in vanilla/htmlawed which was stripping paragraph tags from blockquotes (see #723).
  • Fix: Fixed an issue where users would be informed that their theme had been unlocked when saving Export options even thought it was already unlocked (see #722).
  • Fix: Fixed an issue where wp-cli would give a permissions error because of the \Pressbooks\ThemeLock::isLocked() check (see #721).

Pressbooks 3.9.8

Pressbooks 3.9.8 just went live on and all of our other production networks. Here’s what changed:

NOTICE: Pressbooks’ PHP version requirement (>= 5.6) and WordPress version requirement (>= 4.7.3) can no longer be overridden. Before installing Pressbooks 3.9.8, please ensure that your system has been upgraded accordingly.

  • Feature: Themes can now be locked a particular version. The theme’s stylesheets and other assets will be copied into the book’s media directory and used for future exports (see #657, #704).
  • Feature: The paragraph separation option is now available for webbooks (see #655, #696).
  • Feature: The section openings PDF theme option now supports additional options (see #450, #691).
  • Feature: When export sharing is enabled, the download links are now stable, e.g. /open/download?type=pdf (props to @rootl for the suggestion; see #684, #699).
  • Enhancement: Pressbooks now supports third-party export formats (see #385 and #674).
  • Enhancement: \Pressbooks\Options field display functions have been refactored to use an array of arguments instead of a list of parameters (see #648, #697) [BREAKING CHANGE].
  • Enhancement: SCSS overrides have been moved into their respective theme options classes (see #452, #701).
  • Enhancement: Webbook interface styles have been separated from the Luther book theme’s content styles (see #656, #708).
  • Enhancement: Webbook stylesheet and script enqueuing has been clarified and simplified (see #396).
  • Enhancement: Searching now excludes non-Pressbooks post types (props to @colomet for the report; see #706, #707).
  • Enhancement: Front-end scripts are now loaded asynchronously (props to @bdolor; see #681).
  • Enhancement: htmLawed is now a Composer dependency (see #702).
  • Enhancement: The sassphp dependency is no longer required (see #693).
  • Enhancement: The SaxonHE dependency check can now be overridden (see 7ea32fe).
  • Enhancement: perchten/rmrdir is now used for recursive directory removal (see 37ab804).
  • Enhancement: Added \Pressbooks\Utility\rcopy() function for recursive directory copying (props to @blobaugh for the example code; see 52b087b).
  • Enhancement: Added pb_dependency_errors filter hook for suppression of dependency errors (see #719).
  • Fix: Images on custom title pages are now exported as expected in EPUB and Kindle (see #690, #698).
  • Fix: The diagnostics page now functions as expected on the root blog (props to @colomet for the report; see #688, #695);
  • Fix: Print PDF exports are now available for download when export sharing is enabled (props to @bdolor; see #677).
  • Fix: Numberless chapters no longer display a lonely period in PDF outputs from SCSS v2 themes (props to @thomasdumm for the report; see #670).
  • Fix: Importing as a draft now works for EPUB imports (props to @thomasdumm for the report; see #668).