develooper Front page | perl.perl5.porters | Postings from March 2008

Re: pod wiki?

Thread Previous | Thread Next
From:
Michael G Schwern
Date:
March 23, 2008 14:01
Subject:
Re: pod wiki?
Message ID:
47E6C4F5.9010806@pobox.com
Reini Urban wrote:
>> If someone would write one up we'll install it.  Syntax can be as 
>> simple as:
>> {pod:
>> ...your pod here...
>> }
>> POD goes in, HTML comes out.

Digging around some more, it looks like what you want is a WaflBlock.  That's 
what implements things like...

.pre
     my $code = "That isn't formatted";
.pre

So you could have

.pod
=head1 NAME

Some::Pod
.pod

You should be able to crib from the inner classes in 
lib/Socialtext/Formatter/WaflBlock.pm in the source that implement .pre and .html

It should be something like this:

package Socialtext::Formatter::POD;

use strict;
use warnings;

use base 'Socialtext::Formatter::WaflBlock';

use Class::Field qw( const );

const wafl_id => 'pod';

sub html {
     my $self = shift;
     my $pod = $self->matched();

     ...code to turn POD into an HTML snippet that fits with ST's CSS...
}

If you can write the bit that converts POD into SocialText friendly HTML we 
can take care of the rest.  Don't worry about testing it against SocialText if 
you don't have an installation, just save a wiki page and copy your generated 
HTML in place.  Hack on it until it plays nice with the CSS.


-- 
Look at me talking when there's science to do.
When I look out there it makes me glad I'm not you.
I've experiments to be run.
There is research to be done
On the people who are still alive.
     -- Jonathan Coulton, "Still Alive"

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About