#!/usr/bin/tclsh #!/usr/bin/tclsh7.6 #!/usr/bin/expect # # (find-fline "~/TH/Generate") # (find-fline "~/TH/Htmllib.tcl") # (find-fline "~/TH/Files.tcl") # # (find-node "(make)Remaking Makefiles") # (find-node "(make)Include" "generate dependencies") # (find-fline "$PAGE2/") # (find-fline "~/TCL/Makefile.L") source [file dirname [info script]]/Htmllib.tcl # (find-angg "TH/Htmllib.tcl") # (find-angg "TH/Files.tcl") # (find-es "tcl" "info_script") # «.link_functions» (to "link_functions") # «.cgi_links» (to "cgi_links") # «.forms» (to "forms") # «.makefile_functions» (to "makefile_functions") # «.extra_functions» (to "extra_functions") # «.htmlize» (to "htmlize") # «.find-» (to "find-") # «.test_links» (to "test_links") # «.txt2html» (to "txt2html") # «.a2html_and_e2html» (to "a2html_and_e2html") # «.e2html-new» (to "e2html-new") # «.top_level» (to "top_level") #%%%% # # functions for links # #%%%% # «link_functions» (to ".link_functions") proc my {fname} { return "$fname" } proc myl {fname} { return $fname } procj MYL1 {fname text} { if {[void $text]} {set text [my $fname]} HREF1 [relativepathto $fname] $text } procj MYURL {url {name {}}} { relativepathto [expr {$name==""?"$url":"$url#$name"}] } procj AURL {astem {name {}}} { relativepathto [expr {$name==""?"$astem.html":"$astem.html#$name"}] } proc section {str} { if {$str==""} {return ""} {return "#$str"} } proc or {text alt} { expr {$text!=""?$text:$alt} } procj ESURL {estem {name {}}} { relativepathto e/$estem.html[section $name] } procj ES1 {whereto text} { foreach {stem name} $whereto {} L1 [ESURL $stem.e $name] $text } procj AL1 {anggurl text} { # experimental version foreach {astem name} $anggurl {} L1 [AURL $astem $name] [or $text $astem] } procj A0L1 {fname text} { MYL1 $fname $text } procj PL1 {abslurl text} { if {[void $text]} {set text $abslurl} MYL1 $abslurl $text } procj IMAGE1 {anggurl text} { if {[void $text]} {set text $anggurl} MYL1 $anggurl $text } procj IMAGE1 {url text} { HREF1 $url "
\"$text\"\n" } procj ML1 {mailadr text} { if [void $text] { set text $mailadr } HREF1 mailto:$mailadr $text } procj MTAL1 {shortfname text} { if {$text==""} {set text $shortfname} A0L1 mktclapp-3.9/$shortfname $text } procj SL1 {fname text} { if {$text==""} {set text $fname} MYL1 $fname $text } proc BR {} { return "\n
\n" } proc RULE {} { return "\n\n
\n\n" } proc ANAME {tag} { return "\n\n" } proc nbytes {fname} { if {[file exists $fname]} { return "([file size $fname] bytes)" } } procj MYLBYTES1 {fname txt} { if {$txt==""} {set txt $fname} MYL1 $fname "$txt [nbytes $fname]" } #%%%% # # Functions for links to CGIs # #%%%% # «cgi_links» (to ".cgi_links") # For info2www cgi calls # (find-fline "emacs-tutor.th") # # (find-fline "/usr/lib/tcl8.0/cgi/cgi.tcl" "{%}") # (find-fline "/usr/lib/tcl8.0/cgi/cgi.tcl" "format %c 0x") proc cgiquote {value} { regsub -all {%} $value "%25" value regsub -all {#} $value "%23" value regsub -all {&} $value "%26" value regsub -all {\+} $value "%2b" value regsub -all { } $value "+" value regsub -all {=} $value "%3d" value return $value } proc INFO2WWW {} { if {[islocal]} {return http://localhost/cgi-bin/info2www} return http://angg.twu.net/info2www.cgi } proc nodehref {infofile short node txt} { set node [join $node] if {$txt==""} {set txt "$short$node"} HREF1 "[INFO2WWW]?($infofile)[cgiquote $node]" $txt } procj BASHNODE1 {node txt} { nodehref bash (bash) $node $txt } procj EFAQNODE1 {node txt} { nodehref emacs-faq (emacs-faq) $node $txt } procj ELINODE1 {node txt} { nodehref emacs-lisp-intro (elintro) $node $txt } procj ELNODE1 {node txt} { nodehref elisp (elisp) $node $txt } procj ENODE1 {node txt} { nodehref emacs-e20 (emacs) $node $txt } procj GCCNODE1 {node txt} { nodehref gcc (gcc) $node $txt } procj GDBNODE1 {node txt} { nodehref gdb (gdb) $node $txt } procj GRUBNODE1 {node txt} { nodehref grub (grub) $node $txt } procj HURDNODE1 {node txt} { nodehref hurd (hurd) $node $txt } procj INFONODE1 {node txt} { nodehref info-e20 (info) $node $txt } procj LIBCNODE1 {node txt} { nodehref libc (libc) $node $txt } procj LUANODE1 {node txt} { nodehref lua (lua) $node $txt } procj MAKENODE1 {node txt} { nodehref make (make) $node $txt } procj MBNODE1 {node txt} { nodehref multiboot (multiboot) $node $txt } procj TEXINODE1 {node txt} { nodehref texinfo (texinfo) $node $txt } procj EXPNODE1 {node txt} { nodehref expect (expect) $node $txt } procj LUANODE1 {node txt} { nodehref lua (lua) $node $txt } procj LILYNODE1 {node txt} { nodehref lilypond (lilypond) $node $txt } procj GAWKNODE1 {node txt} { nodehref gawk (gawk) $node $txt } # 2005jan10 proc nodehref2 {short node txt infourl} { set node [join $node] if {$txt==""} {set txt "$short$node"} regsub -all {[ &<>/]} $node {-} node2 HREF1 "$infourl${node2}.html" $txt } procj ENODE1 {node txt} { nodehref2 (emacs) $node $txt \ http://www.gnu.org/software/emacs/manual/html_node/ } procj ELNODE1 {node txt} { nodehref2 (emacs) $node $txt \ http://www.gnu.org/software/emacs/elisp-manual/html_node/ } # http://www.gnu.org/software/emacs/elisp-manual/html_node/elisp_toc.html procj ELINODE1 {node txt} { nodehref2 (elintr) $node $txt \ http://www.gnu.org/software/emacs/emacs-lisp-intro/html_node/ } proc MAN2HTML {} { if {[islocal]} {return http://localhost/cgi-bin/man2html} return http://angg.twu.net/cgi-bin/man2html } procj MANL1 {n page txt} { HREF [MAN2HTML]?${page}+$n $txt } #%%%% # # Functions for forms. # #%%%% # «forms» (to ".forms") # For \n" append s "