The Publishing Project

Building XML programmatically

XML still hunts us. There are still XML vocabularies that are necessary for the web to work well. One of these vocabularies is SVG, a means to create vector and mixed vector/raster graphics for the web. Writing these elements by hand can be error-prone and it’s definitely not fun. When researching another project (how to create a content.opf file for epub), I found the xmlbuilder2 library and it was a huge help for creating basic XML, including nested elements. So I started looking at how to use xmlbuilder to create basic SVG elements that I can reuse in my projects.

Revisiting multi-column text

This set of features related to multi-column text is near and dear to my heart. I first researched this feature when I wrote about it for the Web Platform Documentation Project (since retired). The idea is to let the browser take care of creating the columns and the details about the columns, the gap, and other elements. We can also play with headers and how they span across the columns. Browser support, as always, is the stumbling block for using columns across browsers but it appears to be better than when I first tried it. I searched caniuse.com for column-

Using gulp-libsquoosh to replace Imagemin

All my Javascript projects include imagemin, a tool that allows you to convert images between different formats and do some level of processing to the images as it converts them. Unfortunately, the project is in life support mode and the original maintainer stopped working on it years ago according to the pinned issue in the repository issue tracker. So it’s time to take a look at the alternatives and see how well they work in a Gulp-based Javascript project. Squoosh is an image compression and manipulation tool. The main difference between Squoosh and Imagemin is that Squoosh has created WebAssembly

Creating epub3 content.opf file

One of the hardest files in an epub book is the content.opf manifest file. This file tells an epub reader what files are in a specific rendition of an ebook. There are three components to a content.opf file: Metadata Provides information about the book using a combination of meta tags and Dublin Core metadata elements The normative reference is in the EPUB 3.2 package specification metadata section Manifest The manifest element provides an exhaustive list of the Publication Resources that constitute the given Rendition, including the media type, the file path and the media encoding See the Manifest section of

Plugin Topics: JSON Block Configuration

Starting in WordPress 5.8, there is a JSON metadata file we can use to register blocks. The block.json file is the block-level equivalent to theme.json and is now the preferred way to register blocks. The following example contains a block.json definition for a fictional my-plugin/notice block. { “apiVersion”: 2, “name”: “my-plugin/notice”, “title”: “Notice”, “category”: “text”, “parent”: [ “core/group” ], “icon”: “star”, “description”: “Shows warning, error or success notices…”, “keywords”: [ “alert”, “message” ], “version”: “1.0.3”, “textdomain”: “my-plugin”, “attributes”: { “message”: { “type”: “string”, “source”: “html”, “selector”: “.message” } }, “providesContext”: { “my-plugin/message”: “message” }, “usesContext”: [ “groupId” ], “supports”: {