wickline has asked for the wisdom of the Perl Monks concerning the following question:

I suppose CGI script authors periodically encounter a need to allow users to put some input into a textarea and have that input become part of some web page. In some cases, users want to be able to format their input and they may or may not know HTML.

I've got a first stab at a module to address this situation. It's only intended to cover roughly "textarea input", rather than any arbitrary HTML page worth of content. The idea is to cover your basic blog or slashdot type of discussion input, not to support HTML page authoring.

The code will identify paragraphs, including preformated sections (which can be indented or identified with email-style angle-bracket-prefix quoting). The code will translate
*email* style /markup/
into
html style markup
and translate a line of dashes into a horizontal rule.

The tags used for paragraphs and preformated sections are programmer-configurable, as is the type of _text markup_ to be supported.

There are other options for allowing links, labeling link destinations (a la slashdot) breaking long words, etc.

You can find info at

http://wickline.org/pause/_scratchwork_/HfT/
module source
module pod-as-html
a script to play with
source of said script

The script lets you tweak all of the various config options and supply arbitrary input, and then see what the resulting output would be. It's basically a more pleasant way to play-test the module than writing/editing a script to use it.

I'm wondering whether folks think this should be CPAN'ed. What should be changed? What should stay the same? What name should it have?

Thanks for your time :)

-matt

Edit kudra, 2002-04-19 Changed title per ntc request

  • Comment on Potential CPAN module for formatted user input websites

Replies are listed 'Best First'.
Re: request for module feedback
by VSarkiss (Monsignor) on Apr 04, 2002 at 16:05 UTC
Re: request for module feedback
by rinceWind (Monsignor) on Apr 04, 2002 at 14:29 UTC
    Sounds like your talking about a Wiki - as in what I know is.

    See also node User-updatable web sites and following discussion.

    See also Usemod for an example.

      this module could be used in a wiki-like system, but is intended to be more generic. It could also be used in a shlashdot or perlmonks type system, or for allowing non-HTML -speaking folks to post "what's new" notes on a website (so that you don't have to do it for them every week).

      The module is supposed to be a plug-in to whatever larger-scope project you might have that needs to take some user input and turn it into html.

      Should I read your comment as "you're re-inventing the wheel" (and if so, which perl modules should I be looking at) or as "could you support wiki input sytax as well"?

      thanks :)

      -matt
        wickline,

        I was merely suggesting that the code to mark-up input from non-technical users already exists in many wiki scripts.

        I think that bundling this as a CPAN module is an excellent idea if this has not already been done.

        There may be some tools which may be worth considering to homogify the results: HTML::Template, Template::Toolkit, but after all TMTWOTDI.