Along with a number of improvements, David Parsons added a patch in v1.4.2 of his Discount that brings Qchar()’s signature in line with its prototype, and enables building the stock Discount source without modification under Plan 9’s APE.
% hget http://www.pell.portland.or.us/~orc/Code/markdown/discount-1.4.2.tar.gz
% tar xzf discount-1.4.2.tar.gz
% cd discount-1.4.2
% ape/psh
# ./configure.sh --help
... Available configuration options ...
# CC='cc -D_BSD_EXTENSION' ./configure.sh [ --enable-conf-opt ... ]
# make
# exit
% cp markdown [ makepage ] [ mkd2html ] $home/bin/$objtype
That’s easy enough, thanks to an emphasis on portability by Discount’s author, so we just use a mkfile to drive that underlying process & clean up some Plan 9-specific details on installation.
At any rate, the slimmed-down, pcc(1)-based markdown port has been synced with upstream, but is left as soon-to-be-deprecated. In place is a more functional and correct direct port of the latest Discount, ready to download: discount-1.4.2.p9.tgz (sha1:42f6eb238dea36be7c3d10a4eec0193758f14930). Change to the discount-1.4.2/Plan9 directory to find build support.
UPDATED - 20090615: Attempted to clarify my confusing description of the source change. Updated link to updated version of tarball.
Following Anthony Sorace’s lead and borrowing a bit of rc(1) code from his tweet, I’ve whipped up a quickie script for posting a notice to identi.ca or your Laconica server of choice. It’s called dent, and you can retrieve it from /n/sources/contrib/josh/rc/dent on a Plan 9 system, or look at the few lines of script at http://plan9.bell-labs.com/sources/contrib/josh/rc/dent or http://labs.utopian.net/who/josh/plan9/rc/dent.
It’ll only work with a factotum(4) available to authenticate for hget(1).
Enjoy!
Handling of comment display is a little more intelligent now in the sp theme: Entries that have comments disabled and have no existing comments, will not show the comments count and link, the comments feed link, or the comment area and form - not even a “no comments” message. It is assumed such a post is not intended for comment.
This comes in response to similar changes in the Habari core K2 theme, so thanks to 2fish for the ticket that started the idea.
As usual, you can git pull git://labs.utopian.net/sp, or grab the latest tarball, to update your sp.
It appears Internet Explorer 7 still needs this bit of CSS massage:
ol { margin-left: 2em; }
to keep it from dropping ol elements off the left edge of the earth. This was identified anonymously about a month ago on the post at the demo site that exhibit(ed) the problem, but I didn’t find the comment until today. Sorry, whoever you are!
You can fix this in your sp in one of three ways, all minor since the CSS in question is already in the ie.css file. It just wasn’t being loaded by IE 7:
- Get the latest tarball of sp, or
- With git(1),
clone or pull git://labs.utopian.net/sp, or
- Manually edit
header.php:15 and change [if lte IE 6] to [if lte IE 7] (Tests in IE 8 didn’t show the bug so this excludes them.)
When you really don’t want any dirty old Perl on your file server, you go looking for a Markdown filter in plain C. If you find David Parsons’ Discount, your work porting to Plan 9 isn’t too tough at all.
If you spend a few hours stripping things out, destroying a C library, and otherwise excising a thousand lines of code before introducing the remainder to cb(1), you end up with a markdown(1) for Plan 9. It’s still POSIX-y and pcc(1)-built, but it includes Plan 9 man(1) pages, and generally works as described therein.
It’s available with a BSD-like license (and credit to D. Parsons) at either the Utopian.net Labs link above, or from Bell Labs’ “sources” at /n/sources/contrib/josh/markdown.
A native Plan 9 C transliteration is in progress, but will take me longer than the POSIX port. For now, the existing markdown has the advantage of building on just about any POSIX-like system I’ve tried, even Windows (mingw or interix).

Tweedle-dee Dum said to Tweedle-dee Dee
“Your presence is obnoxious to me.”