Morning lads,
I have a module (what a surprise) I'd like to upload it to CPAN, but ... I can't think of a name.
The module sits on top of HTML::Parser and allows you to filter the tags and attributes in your HTML. You specify what's allowed and everything else it removed.
There is a similar module on CPAN already, CPAN://HTML::TagFilter, the difference between the two is that
I do think the module could come handy to other people as well, but for the life of me I can't think of a reasonable name. (HTML::Filter is already taken.)
Any suggestions are welcome.
That sounds as if it depended on or belonged to the HTML::TagFilter. I would not want to stomp on someone elses namespace. So maybe rather "HTML::SimpleTagFilter".
I'd rather if we could find a way to communicate that the module is controled by a string containing the allowed tags&attribs instead of from within the code.
Well, yes, actually one of my modules follows this naming style. Win32::Daemon::Simple provides a simplified (yet at the same time extended) interface to Win32::Daemon. The thing is that HTML::?Filter doesn't use HTML::TagFilter. Then there's CGI::Simple that provides part of the CGI.pm functionality and thus the code of the module is simpler ... this is not the case either. HTML::?Filter is totally independent to HTML::TagFilter. I did not know about HTML::TagFilter (if it even was already on CPAN which I doubt) when writing HTML::?Filter.
Note that it is "Lite", not "Simple". Simple indeed indicates a form of inheritance, such as HTML::TokeParser::Simple.
There's not a lot to document so I think the synopsis will suffice:
use HTML::JFilter; my $filter = new HTML::JFilter <<'*END*' b i code pre br a: href name font: color size style *END* $filteredHTML = $filter->doSTRING($enteredHTML); $filter->doFILE($inputfile, $outputfile);
I don't like the interface either actually. Maybe the methods should be Filter() and FilterFile(). Or maybe I could provide a functional interface instead or in adition:
my $filter = HTML::JFilter::MakeFilter ($allowed_tags); $filtered = $filter->( $html);
What about HTML::Parser::Filter. General though if yours works in a similar but simpler fashion as HTML::TagFilter then I would think HTML::TagFilter::Simple. Think of the relation more as what they do, not how they do it.
How about HTML::Subset or HTML::Subset::Filter?
update: or maybe HTML::FilterJ, or HTML::Filterer :)
HTML::LimitTags?
I do think the module could come handy to other people as well, but for the life of me I can't think of a reasonable name. (HTML::Filter is already taken.)
HTML::TagElide ? "Elide" is a great word that I confess I learned just last year. Now that doesn't sound like a selling point, but think about it.
Suggestions, I've got in spades:
HTML::Tag::*
I've bolded my two favorites. Those are my suggestions. The jury is out on whether they are good suggestions, but you did say that any suggestions were welcome. ;-)
perlmonks.org content © perlmonks.org and astroboy, bart, BrowserUk, chanio, dragonchild, eric256, Gavin, GrandFather, Intrepid, Jenda, PodMaster, radiantmatrix, sgt, sh1tn, wazoox
prlmnks.org © 2006 edmund von der burg (eccles & toad)
v 0.03