Category Archives: Look and Feel

Using HTML and CSS to make your poetry book look its best.

Notes on ebookcraft and Tech Forum 2015 (Part 2)

Take it easy on your team, but make it easier for your readers.

Baldur Bjarnason, Unbound, “When All You Have is a Hammer, Everything Looks Like JavaScript.” (video)

A lot of #eprdctn people are casual with the word “code,” but Baldur came to reclaim it with his talk about JavaScript (1). Of the three low-level technologies for creating E-books—HTML, CSS, and JavaScript—JavaScript surely is the least-used and most-misunderstood. Partly that’s owing to its relative (lack of) importance. It’s hard to conceive of an E-book without HTML, and few E-books these days abjure all CSS styling. But JavaScript is optional and even a bit scary. Baldur wants us to try some. He offered a very direct thesis statement for his talk: (2)

My goal is to convince you of two things:

1. That software projects should start small and scale up.

2. That JavaScript is the tool for the job.

Continue reading

Advertisements

Leave a comment

Filed under Look and Feel, Publishing Industry

The Poem? How Many Divisions Does it Have?

As I put the finishing touches on Yellow Buick Review No. 2, I take a minute to reflect on what has changed, for good and ill.

This tutorial is based on the first generation of HTML/CSS techniques we figured out (with plenty of help) for our poetry E-books and E-book anthologies. The first issue of Yellow Buick Review used those techniques. The commercial offerings at Bicycle Comics all use the first generation markup/code. It works, it looks good, it’s even elegant in the right light.

We have a second-generation set of techniques, though. Those are what I’ve been using on Yellow Buick Review No. 2. The biggest difference? YBR 2 uses the div element to structure each stanza of a poem.

(Update: We now have a third-generation set of markup techniques that use media queries to serve cascading style sheets appropriate to the device in use. Most of this post is now outdated, but I’ll leave it here as a marker of our thinking in mid-September, 2014.)

Here are two stanzas of a poem formatted using 1st Gen YBR markup:


<p class="PoemStanza">Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
<p class="PoemLine">Etiam id lacus ligula. Sed libero sem, ullamcorper</p>
<p class="PoemLine">Non pulvinar eget, ultricies eu felis.</p>
<p class="PoemStanzaIndent1">Etiam lacinia metus ligula, sed convallis turpis tristique eu.</p>
<p class="PoemLineIndent1">Nam in tortor dictum odio dapibus egestas.</p>
<p class="PoemLineIndent1">Nullam id odio ut ante lobortis sodales eget sed quam.</p>

Compare that with the same poem in 2nd Gen YBR markup:


<div class="PoemStanza">
<p class="PoemLine">Lorem ipsum dolor sit amet, consectetur adipiscing elit. </p>
<p class="PoemLine">Etiam id lacus ligula. Sed libero sem, ullamcorper </p>
<p class="PoemLine">Non pulvinar eget, ultricies eu felis. </p>
</div>
<div class="PoemStanzaIndent1">
<p class="PoemLine">Etiam lacinia metus ligula, sed convallis turpis tristique eu.</p>
<p class="PoemLine">Nam in tortor dictum odio dapibus egestas. </p>
<p class="PoemLine">Nullam id odio ut ante lobortis sodales eget sed quam.</p>
</div>

The big difference? In 2nd Gen, each stanza gets wrapped in its own <div> tags. It is the <div>, not the <p>, that holds the margin-top attribute and value. 2nd Gen also uses percentages for most of its measurements, not em.

Continue reading

Leave a comment

Filed under Look and Feel, Testing and Uploading

After Step 3 Comes…Step 3?

Why does Step 3 get four blog posts? Because the “Look and Feel” of your E-book matters.

