View Raw Source

2009-01-31 01:54:57

So I write this blog using Markdown because I'm a human and writing stuff <strong>with</strong> tags is just WRONG. Thankfully, Gruber solved this problem by writing markdown.

Now on the markdown page he says:

The best way to get a feel for Markdown’s formatting syntax is simply to look at a Markdown-formatted document. For example, you can view the Markdown source for the article text on this page here:

(You can use this ‘.text’ suffix trick to view the Markdown source for the content of each of the pages in this section, e.g. the Syntax and License pages.)

And ever since I noticed that I've always read his articles using the '.text' trick. One of the plugins I've been meaning to write for habari is one that replicates this '.text' behaviour. So tonight I decided to try and write it, started picking through the Plugin documentation in preparation. Got a bit stuck with it as I've been out of the habari development loop for a few months, popped into #habari and asked if I was thinking along the right lines.

Few minutes later Owen pops up and sends me a link to plaintext.plugin.php, which does exactly what I was trying to do! Couple of tweaks later (switching it to '.text' instead of '.md') and its installed and working on this blog. Feel free to view the raw source of this post. Or any other post on this site.

Updated 2009-01-31

Added to the habari-extras repo as the Plaintext plugin.

2 Comments on View Raw Source

  1. I don't know if I have a place to use this plugin, but I really like the design decision to generalize it as a post source view, rather than making it a part of or otherwise tying it to the Markdown plugin specifically.

  2. Hi Caius

    OK I'm sold ! I used to think the mini icons provided by the 'markup' (no relation) habari plugin was the way to go so I created raw HTML and used handy buttons to insert those pesky HTML tags but you've convinced me to give 'markdown' another go.

    Here's my question and the reason I didn't persist when I used markdown previously (back on my old WP blog).

    If the home page displays article summaries (like yours), how does markdown guard against an opening tag (e.g. <blockquote>) not being closed ? For example, if the closing tag (</blockquote>) doesn't appear in the summary text and isn't displayed on the home page.

    If the tag isn't closed, then (obviously) your blog is rendered as a long, massive stream of quote/bold/italic/whatever. Which looks crap and rather defeats the object.

    Also, seeing as you're such good mates with John Gruber :-), surely you can politely ask him for a link to the markdown plugin for Habari. MT, BBEdit and Blosxom are all listed. All he needs is the words out of the README. There is a README, isn't there ?

    Peace, love, Habari.

About You