diff options
author | twylite <twylite@crypt.co.za> | 2014-03-13 17:10:11 (GMT) |
---|---|---|
committer | twylite <twylite@crypt.co.za> | 2014-03-13 17:10:11 (GMT) |
commit | 644c0396cdb2d4ffaf75ef66b58d75d791a3d2ed (patch) | |
tree | b6205663566890da3a677b2bff784f9e0e100dc5 | |
parent | ae044f04702500e3ed688a238fbf06ff63cb3f85 (diff) | |
download | tcl-644c0396cdb2d4ffaf75ef66b58d75d791a3d2ed.zip tcl-644c0396cdb2d4ffaf75ef66b58d75d791a3d2ed.tar.gz tcl-644c0396cdb2d4ffaf75ef66b58d75d791a3d2ed.tar.bz2 |
Bug 3600058 work-in-progress: restored table format for contents page (easy for eyes to scan, each to search in browser) but added category-based list below. Need to review CSS and where we look for packages.list.txt.
-rw-r--r-- | tools/tcltk-man2html-utils.tcl | 32 | ||||
-rwxr-xr-x | tools/tcltk-man2html.tcl | 42 |
2 files changed, 48 insertions, 26 deletions
diff --git a/tools/tcltk-man2html-utils.tcl b/tools/tcltk-man2html-utils.tcl index 2c1f412..d407baa 100644 --- a/tools/tcltk-man2html-utils.tcl +++ b/tools/tcltk-man2html-utils.tcl @@ -1585,46 +1585,52 @@ proc make-manpage-section {outputDir sectionDescriptor} { set width [string length $name] } } - set perline [expr {118 / $width}] - set nrows [expr {([llength $manual(wing-toc)]+$perline)/$perline}] - set n 0 + set perline [expr { max(1, min(5, 118 / $width)) }] ;# stylesheet allows 1 to 5 cols catch { unset toc } + catch { unset idx } foreach name [lsort $manual(wing-toc)] { set tail $manual(name-$name) if {[llength $tail] > 1} { puts stderr "\n$name is defined in more than one file: $tail" set tail [lindex $tail [expr {[llength $tail]-1}]] } - set category "" + # Assign man page to a category + set category "Uncategorized" set catMaster $name if {[info exists manual(cat-master-$name)]} { set catMaster $manual(cat-master-$name) } if {[info exists manual(category-$catMaster)]} { -#FIXME-TD we want to have the option to group contents by category, if enabled set category $manual(category-$catMaster) } + # Render link set tail [file tail $tail] if {[info exists manual(tooltip-$manual(wing-file)/$tail.htm)]} { set tooltip $manual(tooltip-$manual(wing-file)/$tail.htm) set tooltip [string map {[ {\[} ] {\]} $ {\$} \\ \\\\} $tooltip] regsub {^[^-]+-\s*(.)} $tooltip {[string totitle \1]} tooltip lappend toc($category) \ - "<li> <a href=\"$tail.htm\" title=\"[subst $tooltip]\">$name</a> $manual(descrip-$name)</li>" + "<TD class='command'> <A href=\"$tail.htm\" title=\"[subst $tooltip]\">$name</A> </TD><TD>$manual(descrip-$name)</TD>" + lappend idx "<LI> <A href=\"$tail.htm\" title=\"[subst $tooltip]\">$name</A> </LI>" } else { lappend toc($category) \ - "<li> <a href=\"$tail.htm\">$name</a> $manual(descrip-$name)</li>" + "<TD class='command'> <A href=\"$tail.htm\">$name</A> </TD><TD>$manual(descrip-$name)</TD>" + lappend idx "<LI> <A href=\"$tail.htm\">$name</A> </LI>" } incr n } + # Render the alphabetical index + puts $manual(wing-toc-fp) "<H4>Alphabetical Index</H4>" + puts $manual(wing-toc-fp) "<UL class='multicolumn ncols${perline}'>" + puts $manual(wing-toc-fp) [join $idx \n] + puts $manual(wing-toc-fp) "</UL>" + # Render the category lists + puts $manual(wing-toc-fp) "<TABLE>" foreach category [lsort [array names toc]] { - if { $category ne "" } { - puts $manual(wing-toc-fp) "<H4>$category</H4>" - } - puts $manual(wing-toc-fp) {<ul class="multicolumn">} - puts $manual(wing-toc-fp) [join $toc($category) \n] - puts $manual(wing-toc-fp) </ul> + puts $manual(wing-toc-fp) "<TR><TD colspan='2'><H4>$category</H4></TD></TR>" + puts $manual(wing-toc-fp) "<TR>[join $toc($category) "</TR>\n<TR>"]</TR>" } + puts $manual(wing-toc-fp) "</TABLE>" # # insert wing copyrights diff --git a/tools/tcltk-man2html.tcl b/tools/tcltk-man2html.tcl index 8ae4079..b7d0648 100755 --- a/tools/tcltk-man2html.tcl +++ b/tools/tcltk-man2html.tcl @@ -235,14 +235,22 @@ proc css-stylesheet {} { font-size: 11px; } css-style ul.multicolumn { + list-style-type: none; + padding-left: 1em; + margin: 0; column-fill: balance; - column-count: 3; - -moz-column-count: 3; - -webkit-column-count: 3; column-gap: 20px; -moz-column-gap: 20px; -webkit-column-gap: 20px; } + css-style ul.ncols1 { column-count: 1; -moz-column-count: 1; -webkit-column-count: 1; } + css-style ul.ncols2 { column-count: 2; -moz-column-count: 2; -webkit-column-count: 2; } + css-style ul.ncols3 { column-count: 3; -moz-column-count: 3; -webkit-column-count: 3; } + css-style ul.ncols4 { column-count: 4; -moz-column-count: 4; -webkit-column-count: 4; } + css-style ul.ncols5 { column-count: 5; -moz-column-count: 5; -webkit-column-count: 5; } + css-style td.command { + padding-left: 1em; + } css-style ".keylist dt" ".arguments dt" { width: 20em; float: left; @@ -684,18 +692,23 @@ try { # ... but try to extract (name, version) from subdir contents try { - set f [open [file join $pkgsDir $dir configure.in]] - foreach line [split [read $f] \n] { - if {2 == [scan $line \ - { AC_INIT ( [%[^]]] , [%[^]]] ) } n v]} { - set description [list $n $v] - break + glob -directory [file join $pkgsDir $dir] -- \ + configure.in configure.ac unix/configure.in + } trap {POSIX ENOENT} {e} { + puts stderr "warning: no 'configure.in' (or .ac) under '[file nativename [file join $pkgsDir $dir]]'" + } on ok {flist} { + try { + set f [open [lindex $flist 0]] + foreach line [split [read $f] \n] { + if {2 == [scan $line \ + { AC_INIT ( [%[^]]] , [%[^]]] ) } n v]} { + set description [list $n $v] + break + } } + } finally { + catch {close $f; unset f} } - } trap {POSIX ENOENT} {e} { - puts stderr "warning: no 'configure.in' in '[file nativename [file join $pkgsDir $dir]]'" - } finally { - catch {close $f; unset f} } if {[file exists [file join $pkgsDir $dir configure]]} { @@ -710,6 +723,9 @@ try { try { set packageDirNameMap {} if {$build_tcl} { +#FIXME-TD look in --pkgsrc = $pkgsDir for this +# set f [open [file join $pkgsDir "package.list.txt"]] +# May need to look in more than one place? set f [open $tcltkdir/$tcldir/pkgs/package.list.txt] try { foreach line [split [read $f] \n] { |