Dublin Library

The Publishing project

Trimming the CSS fat

Trimming the CSS fat After reading India Amos Degristling the sausage: BBEdit 11 Editionhttp://ink.indiamos.com/2015/02/12/degristling-the-sausage-bbedit-11-edition/ I thought I'd share my tricks for making CSS files as small as possible. While I learned these tricks as a front end developer they apply equally to creating content for e-books. One thing that has always stopped me from fully embracing frameworks is that they use an insane amount of code and it's really difficult to trim until I'm done with a project and, at that time, I usually don't want to have to look at CSS for a few weeks. In researching front end...

XML Wokflows: From XML to PDF: Part 1: Special Transformation

Rather than having to deal with XSL-FOhttp://www.w3.org/TR/2006/REC-xsl11-20061205/, another XML based vocabulary to create PDF content, we'll use XSLT to create another HTML file and process it with CSS Paged Mediahttp://dev.w3.org/csswg/css-page-3/ and the companion Generated Content for Paged Mediahttp://www.w3.org/TR/css-gcpm-3/ specifications to create PDF content. I'm not against XSL-FO but the structure of document is not the easiest or most intuitive. An example of XSL-FO looks like this: markup 1 2 3 4 5 Hello, world! 6 1. This is an XML declaration. XSL FO XSLFO belongs to XML family, so this is obligatory. 2. Root element. The obligatory namespace attribute declares...

XML Wokflows: From XML to PDF: Part 2: CSS

With the HTML ready, we can no look at the CSS stylesheet to process it into PDF. The extensions, pseudo elements and attributes we use are all part of the CSS Paged Media or Generated Content for Paged Media specifications. Where appropriate I've translated them to work on both PDF and HTML. Book defaults The first step in creating the default structure for the book using @page at-element. Our base definition does the following: 1. Size the page to letter 8.5 by 11 inches, width first 2. Use CSS notation for margins. In this case the top and bottom margin...

XML workflows: Converting our content to HTML

One of the biggest advantages of working with XML is that we can convert the abstract tags into other markups. For the purposes of this project we'll convert the XML created to match the schema we just created to HTML and then use tools like PrinceXMLhttp://www.princexml.com or AntenaHousehttp://www.antennahouse.com we'll convert the HTML/CSS files to PDF Why HTML HTML is the default format for the web and for most web/html based content such as ePub and Kindle. As such it makes a perfect candidate to explore how to generate it programmatically from a single source file. HTML will also act as...

XML Workflows: CSS Styles for Paged Media

This is the generated CSS from the SCSS style sheets see the scss/ directory for the source material. I've chosen to document the resulting stylesheet here and document the SCSS source in another document to make life simpler for people who don't want to deal with SASS or who want to see what the style sheets look like. Typography derived from work done at this URL: http://bit.ly/16N6Y2Q The following scale also using minor third progression may also help: http://bit.ly/1DdVbqKhttp://bit.ly/1DdVbqK Feel free to play with these and use them as starting point for your own work : The project currently uses...

XML workflows: Introduction

One of the biggest limitations of markup languages, in my opinion, is how confining they are. Even large vocabularies like Docbookhttp://docbook.org have limited functionality out of the box. HTML4 is non-extensible and HTML5 limits how you can extend it web componentshttp://webcomponents.org/ are the only way to extend HTML5 I'm aware of that doesn't need an update to the HTML specification. By creating our own markup vocabulary we can be as expressive as we need without adding complexity for writers and users and without adding unnecessary complexity for the developers building the tools to interact with the markup. Why create our...

XML Workflows: Tools and Automation

Because we use XML we can't just dump our code in the browser or the PDF viewer and expect it to appear just like HTML content. We need to prepare our content for conversion to PDF before we can view it. There are also front-end web development best practices to follow. This chapter will discuss tools to accomplish both tasks from one build file. What software we need For this to work you need the following software installed: - Java version 1.7 or later - Node.js 0.10.35 or later Once you have java installed, you can install the following Java...

Creating a Github publishing workflow

Lord of the Files: How GitHub Tamed Free Software And More was an article first published in Wiredhttp://www.wired.com/2012/02/github-2/all/ in February of 2012. It was an interesting article about a company which work I value enough to pay for the service. The article itself wasn't what caught my attention. It was the Github repositoryhttps://github.com/WiredEnterprise/Lord-of-the-Files that Wired created to go with the article. Their experiencehttp://www.wired.com/2012/02/github-revisited/ highlights a big potential of technology for the publishing process: It makes collaboration at all stages of the process easier. While researching this idea I came across this blog posthttps://github.com/blog/1939-how-github-uses-github-to-document-github All this made me think about how...

Athena: What an ofline web reading experience may look like

With the latest set of web technologies coming down the W3C/WHATWG pipeline it is now possible to create top-of-the-line responsive experiences that can also work as ofline applications. HTML5 web is more than capable of competing with native applications. Chrome and Windows apps have shown as much capability as native apps, if we let them. What needs to happen now is the developer shift to thinking about the web in terms of application logic rather than the rules we want the web to play by. Athena is a proof of concept for such an application. It uses ServiceWorkershttps://github.com/slightlyoff/ServiceWorker/blob/master/explainer.md for caching...

Video in ePub: Captioning, Storage and Other Thoughts

> Note: While I talk primarily about ePub e-books, the same process, markup and scripts apply to a standard web page. After finishing a draft of my fixed layout ePub I went back and researched the accessibility requirements for video on the web and how well supported they are in ePub e-books. I will present both the rationale and coding based on my ePub-based research and the article I wrote for the Web Platform Documentation project https://docs.webplatform.org/wiki/concepts/VTT\Captioninghttps://docs.webplatform.org/wiki/concepts/VTTCaptioning > Working with video in your ePub book presumes that you're familiar, if not comfortable, with the process of manually creating an e-book....