in reply to Re: Generating an HTML survey form from simple markup
in thread Generating an HTML survey form from simple markup

Yes, for sure, templating modules will be used. If this is a front end for CGI::FormBuilder, it can send it's output to HTML::Template, Text::Template, etc. My module shouldn't mess with presentation *at all*.

Yes, I considered YAML, but compare the legibility of your example to mine. Too much typing!

  • Comment on Re^2: Generating an HTML survey form from simple markup

Replies are listed 'Best First'.
Re^3: Generating an HTML survey form from simple markup
by Fletch (Bishop) on Feb 03, 2005 at 17:33 UTC
    Yes, I considered YAML, but compare the legibility of your example to mine. Too much typing!

    But the YAML is self documenting. You can tell exactly what each parameter that's being set; with positional parameters you have to remember the right order. If that's too chatty for you you could still use positional parameters and let YAML parse it.

    action: '/somepath/foo.cgi' fields: - [ text, name, "Your name:" ] - [ radio, gender, Male, Female ] - [ textarea, complaints, "Enter your complaints here", 80, 24 ]
      I get your point, and for many uses, I'd agree. I may yet go with YAML. One issue is that I'd like this to optionally be part of a pod document - I'll first run Pod::HTML on the text file, then parse the form fields into HTML within that generated document. This will allow the text file to contain things like survey section headings and commentary paragraphs. I'm not sure that would integrate too well with YAML (though I suppose I could mark YAML sections and parse them separately). Maybe by describing my audience as "non-techies" I was misstating my goal. My first goal is to make this something that I can quickly whip up a survey by making the simplest possible podfile and generating from that.
        If you;d like it to go into POD then you could always use a =for or a =begin/end bock and subclass a POD parser to extract it and deal with it how you want like:
        =begin formdef action: '/somepath/foo.cgi' fields: - [ text, name, "Your name:" ] - [ radio, gender, Male, Female ] - [ textarea, complaints, "Enter your complaints here", 80, 24 ] =end formdef
        --
        Clayton