Posted to tcl by hypnotoad at Tue Jun 18 19:45:46 GMT 2019view pretty

proc ::iliad::listing {object prefix path} {
  set UL [$object tag UL]
  foreach file [lsort -dictionary [glob -nocomplain [file join $path *]]] {
    set fname [file rootname [file tail $file]]
    if {$fname eq "index"} continue
    set title [string totitle $fname]
    [$UL tag LI] tag A href ${prefix}/[file tail $file] content $title
  }
}