Markdown and Kindle Formatting, Part 2
To understand Markdown, it’s first helpful to get a handle on the coding language it produces, HTML. HTML stands for hypertext markup language. That sounds a bit scary. It isn’t. HTML is just a longhand form of text markup, or word processing. The concept is simple and the code HTML needs is straightforward. I’ll give a couple of examples to demonstrate.
A Quick introduction to HTML
If you want to italicize a word, wrap it in a pair of tags. The word <em>italics</em> is surrounded by tags that describe it’s function. The em is short for emphasis. Italicizing a word emphasizes it, hence the em. When the document is read by an ebook reader or regular web browser you will see italics instead. If you want a section of text to be in boldface, then you want strong text and use the <strong> tag. It looks like this ##strong##.
Notice the angle brackets around the em. Start with a left angle bracket, which in math is the less than symbol, lt. Add the tag. Then close it with the right angle bracket, or the greater than sign, of you prefer mathematical terms. The ending tag has a / to indicate that you want to terminate that particular command. It works like this:
<h1>, <h2>, and <h3> give you 3 successive levels of headings. You can use up to 6 levels, but 3 usually suffice. All tags for the form of HTML that ebooks use are container tags. That means that you need to end the tags with the appropriate closing tags, just like we did with the <em> tag.
<h1>Heading 1</h1>
<h2>Heading</2>
<h3>Heading 3</h3>
<p>Paragraph tags work the same way.</p>
That’s pretty easy, if a bit awkward and slow. For fiction, that’s really all you need, except for the occasional extended quote. As you might guess, the tag for that makes sense, too. It’s the <blockquote> tag. Here’s an example:
<blockquote>Everyone has the obligation to ponder well his own specific traits of character. He must also regulate them adequately and not wonder whether someone else’s traits might suit him better. The more definitely his own a man’s character is, the better it fits him. -Cicero#</blockquote>
That’s all the formatting you would use in most fiction, short stories or novels. Nonfiction often requires lists and images. Poetry needs the ability to vary indentation and force non-paragraph line breaks. Tags for those elements are as simple. I won’t go into those now as this isn’t really an HTML tutorial.
As you can see, writing HTML is straightforward. It is also awkward. What Markdown does is offer an easy, and unobtrusive way to write that creates a product that is simple transform into the HTML that ebook creation services love. Remember, HTML is the native language of ebooks and translation services for Kindle, Nook, iBooks, and Smashwords will take the HTML and spin it faultlessly into their special formats.
A Quick introduction to Markdown
So how does Markdown work? It offers an unobtrusive shorthand for HTML. In many cases you won’t even notice it. Paragraph formatting is automatic. Two returns between blocks of text create paragraph tags. For section or chapter headings add a simple hash mark #. One hash mark gives a level one, or large heading. Two hash marks translate into a level two heading and so forth. You can get a full listing of Markdown syntax at Daring Fireball.
#A Level One Heading
##A Level Two Heading
Surround a word or phrased with single hash marks and it gets italicized. Underscores also work. Surround it with two hash marks and you make the text bold. Use a single right angle bracket (greater than sign and the following text turns into a blockquote.
So here’s my first chapter written in Markdown, may the author’s from whom I’ve borrowed these lines not turn over in their graves:
#Chapter 1
>I never teach my pupils. I only attempt to provide the conditions in which they can learn. -Albert Einstein
It was a dark and stormy night. It was the best of times, it was the worst of times. Call me Ishmael. In my younger and more vulnerable years my father gave me some advice that I’ve been turning over in my mind ever since.
If you really want to hear about it, the first thing you’ll probably want to know is where I was born, and what my lousy childhood was like, and how my parents were occupied and all before they had me, and all that David Copperfield kind of crap, but I don’t feel like going into it, if you want to know the truth.
Whether I shall turn out to be the hero of my own life, or whether that station will be held by anybody else, these pages must show.
The human race, to which so many of my readers belong, has been playing at children’s games from the beginning, and will probably do it till the end, which is a nuisance for the few people who grow up.
As you can see, writing with Markdown is easy. Here’s the resulting HTML:
<h1>Chapter 1</h1>
<blockquote>I never teach my pupils. I only attempt to provide the conditions in which they can learn. -Albert Einstein</blockquote>
<p>It was a dark and stormy night. It was the best of times, it was the worst of times. Call me Ishmael. In my younger and more vulnerable years my father gave me some advice that I’ve been turning over in my mind ever since.</p>
<p>If you really want to hear about it, the first thing you’ll probably want to know is where I was born, and what my lousy childhood was like, and how my parents were occupied and all before they had me, and all that David Copperfield kind of crap, but I don’t feel like going into it, if you want to know the truth.</p>
<p>Whether I shall turn out to be the hero of my own life, or whether that station will be held by anybody else, these pages must show.</p>
<p>The human race, to which so many of my readers belong, has been playing at children’s games from the beginning, and will probably do it till the end, which is a nuisance for the few people who grow up.</p>
For next time:
That’s enough for now. There are a few more details to get a handle on, but that’s what installments are for.
Related articles
- Use Markdown For Easy Web Writing (lifehack.org)
- Markdown and Me (openmymind.net)
- HTML basics (santhoshkumar533.wordpress.com)
If you enjoyed this post, please consider to leave a comment or subscribe to the feed and get future articles delivered to your feed reader.





