Raging Penguin

The random ramblings of a Linux geek

mobile menu button

Textile, the Markdown killer

2013-03-19 by TuxRag3r, tagged as webdev

I’ve been looking for a Markdown replacement, and I think Textile fits the bill nicely. Like Markdown, Textile supports lists, links, code, emphasis, and images. Unlike Markdown, Textile also supports tables, in-line class and id attributes, in-line CSS rules, and a few other features. More features translates into a greater chance of getting things right the first time, especially for tools like BlazeBlogger.

The markup is simple. This:

h3(#exampleId). This is a level 3 heading with a unique ID

p. Here is a paragraph with some %{color:#0000ff}blue text%. 

* Here
* is
* a 
* list.

# This
# is
# a 
# numbered
# list.

* Here is
** a multi-level
*** list.

# You can
** even combine
# the two.

- definition lists := Something that Textile handles well
- readable := What a Textile document is for the most part

table(sysinfo).
|_\2. Table heading|
|(col1). A|(col2). table|
|\2. example|

Gets turned into this:

This is a level 3 heading with a unique ID

Here is a paragraph with some blue text.

  • Here
  • is
  • a
  • list.
  1. This
  2. is
  3. a
  4. numbered
  5. list.
  • Here is
    • a multi-level
      • list.
  1. You can
    • even combine
  2. the two.
definition lists
Something that Textile handles well
readable
What a Textile document is for the most part
Table heading
A table
example

I still need to run a few more tests, but I think Textile will work quite well. It looks better than Markdown in my opinion, with the only exception being tables. On the other hand, tables look hideous in any markup language (also in my opinion :-\ ). It was also surprisingly easy to install. On Linux Mint (and possibly other Debian/Ubuntu derivatives), all I had to do was install the ruby-redcloth package. It comes with a program called redcloth, and all it does is convert Textile to HTML. The only command-line option it has is -o, which is used to specify the output format (the default is HTML.)

comments powered by Disqus

Built with Vim, The GIMP, and BlazeBlogger.

Valid HTML5