Main > Programming > Libraries >

HTML::WikiConverter::Dialects 0.61

HTML::WikiConverter::Dialects 0.61

Sponsored Links

HTML::WikiConverter::Dialects 0.61 Ranking & Summary

RankingClick at the star to rank
Ranking Level
User Review: 0 (0 times)
File size: 0.034 MB
Platform: Any Platform
License: Perl Artistic License
Price:
Downloads: 839
Date added: 2007-07-09
Publisher: David J. Iberri

HTML::WikiConverter::Dialects 0.61 description

HTML::WikiConverter::Dialects is a Perl module which contains a tutorial on how to add a dialect.

SYNOPSIS

# In your dialect module:

package HTML::WikiConverter::MySlimWiki;
use HTML::WikiConverter -dialect;

rule b => { start => **, end => ** };
rule i => { start => //, end => // };
rule strong => { alias => b };
rule em => { alias => i };
rule hr => { replace => "n----n" };

# In a nearby piece of code:

package main;
use Test::More tests => 5;

my $wc = new HTML::WikiConverter(
dialect => MySlimWiki
);

is( $wc->html2wiki( text ), **text**, b );
is( $wc->html2wiki( text ), //text//, i );
is( $wc->html2wiki( text ), **text**, strong );
is( $wc->html2wiki( text ), //text//, em );
is( $wc->html2wiki(
), ----, hr );

HTML::WikiConverter (or H::WC, for short) is an HTML to wiki converter. It can convert HTML source into a variety of wiki markups, called wiki "dialects". This manual describes how you to create your own dialect to be plugged into HTML::WikiConverter.

DIALECTS

Each dialect has a separate dialect module containing rules for converting HTML into wiki markup specific for that dialect. Currently, all dialect modules are in the HTML::WikiConverter:: package space and subclass HTML::WikiConverter. For example, the MediaWiki dialect module is HTML::WikiConverter::MediaWiki, while PhpWikis is HTML::WikiConverter::PhpWiki. However, dialect modules need not be in the HTML::WikiConverter:: package space; you may just as easily use package MyWikiDialect; and H::WC will Do The Right Thing.

From now on, Ill be using the terms "dialect" and "dialect module" interchangeably.

Subclassing

To interface with H::WC, dialects need to subclass it. Because youll probably be wanting the rule() and attribute() functions as well, subclassing and importing these functions is done in a single step:

use HTML::WikiConverter -dialect;

This will add HTML::WikiConverter to your dialects @ISA and will import the attribute() and rule() functions into your dialects package.

Conversion rules

Dialects guide H::WCs conversion process with a set of rules that define how HTML elements are turned into their wiki counterparts. Each rule corresponds to an HTML tag (including nonstandard tags), and there may be any number of rules. Rules are added with the rule() function that was imported when you subclassed H::WC (see above).

The syntax for rule() is as follows:

rule $tag => %subrules;

where $tag is the name of the HTML tag (e.g., "b", "em", etc.) and %subrules contains subrules that specify how that tag will be converted.

HTML::WikiConverter::Dialects 0.61 Screenshot

Advertisements

HTML::WikiConverter::Dialects 0.61 Keywords

Bookmark HTML::WikiConverter::Dialects 0.61

Hyperlink code:
Link for forum:

HTML::WikiConverter::Dialects 0.61 Copyright

WareSeeker periodically updates pricing and software information of HTML::WikiConverter::Dialects 0.61 full version from the publisher, so some information may be slightly out-of-date. You should confirm all information before relying on it. Software piracy is theft, Using crack, password, serial numbers, registration codes, key generators is illegal and prevent future development of HTML::WikiConverter::Dialects 0.61 Edition. Download links are directly from our publisher sites, torrent files or links from rapidshare.com, yousendit.com or megaupload.com are not allowed

Allok Video Splitter 2.2.0 Review:

Name (Required)
Email(Required)
Captcha
Featured Software

Want to place your software product here?
Please contact us for consideration.

Contact WareSeeker.com
Related Software
HTML::WikiConverter is a Perl module that can convert HTML to wiki markup. Free Download
HTML::WikiConverter::Normalizer is a Perl module to convert CSS styles to (roughly) corresponding HTML. Free Download
HTML::WikiConverter::MediaWiki is a Perl module used to convert HTML to MediaWiki markup. Free Download
HTML::WikiConverter::Oddmuse is a Perl module that can convert HTML to Oddmuse markup. Free Download
HTML::WikiConverter::Markdown is a Perl module to convert HTML to Markdown markup. Free Download
HTML Objects is a Perl module library for turning HTML tags into Perl objects. Free Download
Text::RewriteRules Perl module contains a system to rewrite text using regexp-based rules. Free Download
Text::WikiFormat is a Perl module for translating Wiki formatted text into other formats. Free Download