‘Markdown’ Formatting

Damn.  This is really, really cool.  Daring Fireball, who I’ve linked to on occasion in the past, has a really interesting new formatting syntax available named Markdown.  This is similar in concept to another popular formatting syntax, Textile.  What I love about the approach used with this syntax as opposed to Textile:

The overriding design goal for Markdown’s formatting syntax is to make it as readable as possible. The idea is that a Markdown-formatted document should be publishable as-is, as plain text, without looking like it’s been marked up with tags or formatting instructions… the single biggest source of inspiration for Markdown’s syntax is the format of plain text email.

For an example, take a look at the “Markdown source” of the main page.  Looks like it could pretty much be pasted into an email and still look “normal”, which can’t be said about Textile source.  You can take it all for a spin with the Dingus, which also shows a “cheatsheet” of some of the syntax options.

Now what I want is a PHP version of the actual conversion tool so that it could be made into an :ExpressionEngine: Plugin!  (For those of you interested in Markdown note that it isn’t free for all uses.)

This is an older entry and as such, it may be by a guest author or contain formatting problems / extraneous code. If you notice something wrong with the entry, please use the Contact page to let me know the entry title and issue.

Comments

it’s?  What entity is causing all those characters?  I don’t see anything in the source.  (Both apostrophe’s in the quote show that.)

Ok, but yeah, WOW.  This is max cool.  Where do we donate to get them to drag this thing out of Perl and into PHP?

Actually, this is so cool and quick, that I don’t doubt that I’ll use the Dingus tool just to make quick valid code for me with no effort.  List items, nested lists, especially.

Good grief, man!  You must have loaded up the site right after I posted the entry because I fixed those weird character entities really quickly.  No clue why it did that, either.

I think I may join the mailing list discussion for it to see if anyone’s talking about a PHP version.  I hope that someone comes out with one once Markdown gets out of Beta.

Oh come on, Chris.  Big PHP man like yourself could write this in a day…

:D No, for that I’d need to understand (and be able to write) regular expressions much, much better than I currently do.

Rock on!  Looks like there’ll be an easy way to use Markdown in PHP scripts.  In fact, that’s what the Markdown author is doing already.  You still have to have Perl working on the server, but that’s okay with me.

Now if only there were time to create a Plugin.  There are also some license questions I should probably talk to John Gruber about if this were to be made into a Plugin for EE

Yeah, I saw the email from the Markdown mailing list this morning.  Not sure how cool I am with using a PHP wrapper with a Perl script, but it is definitely a good step.

I’ve been playing with Markdown and EE, too.  More here.

John Gruber posted an entry expounding on ”why Markdown?” His reasons are exactly the same as why I immediately saw it as such a cool thing.

Lou: Thanks for sharing the link.  Definitely some cool stuff.  I certainly agree with you that having a native PHP port of Markdown would be far superior to using the “PHP wrapper” approach.  Maybe once the Markdown beta is over…

I also think you tangentially hit upon something that I’ve been contemplating myself: currently, there’s no way to introduce additional “native” formatting options into EE.  i.e. something besides none, <br />, and xhtml.  I definitely think MT has an advantage in that respect in being able to incorporate new methods as native formatting choices.

Must chat with Rick…

Woohoo!  Someone’s done a port of Markdown to PHP!  Specifically, the “beta 4” version is available.  This rocks and I can’t wait for a full on 1.0 release.

Passed the pHp script to Rick on Saturday (you knew that), as did a few other folks.

It’s important to know that MD is still beta, but this implementation is generally safe to use.  Remaining changes (from what I can tell) involve adding handlers for special markup cases, not changing what’s already stable.  I doubt anybody would have to change their Markdown source text between here and an official MD 1.0.

Custom list handling is not settled, for example split-ordered lists, lists starting with ordinals other than 1, and non-Arabic list numbering.  That’s not an issue most of the time, but I’d delay composing MD text requiring these until it’s sorted.  The Markdown email list contains a real education on the subject, which springs from the larger controversy of deprecated type, start and value attributes in the W3C’s X/HTML Strict DTDs.  It’s really just a matter of settling on the best way around an anomaly that most agree shouldn’t exist in the first place.

There’s not yet an MD syntax for definition lists, but I think there will be soon.

It should also be understood that MD will allow explicit markup within an MD-formatted text blob, whether or not that markup is valid and well-formed.  You’re on your own with explicit markup.

wrt pM and EE, there’s still the problem that text-handling plugin filters must be selected at the template level.  Ideally they’d be selectable at the field level in the control panel, where Auto-XHTML et al. are chosen.  That way, older posts formatted one way and newer posts formatted another can be rendered through the same template.  MT does this.

LQ

Leave Your Comment

Comments may be edited for content or deleted at any time. Civilized discussion is welcome. Anyone spamming, going way off topic, or otherwise being a jerk will probably be deleted or banned.

User Information

pMcode is allowed for comment formatting. pop-up mini reference

Personalization Options

Comment Security