49

I've for some time enjoyed using Markdown to handle straightforward text formatting, image presentation and the like, which I use for keeping notes, or drafting blog content. I'm aware that different file formats can be used as sources for ebooks, but given that Markdown doesn't have as many formatting capabilities as, say, Word, can it be used for laying out and formatting ebook content?

8 Answers 8

22

The answer is yes. You can use John MacFarlane's Pandoc to directly generate EPUB 2 or EPUB 3 from markdown.

22

Leanpub.com accepts Markdown only from authors. They use some extensions like tables or source code embedding to take most of the pain away.

Markdown doesn’t offer such a fine control like TeX/LaTeX, but most ebook readers wouldn’t honor that anyway. You can take a look at the free samples (example) to judge the result.

I think, yes, Markdown is an excellent format to write ebooks.

13

Yes, I think it may be used and, in my opinion, it makes it easier to layout and format the whole text. There are tools that allow you to type using Markdown and do export to epub and mobi formats among others.

One example of such tools is Draft


UPDATE:

I have recently edited and published a book using Markdown and the gitbook project. It worked perfectly. I will do it again!

1
  • 2
    pandoc is also great for converting markdown to HTML/ePub and many more formats
    – Sourabh
    Commented Feb 14, 2014 at 2:47
6

Markdown does not seem to have many formatting options, but it looks like it is being used for creating ebooks, since there seem to be many books about creating ebooks from markdown from a google search. An example blog: http://ianhocking.com/2013/06/22/writing-a-novel-using-markdown/

https://web.archive.org/web/20210506225431/https://ianhocking.com/2013/06/22/writing-a-novel-using-markdown/

3
  • Unfortunately the link is dead now. Commented Sep 28, 2023 at 15:58
  • 1
    @OliverMason fixed.thanks.
    – user17915
    Commented Sep 29, 2023 at 0:00
  • Thank you! I didn't expect any reaction after 10 years :) Commented Sep 29, 2023 at 8:48
5

Markdown is an excellent shortcut to HTML, especially for non-technical writers and editors. Some publishing services (Leanpub, Gitbook, PenFlip and others) make the most of this.

The drawback with most markdown-based publishing services currently is that they use flavours of markdown that don't support classes (technically, 'attribute definitions' for elements). That is, you can't use classes to distinguish, say, an epigraph from a dedication, or a normal blockquote from a 'box' blockquote. Without classes, you cannot reproduce the typography required for high-quality books more complex than a novel.

For attribute support, the best flavour of markdown to use is probably kramdown. Jekyll, and therefore GitHub Pages, support kramdown by default.

I use Jekyll to create book-ready HTML from markdown for clients, using this workflow we developed for our own book-production work. Used with Sigil for ebook assembly and PrinceXML for PDF output, we're producing book interiors as good as anything we get from InDesign.

1
  • Markdown Extra supports that, and Pandoc supports Markdown Extra. Issue solved. Commented Sep 29, 2019 at 7:58
4

Markdown is fine for most common textual purposes, but if you are creating complex material, or material which you want to re-use for other purposes, you might want to look at one of the many XML formats. Both DocBook and TEI are in extensive use in publishing for complex work, but at the moment you still need to learn how XML works in order to use an XML editor properly. There are many toolchains for turning XML into EPUB and other formats.

In general, it's better to have the master file in a powerful and comprehensive format, so that leaner or simpler formats can be generated from it. If you use something too lean for the master format (and Markdown tends towards the lean end of the spectrum), you risk running out of steam when you need to do something difficult or complex.

3

I have used Markdown to create content, then used Pandoc to convert that content into ePub format for reading on iBooks.

Markdown does not have a lot of layout features compared to LaTeX.

If you want something fast and quick for images, simple tables and text, Markdown will work great.

If your intent is to have finer layout control, with drop caps and the like, you might want to look at something else, like Adobe InDesign.

1
  • Drop-caps and such can be managed with CSS, so one can still do everything programmatically. InDesign is not needed. If one still wants something like that, Scribus is an open source/free product that is akin to InDesign. Commented Sep 29, 2019 at 7:59
1

(While the original question is older, my answer is relevant to show that Markdown continues to have value in more cases than you think, even as Markdown evolves.)

Yes. I've converted several PDFs into text, then Markdown, and then into an EPUB. Markdown is not as "cluttery" as say, raw HTML, so it's easier to read. And it's easier for beginners to learn for a markup language. Plus, any Markdown can be converted to many different formats given the right convertor program, like Pandoc.

So, Markdown is valuable because it's a starting point to make other formats. Part of my job is finding a "base format" for organized data, and text, so I can convert that to other formats for a wide variety of customers. So the concept of a "base format" is very important to me.

Markdown is valuable for ebooks because most ebook readers only support a very small subset of the EPUB spec anyway. So while Markdown is limited, that's exactly what you want so your book reads on the greatest number of reader software and hardware.

Weak points of any markdown includes ambiguous interpretation of the formatting, something Commonmark is trying to address.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.