Write Faster in Drupal With the Markdown Module
Are you tired of having to type HTML tags like
With the Markdown module,
"Markdown" is a simple markup language that aims to be quick and readable.
You bold words like
But Markdown goes beyond simple formatting. You can link to About.com like
Read the full Markdown syntax here. You'll find that almost all the HTML tags you'd ever think to use can now be entered in a simpler, quicker, more readable format.
Markdown is not specific to Drupal. If you installed the
With the Markdown module you get an text format filter. This means you can write or paste Markdown right into your content box, and Drupal will turn it into HTML.
You download and enable Markdown as you would any module.
But because Markdown is a text format filter, it won't "just work". You need to enable this filter in a text format.
Rather than add Markdown to one of the default text formats ("Filtered HTML" and "Full HTML"), I generally add a new text format specifically for Markdown.
As this issue explains, if you enable the filter that strips dangerous HTML tags, Markdown needs to come first. Among other possible problems, Markdown uses
On the other hand, putting the HTML filter after Markdown means that any "dangerous" tags that Markdown outputs (like a
The Markdown module page also notes that if you enable
Markdown can save you so much time. But to get the maximum benefit, consider using a text editor like Notepad++ or Emacs that uses syntax highlighting. With syntax highlighting,
Just as with HTML, syntax highlighting helps prevent mistakes.
Unfortunately, I don't know of any way to get syntax highlighting in the actual "edit box" in Drupal. But you should really be writing articles in a text editor first anyhow. Even with the best CMS, your browser can crash at the most inopportune times.
<strong>
and <em>
as you write content for your Drupal site? But do you also want to avoid a clicky WYSIWYG solution? Congratulations, you've got a solution: Markdown.With the Markdown module,
**bolding**
a word is as simple as a couple asterisks on either side.What Is Markdown?
"Markdown" is a simple markup language that aims to be quick and readable.
You bold words like
**this**
, and italicize like _this_
. If you've ever written email in plain text, or edited a Wikipedia article, you've already got the basic idea. (Although Wikipedia uses a slightly different markup.)But Markdown goes beyond simple formatting. You can link to About.com like
[this](http://D106)
. You can make a list like this:- one- two- three
Read the full Markdown syntax here. You'll find that almost all the HTML tags you'd ever think to use can now be entered in a simpler, quicker, more readable format.
Markdown In Drupal
Markdown is not specific to Drupal. If you installed the
markdown
program on your computer, you would have to:- Compose your article in a text editor using the Markdown syntax
- Use
markdown
to convert that Markdown text file into HTML - Paste the HTML into Drupal.
With the Markdown module you get an text format filter. This means you can write or paste Markdown right into your content box, and Drupal will turn it into HTML.
Installing Markdown
You download and enable Markdown as you would any module.
But because Markdown is a text format filter, it won't "just work". You need to enable this filter in a text format.
Rather than add Markdown to one of the default text formats ("Filtered HTML" and "Full HTML"), I generally add a new text format specifically for Markdown.
Watch the Order of Filters
As this issue explains, if you enable the filter that strips dangerous HTML tags, Markdown needs to come first. Among other possible problems, Markdown uses
>
to indicate a blockquote. If the HTML filter comes first, >
will get changed into >
, and Markdown won't recognize it.On the other hand, putting the HTML filter after Markdown means that any "dangerous" tags that Markdown outputs (like a
<table>
), will get stripped. However, this is good. If you're enabling the HTML filter, you need to think through which tags you want to allow anyway.The Markdown module page also notes that if you enable
Convert URLs into links
, and it comes before Markdown, this will cause trouble. Markdown also does things with URLs.Consider a Text Editor With Syntax Highlighting
Markdown can save you so much time. But to get the maximum benefit, consider using a text editor like Notepad++ or Emacs that uses syntax highlighting. With syntax highlighting,
**bold**
words will actually appear bold, links will be a different color, and so on.Just as with HTML, syntax highlighting helps prevent mistakes.
Unfortunately, I don't know of any way to get syntax highlighting in the actual "edit box" in Drupal. But you should really be writing articles in a text editor first anyhow. Even with the best CMS, your browser can crash at the most inopportune times.
Source...