[GRASS-dev] Manpage HTML markup consistency

Glynn Clements glynn at gclements.plus.com
Mon Feb 25 12:19:39 EST 2008


Hamish wrote:

> > Also, although g.html2man attempts to handle tables, it doesn't seem
> > to work. Please remove <TABLE> <TD> <TH> from the list of allowed
> > tags.
> 
> Tables can be useful.

They might be useful if they worked.

> I would think it better to try and improve
> g.html2man if the current implementation is not working well, rather
> than ban them.

While it would be better if tables worked, the current situation where
they don't work (at all, AFAICT) but get used anyhow is worse than
simply not using them.

Look at the lrs(1) or r.in.xyz(1) manpages; the table portions are
garbage. This is the "man lrs" output corresponding to the table in
lrs.html:

   LRS table structure
       |  AttributeTypeDescription | rsid integer reference segment ID, unique
       in the table | lcat integer category of the line in the LRS map  |  lid
       integer  route  ID (LID) | start_map double precision distance measured
       along the line in LRS map from the beginning of the line to the  begin-
       ning  of the segment (absolute milepost distance) | end_map double pre-
       cision distance measured along the line in LRS map from  the  beginning
       of the line to the end of the segment  (absolute distance of subsequent
       milepost) | start_mp double precision milepost number assigned  to  the
       start  of  the  segment  |  start_off  double  precision  distance from
       start_mp to the start of the segment measured along the physical object
       |  end_mp  double  precision milepost number assigned to the end of the
       segment | end_off double precision distance from end_mp to end  of  the
       segment  measured  along  the  physical object | end_type integer1: the
       same as specified for from_ ; 2: calculated from  map  along  the  line
       from previous MP; 3: defined by user

Given that Python has at least two HTML parsers as part of its
standard library, we would probably be better off replacing g.html2man
with a Python script which uses one of them. The ad-hoc regex-based
approach used by g.html2man will inevitably only accept an ill-defined
subset of HTML.

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


More information about the grass-dev mailing list