Pressbooks 5.4.1, McLuhan 2.4.1, and Luther 1.8.3

Pressbooks 5.4.1, McLuhan 2.4.0, and Luther 1.8.3 are now available! These releases contain bug fixes, including:

  • A fix for an issue where importing a Pressbooks XML file would ignore part content
  • A tweak to our iframe handling which attempts to convert iframes into embed shortcodes instead of deleting them for users who lack permissions to add/save iframes
  • A fallback for themes which don’t support Buckram 1.0’s updated textboxes
  • A bugfix for part titles in Luther
  • Some improved status codes for various conditions.

Pressbooks 5.4.1 requires WordPress 4.9.7.

For full changelogs, you can visit our documentation site.

Pressbooks 5.4.0, McLuhan 2.4.0, Aldine 1.4.0, and more!

Pressbooks 5.4.0, McLuhan 2.4.0, Aldine 1.4.0, Clarke 2.3.0, and Jacobs 1.1.0 are now available! These releases contain new features and bug fixes, including:

  • A reorganized admin bar for network administrators and managers
  • A lightbox feature for linked images in webbooks
  • Core support for using DocRaptor to export PDFs (no additional plugin required)
  • Core support for WordPress 4.9.6’s privacy features
  • A fix for whitespace stripped from <pre> tags in the clone tool (props to Steel Wagstaff for the bug report)
  • A fix for timeouts during PDF exports of large books (props to Leah Root for the bug report)
  • A fix for broken internal links in digital PDF exports

In the updated book themes, we are now including Buckram 1.0, the first stable release of our book component style library. Themes built with Buckram have been updated to accommodate changes in this release, which improves TOC output in PDF and EPUB files, image layout, and educational textbox styling.

For full changelogs, you can visit our documentation site.

Book Themes, Part 2: What’s Buckram?

In the early days of Pressbooks, each book theme was pretty much built from scratch, using trial and error (and adapting work that went into our first book theme, Luther). We used vanilla CSS for all book themes until Pressbooks 3.0 was released in December 2015, which supported themes built using the SCSS variant of SASS.

Our initial goal with adding SASS support to Pressbooks was limited in scope. We needed to support non-Latin character sets (Ancient Greek, Biblical Hebrew, Chinese, Japanese, Korean, and many more) but we wanted to keep book export sizes small by only bundling these additional fonts when they were needed. So we added a new theme option (Global Typography, now known as Language & Script Support) which allowed users to select additional non-Latin languages for their book which would be dynamically imported into their stylesheet during export.

After the release of Pressbooks 3.0, we realized the potential of SASS and SASS variables for allowing users to customize various aspects of their book’s theme which until then we had been forced to hard-code on a theme by theme basis (or insert by searching and replacing placeholder strings in vanilla CSS). Clarke was the first theme we converted to our new theme structure, now known as Buckram. When we released the rebuilt Clarke theme alongside Pressbooks 3.6.0 in June 2016, users gained access to a host of new PDF theme options, allowing margins, running content, and more to be customized via a settings page.

We wanted to bring this flexibility to our other themes, and since the release of Clarke 2.0 we’ve been slowly working towards that goal with Buckram. It’s been in the works for a couple of years now, but only over the past six months have we been able to dedicate significant time and developer resources to bringing it into a stable 1.0 release (coming early July!).

So, what is Buckram? Last September at our team retreat in Montréal, I demoed it to our friends at the Rebus Foundation, and Boris nicknamed it “Bookstrap”. That’s kind of what it is; like Bootstrap, Buckram is a set of styled components for book theming, with corresponding markup, that can be customized with SASS variables. It’s raw material for our book themes, so we named it after buckram, a material of physical bookbinding.

Here’s how Buckram works, in brief. A book theme imports Buckram’s component files and default variables via SASS imports, and then overrides specific variables with custom values.

Let’s say you’d like to customize the way your theme displays blockquotes. They’re found within the blockquotes partial and the corresponding variables file. If you’ve started by scaffolding a book theme with our command line tool, you’ll find the following file in /assets/styles/components/_elements.scss:

// Elements

// Override variables above this line, using the !default flag to allow further overrides.
@import 'variables/elements';

// Add custom SCSS below these imports and includes.
@import 'components/elements';

Let’s say you want to add a left border and padding to your blockquotes. You can just do this, with reference to the source variables file (or the docs):

// Elements

$blockquote-padding-left: 1em !default;
$blockquote-border-left-width: 2px !default;
$blockquote-border-left-style: solid !default;
$blockquote-border-left-color: #333 !default;

// Override variables above this line, using the !default flag to allow further overrides.
@import 'variables/elements';

Now the values you’ve supplied will override the defaults from variables/elements, giving your blockquotes a padding-left value of 1em and a border-left value of solid 2px #333. We take advantage of the SASS !default flag, which lets a variable that comes before another variable override it. In this example:

$color: red;
$color: blue !default;

The $color variable will be set to red, as it precedes a variable flagged with !default.

Using !default flags for the custom values in a theme, as demonstrated above, means that we can add theme options to allow further overrides that users control. So a theme may have a default font for body text, but in the future we’ll be able to let users customize body text by selecting an alternative typeface from a dropdown, overriding all rules where that font is referenced by changing a single variable. Moving our themes to Buckram will make the theme customization experience for Pressbooks users flexible in ways that we’ve always dreamed it would be.

So far, we’ve got three open source themes built with Buckram (Clarke, Jacobs and McLuhan). The newest member of our dev team, Daniel Fernandes, has been hard at work converting our backlog of premium themes to Buckram, and we’ll be releasing them over the coming months. We also will be expanding our documentation for Buckram, and improving the Pressbooks CLI tools for building new Buckram themes so that all Open Source users can benefit from the work that’s gone into our theme structure. We’re excited for what Buckram will let us do, and we welcome your feedback, bug reports and code contributions.

Sprint Preview: June 25 – July 6

This sprint, we’ll be working on:

Also, we’ll be off both Mondays this sprint, as it will be Québec and Canada’s national holidays, so the Open Source call will happen on Tuesday, July 3.

Pressbooks 5.3.0, McLuhan 2.3.0 and Aldine 1.3.0

Pressbooks 5.3.0, McLuhan 2.3.0 and Aldine 1.3.0 are now available. Changes include a new tool to compare cloned content with its source in the webbook, the ability to automatically collapse chapter sections in the webbook, many accessibility improvements in the webbook reading interface, and a number of bug fixes and under-the-hood improvements. Many thanks to Jonathan Hung, Lukas Kaiser, and Brad Payne for their contributions! You can read the full changelogs here: