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

Hi monks

Does anyone know of a good way to write tables in Pod? I've searched CPAN for a module to provide this functionality, without success. I did find a usenet post from Larry Wall stating that he used a preprocessor to generate tables. Unfortunately, he didn't mention what it was called! Does anyone know of a preprocessor, script, module, or other device which I can use to write Pod tables, as an alternative to a sequence of ugly format-specific =for blocks?

Cheers

Eric

Replies are listed 'Best First'.
Re: Tables in Pod
by jmcnamara (Monsignor) on Oct 23, 2003 at 10:58 UTC

    The Pod Specification doesn't make any allowance for tables.

    So unfortunately, you will be constrained to processor specific =for directives or ascii style tables in a verbatim block.

    On CPAN eryq uses ascii table like this:

    Use encoding: | If your message contains: ------------------------------------------------------------ 7bit | Only 7-bit text, all lines <1000 characters 8bit | 8-bit text, all lines <1000 characters quoted-printable | 8-bit text or long lines (more reliable than "8 +bit") base64 | Largely non-textual data: a GIF, a tar file, et +c.

    Which are then converted to Html tables like this using a modified pod2html tool.

    --
    John.

      Okay,thanks for the ideas. I realise that the Pod spec doesn't include tables, but figured it might be a common enough problem that someone might have written a way to achieve them. Was wondering if there was anything obvious available, but there doesn't seem to be. No problem - I'll write a quick perl script myself to pre-process the pod file and extract any tables (written in some XML flavour), parse them, and then reinsert them into the pod doc as a =for block in the output format I'm looking for (html, latex, or plaintext, at present).

      Thanks for your time Eric
Re: Tables in Pod
by ctilmes (Vicar) on Oct 23, 2003 at 10:53 UTC
    >Does anyone know of a good way to write tables in Pod?

    Well, maybe not a good way, but a way:

    =pod This is my table: Item Description ----- ----------- this This is it. that This is that. =cut

    The initial space says to just format what follows verbatim.

      Yes, that's the method I'm using to get round it for the moment. Unfortunately I think I may need something more fancy at a later date...
        If you need anything fancy, use something else instead of POD. POD, afterall, stands for Plain Old Documentation. PODs simplicity is a feature.

        Abigail

Re: Tables in Pod
by princepawn (Parson) on Oct 23, 2003 at 11:55 UTC
Re: Tables in Pod
by PodMaster (Abbot) on Oct 23, 2003 at 22:02 UTC