Discount adds Plan 9 platform

2009-06-17 14:19

Version 1.4.3 of Parsons’s Discount is out, and with it, Plan 9 support becomes part of the official distribution. The Plan9 subdirectory added to the source contains a mkfile that drives Discount’s own scripts and APE’s make(1) to build the code, optionally copying the results to locations appropriate for system-wide use. Man(6)-format manual pages are also included for the markdown tool and syntax.

To build it, fetch the latest source archive from the Discount site (currently 1.4.3), extract it, then:

% cd discount-1.4.3/Plan9
% mk config && mk
% ../markdown -V
markdown: discount 1.4.3

Configuration options can be set in a CONFIG variable to mk config. Install the binaries and/or manual pages with a few other mk(1) targets; see mkfile and README for details.

Plan 9 Markdown Redux Revisited

2009-06-12 13:37

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.

Habari Notes

2009-04-10 00:44

UPDATED: Habari r3465 fixes the problem with the RemoteRequest class, and should be included in the next Habari release. Hacking an r3447 version of Habari up a bit to use an older RemoteRequest class to make the post-through to labs/mux with the Laconica plugin work again.

I also did some quick work on the sp theme to make it work with the new Page Menu plugin, if it’s installed. If not, the theme uses its own (non-configurable) page menu list. Either way, the page menu looks and works the same in the theme’s sidebar.

<?php if( count( $pages ) > 0) : /* Requires support in $theme->add_template_vars(). */ ?>
    <h2 id="pagelist-title"><?php _e( 'Pages', 'sp' ); ?></h2>
    <ul id="pagelist">
    <?php if( Plugins::is_loaded( 'Page Menu' ) ) :
        $theme->pagemenu();
    else :
        foreach( $pages as $page )
            echo '<li><a href="' . $page->permalink . '" title="' . $page->title . '">'
            . $page->title . '</a></li>' . "\n";
    endif; ?>
    </ul>
<?php endif; ?>

The mentioned support in theme.php is something like:

public function add_template_vars() 
{
    if(!$this->template_engine->assigned('pages'))
        $this->assign('pages', Posts::get(array('content_type' => 'page', 'status' => Post::status('published'))));
    ...
}

Seemed a bit lightweight and early days for the wiki, so I posted it here.

Laconica client for Plan 9

2009-03-23 00:37

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!

Sp: Smarter comments

2009-03-02 16:52

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.

IE7 bug in sp

2009-02-28 05:46

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:

  1. Get the latest tarball of sp, or
  2. With git(1), clone or pull git://labs.utopian.net/sp, or
  3. 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.)


Pages

Syndicate (Atom)

Small Talk

at labs.utopian.net/mux
  • "We don't care [why]. We just want her gone." - an Alaska waitress @ Sat Jul 04 22:49:15 +0000 2009