[GRASS-dev] Manpage HTML markup consistency

Glynn Clements glynn at gclements.plus.com
Tue Feb 26 08:08:57 EST 2008


Hamish wrote:

> > Also, although g.html2man attempts to handle tables, it doesn't
> > seem to work.
> 
> I think it's just missing a line break,
> 
> 
> Index: tools/g.html2man/g.html2man
> ===================================================================
> --- tools/g.html2man/g.html2man (revision 30354)
> +++ tools/g.html2man/g.html2man (working copy)
> @@ -52,7 +52,7 @@
>    $ncols = -1 + scalar split /<td/i, $one_row;
>    $has_header = m|<th|i ;
>    s|[\n\r]||g;
> -  s|</tr.*?>|\n|gis;
> +  s|</tr.*?>|\n.br\n|gis;
>    s|</td.*?>|\t|gis;
>    foreach $tag ( qw(<td.*?> <th.*?> </th> <tr.*?>) ){
>      s/$tag//gi;
> 
> ?
> 
> editing the r.in.xyz.1 file by hand with that modification makes the
> table look nice in the man page. groff has some tbl() function too, but
> I'm not at all familiar with how to use it or how portable it is.

Inserting .br between lines would certainly be an improvement.

Unfortunately, the above change doesn't achieve that; all of the
table-related tags have been stripped by the point that CvtTable is
called.

> As for rewriting with Python, sure that could be really good. But as
> Python will not be a mandatory dependency until GRASS 7 the g.html2man
> shell script should remain as the default for the 6.x branches.

Bear in mind that perl is only a dependency because g.html2man uses
it. Personally, I see no difference between requiring perl in order to
build the manual pages and requiring python.

-- 
Glynn Clements <glynn at gclements.plus.com>


More information about the grass-dev mailing list