Opened 14 years ago

Closed 14 years ago

Last modified 14 years ago

#1175 closed defect (fixed)

tools/mkhtml.py bug

Reported by: neteler Owned by: grass-dev@…
Priority: critical Milestone: 7.0.0
Component: Compiling Version: svn-trunk
Keywords: Cc:
CPU: All Platform: All

Description

In a series of module but not all the following problem happens during compilation (long lines broken here for readability):

VERSION_NUMBER=7.0.svn /home/usr_local/src/grass70/dist.x86_64-unknown-linux-gnu/tools/g.html2man.py
 /home/usr_local/src/grass70/dist.x86_64-unknown-linux-gnu/docs/html/db.copy.html
 /home/usr_local/src/grass70/dist.x86_64-unknown-linux-gnu/man/man1/db.copy.1
/home/usr_local/src/grass70/dist.x86_64-unknown-linux-gnu/docs/html/db.copy.html:80:0:
 Error ({}):     <li><a href="#SEE ALSO">SEE ALSO</a></li>

make: *** [/home/usr_local/src/grass70/dist.x86_64-unknown-linux-gnu/man/man1/db.copy.1] Error 1


...
make
VERSION_NUMBER=7.0.svn /home/usr_local/src/grass70/dist.x86_64-unknown-linux-gnu/tools/g.html2man.py 
/home/usr_local/src/grass70/dist.x86_64-unknown-linux-gnu/docs/html/ps.map.html
 /home/usr_local/src/grass70/dist.x86_64-unknown-linux-gnu/man/man1/ps.map.1
/home/usr_local/src/grass70/dist.x86_64-unknown-linux-gnu/docs/html/ps.map.html:65:0:
 Error ({}):     <li><a href="#border">border</a></li>

make: *** [/home/usr_local/src/grass70/dist.x86_64-unknown-linux-gnu/man/man1/ps.map.1] Error 1

I suspect that "#" is causing troubles.

Using Python 2.6.5 (r265:79063, Jul 14 2010, 13:38:11) [GCC 4.4.3]

Change History (5)

comment:1 by neteler, 14 years ago

Note: This new bug is related to the recent addition of TOC in tools/mkhtml.py

in reply to:  1 ; comment:2 by glynn, 14 years ago

Summary: g.html2man.py bugtools/mkhtml.py bug

Replying to neteler:

Note: This new bug is related to the recent addition of TOC in tools/mkhtml.py

The bug isn't "related" to r43469, the bug is in r43469 (summary changed to reflect this).

g.html2man.py is correct: the only permitted children of a UL element are LI elements. LI elements can contain just about anything, including UL elements, but the LI start tag isn't minimisable.

IOW, this:

    <li><a href="#EXAMPLES">EXAMPLES</a></li>
    <ul>
        <li><a href="#DBF">DBF</a></li>
        ...
    </ul>
    <li><a href="#SEE ALSO">SEE ALSO</a></li>

should be this:

    <li><a href="#EXAMPLES">EXAMPLES</a></li>
    <li>
        <ul>
            <li><a href="#DBF">DBF</a></li>
            ...
        </ul>
    </li>
    <li><a href="#SEE ALSO">SEE ALSO</a></li>

Running a page through a validator would have shown what the problem was (and simply trying to build GRASS would have shown that there was a problem). As always: "works in my browser" is not a reliable test of validity.

in reply to:  2 comment:3 by glynn, 14 years ago

Replying to glynn:

This should be fixed by r43666

comment:4 by neteler, 14 years ago

Resolution: fixed
Status: newclosed

Thanks, now it works.

in reply to:  4 comment:5 by glynn, 14 years ago

Replying to neteler:

Thanks, now it works.

Actually, there are some more fundamental issues; e.g. generation of <a name=...> tags; the generated i.atcorr.html has:

    <li><a href="#<font color=&quot;red&quot;>REMAINING DOCUMENTATION ISSUES</font>"><font color=&quot;red&quot;>REMAINING DOCUMENTATION ISSUES</font></a></li>

This corresponds to:

<h2><font color="red">REMAINING DOCUMENTATION ISSUES</font></h2>

in the source file. It appears that the code is using everything inside the <h2>, tags and all.

This indicates a more fundamental problem with the changes, namely trying to parse HTML using a bunch of regexps. This reduces the format of the <module>.html files from something defined by a specification to "whatever doesn't break mkhtml.py".

So I've reverted the TOC-related changes entirely in r43667.

If someone wants to actually process the HTML, there's a working HTML parser in tools/g.html2man.

Note: See TracTickets for help on using tickets.