{"id":149,"date":"2004-03-10T04:12:00","date_gmt":"2004-03-10T04:12:00","guid":{"rendered":"http:\/\/jclark.org\/weblog\/WebDev\/Blosxom\/Markdown.html"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-30T04:00:00","slug":"Markdown","status":"publish","type":"post","link":"https:\/\/jclark.org\/weblog\/2004\/03\/10\/Markdown\/","title":{"rendered":"Markdown"},"content":{"rendered":"<p><a href=\"http:\/\/daringfireball.net\">John Gruber<\/a> has released <a href=\"http:\/\/daringfireball.net\/projects\/markdown\/\">Markdown<\/a>, a plain text to (X)HTML language and tool.  It is similar in function to <a href=\"http:\/\/textism.com\/tools\/textile\/\">Textile<\/a>, which I&#8217;ve been using since I started this blog.  <a href=\"http:\/\/daringfireball.net\/projects\/markdown\/\">Markdown<\/a>&#8216;s formatting is inspired by plaintext e-mail formatting, and has the added advantage that Markdown-encoded text is, basically, legible; even more so than Textile-encoded text.  To really see this in action, look at the <a href=\"http:\/\/daringfireball.net\/projects\/markdown\/index.text\">Markup-encoded version of the Markup home page<\/a>.  This really sold me on the idea of using Markup here on the blog.  At some point I intend to do a rigorous, feature-by-feature comparison of the two at some point; for now I just want to play with Markdown.<\/p>\n<p>Markdown (the tool) is implemented in Perl, and is both a command-line tool and a <a href=\"http:\/\/moveabletype.org\">Movable Type<\/a> plugin in a single file.  I had intended to write a <a href=\"http:\/\/blosxom.com\">Blosxom<\/a> plugin for Markdown, however, Markdown.pl is also a Blosxom plugin!  Very nice.  <strong>One caveat<\/strong> &#8211; You must rename the file to <code>Markdown<\/code> in order for Blosxom to recognize it as a plugin. <\/p>\n<p>As written, Markdown-as-Blosxom-plugin processes every entry as Markdown-encoded text.  This would require me to convert all of my existing entries, which I&#8217;m not looking to do.  Instead, I modified Markdown.pl slightly to work like the <a href=\"http:\/\/blosxom.com\/plugins\/text\/textile.htm\">Blosxom Textile plugin<\/a>&#8211; if the Blosxom story header includes <code>meta-markup: markdown<\/code>, then Markdown is invoked to process the story text (requires the <a href=\"http:\/\/www.blosxom.com\/plugins\/meta\/meta.htm\">meta plugin<\/a>).  The modified <code>story()<\/code> looks like this:\nsub story {\nmy($pkg, $path, $filename, $story_ref, $title_ref, $body<em>ref) = @<\/em>;<\/p>\n<pre><code>    if ($meta::markup eq &#039;markdown&#039;) {\n        $$title_ref = Markdown($$title_ref);\n        $$body_ref  = Markdown($$body_ref);\n    }\n    1;\n}<\/code><\/pre>\n<p>So how does it work?  You&#8217;re soaking in it.  This entry is written Markdown.  So far, so good.  I&#8217;ll post again later on my Markdown-vs-Textile impressions.<\/p>\n<p><strong>Update:<\/strong> The code above is obsolete.  A much more robust version is <a href=\"http:\/\/jclark.org\/weblog\/WebDev\/Blosxom\/Markdownredux.html\">here<\/a>.<\/p>","protected":false},"excerpt":{"rendered":"<p>John Gruber has released Markdown, a plain text to (X)HTML language and tool. It is similar in function to Textile, which I&#8217;ve been using since I started this blog. Markdown&#8216;s formatting is inspired by plaintext e-mail formatting, and has the added advantage that Markdown-encoded text is, basically, legible; even more so than Textile-encoded text. To [&hellip;]<\/p>","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[],"class_list":["post-149","post","type-post","status-publish","format-standard","hentry","category-blosxom"],"_links":{"self":[{"href":"https:\/\/jclark.org\/weblog\/wp-json\/wp\/v2\/posts\/149","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jclark.org\/weblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jclark.org\/weblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jclark.org\/weblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/jclark.org\/weblog\/wp-json\/wp\/v2\/comments?post=149"}],"version-history":[{"count":0,"href":"https:\/\/jclark.org\/weblog\/wp-json\/wp\/v2\/posts\/149\/revisions"}],"wp:attachment":[{"href":"https:\/\/jclark.org\/weblog\/wp-json\/wp\/v2\/media?parent=149"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jclark.org\/weblog\/wp-json\/wp\/v2\/categories?post=149"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jclark.org\/weblog\/wp-json\/wp\/v2\/tags?post=149"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}