workflow illustration
The Bicycle Comics workflow has six steps, but maybe “phases” would be a better word. It’s tough for me to know the right level of detail: too little information and this blog won’t help people format their poetry E-books, too much information and I’ll scare away beginners. Once you get the hang of it, you’ll have no trouble simplifying your HTML and your CSS, streamlining your CSS, and making your internal CSS external. Those three tasks rightfully belong in Step 3, but I understand how advanced HTML/CSS coders might want to pick up the pace.

The primary points of this blog are to document the Bicycle Comics workflow for our future projects, and to provide a gathering point on the Web for best practices and conversations around electronic production (eprdctn) of poetry E-books. I’d love any and all feedback on pacing.

Tomorrow, we’ll move for real into Step 4, and I’ll talk about splitting the HTML file into sections. Meanwhile, though, I’ve made an expanded illustration of Step 3, with appropriate attention given to the tasks we’ve walked through so far.

step 3 broken down into three smaller stepsWhat do you think? How has the pacing been on each step? Let me know in the comments or on Twitter at @ybreview.

1 Comment

Filed under Look and Feel

Moving Out: Making Your Cascading Style Sheet External

Everything we’ve done so far has used an internal cascading style sheet (CSS). Now we’ll move it outside our .html files.

Remember: an .html file is a document full of code such as HTML, CSS, and JavaScript. A .css file is a page full of CSS code. An .html file can have HTML and CSS code inside it, but a .css file should have only CSS code. Bicycle Comics doesn’t use JavaScript in most of our E-books, so for these tutorials, we’ve been working with one big .html file that has both HTML and CSS inside it. With this tutorial, we’re moving 99% of our CSS into an external .css file .

External CSSThere are dozens, maybe hundreds, of tutorials that do a fine job explaining how you can move an internal cascading style sheet to an external .css file. I’ll give you just the basics, and then I’ll spend a little more time on the why, as pertains to E-book production.

In the previous post, we streamlined the CSS so that it is smaller and more elegant. Let’s pick up right there with the file “YBR_7_StreamlinedCSS.html .” (You can download all source code files for YBR for free.)

In short, we’re going to do three things:

  1. Remove the complete CSS info from our .html file with the “cut” command.
  2. “Paste” that CSS info into a separate, new document, which we’ll save as a .css file.
  3. Tell our .html file where the .css file is, so that our HTML can find our CSS whenever it needs it.

Continue reading

4 Comments

Filed under Code Samples, Look and Feel

Streamlining CSS: Chicken Sandwiches, Simplified

Let’s order lunch and streamline our code classes.

We’ve already nuked and simplified The Yellow Buick Review’s HTML/CSS. Before we make it external, let’s streamline our CSS (cascading style sheet) even more. What’s that? You don’t know how to streamline CSS code for a poetry anthology E-book? That’s no problem. Do you at least know how to order lunch? Cool! Let’s start with that. There’s an amazing fried chicken place around the corner from the office. I’ll go around and get everyone’s order: Continue reading

3 Comments

Filed under Code Samples, Look and Feel

Simplify, Simplify (CSS Portion)

Dump the needless CSS you’ve inherited from prose-oriented programs, and replace it with CSS that understands poetry’s unique needs.

illustration of HTML with internal CSS

Pardon the mess; MS Word was visiting.

Through this whole tutorial, we’ve been using cascading style sheet information that we inherited from the original MS Word save-to-HTML operation. Here’s where we set ourselves free. The CSS we have in our sample file is an inline cascading style sheet: it occupies the top third of our HTML. (Quick clarification: an .html file can hold all kinds of code—CSS, HTML, XML, javascript, php, and so forth. HTML is just one kind of information that can sit in an .html file.) There are two problems with this approach.

  • It’s inside our .html file, which is not as useful/easy as giving it its own document.
  • It’s terrible, terrible code anyway.

Just look at my highly technical illustration of the HTML file. See all the “junk” in there? That’s no good. Most poetry anthologies have enough junk as it is; let’s not put junk CSS in there, too. So, here’s what we’ll do about it:

Continue reading

5 Comments

Filed under Code Samples, Look and Feel