develooper Front page | perl.perl5.porters | Postings from June 2022

Re: Pre-RFC: tables in Pod

Thread Previous | Thread Next
From:
Paul "LeoNerd" Evans
Date:
June 21, 2022 09:20
Subject:
Re: Pre-RFC: tables in Pod
Message ID:
20220621102020.254434ed@shy.leonerd.org.uk
On Mon, 20 Jun 2022 19:21:38 +0100
Neil Bowers <neilb@neilb.org> wrote:

> If this progresses further, I think we should enumerate the different
> ways/places that people look at pod, and how tables are expected to
> work/render in each of those places. E.g. perldoc, metacpan,
> perldoc.org, man, and ... ?

Hoboy, manpages are fun.

Most POD features are fairly simple copies of things in nroff (the
backing format behind man). It may not therefore be a surprise to
discover that nroff doesn't natively handle tables, any more than POD
does.

There is however a common preprocessor that takes an extension format
and renders it down to simpler positional instructions used to actually
draw the table; it is called `tbl`:

  https://linux.die.net/man/1/tbl

Overall, this verymuch is not a markup style I suggest we consider for
a possible POD idea. But I'll describe it here, to give a brief insight
into the kind of abilities it has.


In summary: it's a straaaange format. You write the table contents
twice - first in a grid of letters that describe how the cells should
be arranged, and then a grid of the actual content, separated by some
character (by default a tab, but you can use some printing one instead).

For example; here's 3 rows of 3 cells, separated by a pipe symbol

  .TS
  tab(|);
  c c c
  l l r .
  Headings|Go|Here
  then|the|contents
  of|the|cells
  .TE

Clever use of the cell layout letters allows things like vertical or
horizontal spans that cover multiple cells. There's lots of flexibility
here, but the overall markup is verymuch not very readable without
knowing what's going on.

Plus, since the content of each table is just more nroff content string
you can still apply all the expected text-level formatting controls and
whatnot inside there. Infact about the only thing you can't do is nest
a table inside another table.

-- 
Paul "LeoNerd" Evans

leonerd@leonerd.org.uk      |  https://metacpan.org/author/PEVANS
http://www.leonerd.org.uk/  |  https://www.tindie.com/stores/leonerd/

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About