Tuesday Tip: Make plain text pretty with Markdown

markdownAs we talked about last week, plain text is amazing. It’s an incredibly flexible format, offering many benefits, with next to no downside. On the other hand, plain text is… well, ‘plain’. No font changes. No bold or italic. No images. It’s like a world with no picture books!

“See! That’s why I need Microsoft Word!”, you might say. Well, actually I’d like to offer a better alternative… plain text, yet again. Specifically, plain text written in a style called Markdown. It was developed by John Gruber (of Daring Fireball fame) and is a way of writing plain text so it can be converted to and displayed as HTML.

Now you may think: “Wait! I’m not making web pages! I’m writing notes!” Markdown is being used, more and more, for all kinds of writing. A simple search for Markdown on a site like MacUpdate will yield many options for Markdown editors. In fact, DEVONthink supports creating and editing Markdown documents* natively. I am currently using Markdown in over half my customer support work.

Instead of using formatting, like bold and italics, you type simple characters to specify the formatting and other features. The resulting text is both easily readable for humans and applications that support Markdown can display (‘render’) your writing graphically.

Here are a few examples of the syntax:

  • Use two asterisks around words to make them bold.
    “DEVONthink is an **information** manager” will display as: “DEVONthink is an information manager”
  • An underscore around words will make italics.
    “That _is_ the best option.” displays as “That is the best option.”
  • Or combine the two.
    “Save your database locally _(but **not** in a cloud-synced folder!)_”, will appear as “Save your database locally (but not in a cloud-synced folder!)

As far as what the formatting looks like, if you want some control over the fonts, colors, etc., you can link to Cascading Style Sheets (CSS) or add styling in the Markdown to customize the look. This isn’t necessary but gives you more options. Many apps have options to export to different formats like HTML or PDF. And because the files are simply plain text, you have the option of switching to other applications without having to change the files.

For more info, check out the MultiMarkdown Guide. And Macdown is a nice free Markdown editor with a live preview to see the formatting as you type.

* There are many flavors of Markdown being created. DEVONthink currently supports Fletcher Penney’s MultiMarkdown, as a more standard flavor.

10 Responses to “Tuesday Tip: Make plain text pretty with Markdown”

  1. mrkwnzl says:

    Can I change the CSS used for rendering in DEVONthink, or is that only possible with third-party editors/viewers?

    Thanks!

  2. Mio says:

    Good article.
    However, I’d like to know what’s the advantage(s) of markdown over RTF file? In RTF I can immediately format textnin any way I want. For instance, I use quite a bit of highlighting and, correct me if I’m wrong, Cascading Style Sheets (CSS) looks a bit difficult to implement.

  3. @ mrkwnzl: Currently no we’re afraid.

  4. @ Mio: Markdown can be read on any computer system and even with the most primitive readers. RTF may or may not render correctly on other operating systems. And e.g. iOS does not come with a proper RTF editor at all.

  5. Nancy Hildebrandt says:

    I’ve spent a half hour searching documentation and give up. When you say ” In fact, DEVONthink supports creating and editing Markdown documents* natively. ” what exactly do you mean? I took a text document and surrounded a word with a couple asterisks on each side. The result is a word with a couple asterisks on each side. Does DevonThink render that in some view that I don’t know about? When I look at the Data > Convert menu, I sure don’t see Markdown as a choice.

  6. Mr. E says:

    I use markdown for almost al of my notes, and am a new (and satisfied) user of DT.

    But one feature I would *love* to have, is customization of the CSS file used to render to HTML. Or some other form of making the current markdown preview somewhat more pleasant to the eye.

    Please consider this a request, DT devs!
    I’d love to be able to skim through my markdown notes and see them in a more legible fashion (without converting them to HTML first, and giving up the versatility of markdown).

  7. Jim Neumann says:

    Have you considered using internal CSS in the Markdown file? I use this all the time.
    You can also use a linked styleSheet using “file:///“ in the href.
    You could even make a Markdown file with a styling option like those and save it as a Template via File > Export > as Template.
    Cheers!

  8. Mr. E says:

    Oh wow, thanks so much Jim! Never knew I could do that!

  9. Jim Neumann says:

    My pleasure. Cheers!
    :^)

Leave a Reply

Note: Blog comments are for commenting on a post. They are unsuitable for proper customer support, honestly. Please consider writing to our support team instead.