| 1 |
Markdown with SmartyPants Filter
|
| 2 |
================================
|
| 3 |
Markdown and SmartPants created by John Gruber: <http://daringfireball.net>
|
| 4 |
PHP executions by Michel Fortin: <http://www.michelf.com/>
|
| 5 |
Packaging as Drupal filter by Noah Mittman: <http://www.teradome.com/>
|
| 6 |
|
| 7 |
Quick Start:
|
| 8 |
------------
|
| 9 |
To install Markdown with SmartyPants, move the entire "marksmarty"
|
| 10 |
directory into your Drupal installation's modules folder.
|
| 11 |
|
| 12 |
Don't forget to enable it in
|
| 13 |
|
| 14 |
administer->modules
|
| 15 |
|
| 16 |
Once installed, it will be available for both posts and comments.
|
| 17 |
You will now need to configure Marksmarty into a new or exsiting input
|
| 18 |
format for your site in
|
| 19 |
|
| 20 |
administer->input formats
|
| 21 |
|
| 22 |
I'm not going to go into too much detail about the input format system
|
| 23 |
here: I recommend that you read the Drupal handbook on drupal.org and
|
| 24 |
the help pages in Drupal itself if you need assistance.
|
| 25 |
|
| 26 |
Within an input format using Marksmarty, if you select "configure filters"
|
| 27 |
you can change a few SmartyPants options, such as en-dash support, or even
|
| 28 |
disabling it altogether if you are working in an all-UTF-8 workflow or if
|
| 29 |
you want to use your own conversion-to-entity routines.
|
| 30 |
|
| 31 |
About:
|
| 32 |
------
|
| 33 |
Marksmarty is a modified version of one of the many Markdown modules for
|
| 34 |
Drupal, styled after wiki.module in application, and meant to act as the
|
| 35 |
"Markdown with SmartyPants" formatting option in MovableType. This one
|
| 36 |
applies the filtering "live"--it does not need to be enabled per post
|
| 37 |
and does not add extra markup per post. This is because Markdown by
|
| 38 |
design is meant to coexist with HTML as well as be as human-readable as
|
| 39 |
possible when left as "source."
|
| 40 |
|
| 41 |
In addition, this module uses SmartyPants, which "educates" characters
|
| 42 |
automatically--inch-marks into curly quotes, foot-marks into
|
| 43 |
apostrophes, double hyphens into em-dashes, etc. Since "Markdown with
|
| 44 |
SmartyPants" requires a specific processing order, I combined them into
|
| 45 |
one module instead of having to warn people to set their filtering order
|
| 46 |
properly. (SmartyPants always expects HTML as its input, so it must be
|
| 47 |
run *after* Markdown.)
|
| 48 |
|
| 49 |
One thing that should be said about this is that it is also enabled for
|
| 50 |
comments. While no tag that Markdown creates is destructive (you can't
|
| 51 |
create objects or scripts) it will still create a few that you may not want
|
| 52 |
in comments. In this case, it is required that you add HTML filtering into
|
| 53 |
your input module to remove trouble tags--for example,
|
| 54 |
you may not want people to use H1s in their posts.
|