Changeset fb646a in git for doc/texi2html
- Timestamp:
- Jun 9, 1998, 3:16:27 PM (25 years ago)
- Branches:
- (u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'f875bbaccd0831e36aaed09ff6adeb3eb45aeb94')
- Children:
- 6165cfa08216fa79fc9ffe13765311106854cbca
- Parents:
- 217abb8b481b9f09f189cbc1a8802ab024b307c7
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/texi2html
r217abb rfb646a 2 2 'di '; 3 3 'ig 00 '; 4 # $Id: texi2html,v 1. 2 1998-06-08 13:22:47 krueger Exp $4 # $Id: texi2html,v 1.3 1998-06-09 13:16:27 krueger Exp $ 5 5 # Description: Program to transform most Texinfo documents to HTML. 6 6 # The plan is for the next version of makeinfo to support HTML output … … 35 35 $DEBUG_HTML = 32; 36 36 $DEBUG_USER = 64; 37 38 $IMG_FIRST_ACTIVE = "<IMG SRC=\"first-b.gif\">"; 39 $IMG_FIRST_PASSIVE = "<IMG SRC=\"first-t.gif\">"; 40 $IMG_LAST_ACTIVE = "<IMG SRC=\"last-b.gif\">"; 41 $IMG_LAST_PASSIVE = "<IMG SRC=\"last-t.gif\">"; 42 $IMG_NEXT_ACTIVE = "<IMG SRC=\"next-b.gif\">"; 43 $IMG_NEXT_PASSIVE = "<IMG SRC=\"next-t.gif\">"; 44 $IMG_PREV_ACTIVE = "<IMG SRC=\"previous-b.gif\">"; 45 $IMG_PREV_PASSIVE = "<IMG SRC=\"previous-t.gif\">"; 46 $IMG_TOC = "<IMG SRC=\"toc-b.gif\">"; 37 47 38 48 $BIBRE = '\[[\w\/]+\]'; # RE for a bibliography reference … … 282 292 # things to skip 283 293 # 294 %to_ignore = ( 295 'manual', 1, 296 'end manual', 1, 297 ); 298 284 299 %to_skip = ( 285 300 # comments … … 323 338 ); 324 339 340 %append2num = ( 341 'A', 1, 342 'B', 2, 343 'C', 3, 344 'D', 4, 345 'E', 5, 346 'F', 6, 347 'G', 7, 348 'H', 8, 349 'I', 9, 350 'J', 10, 351 ); 325 352 #+++############################################################################ 326 353 # # … … 348 375 $make_menu_page = 1; 349 376 $section_type = 0; 377 $ignore_part = 0; 350 378 $usage = <<EOT; 351 379 This is $THISPROG … … 525 553 $html_element = ''; # current HTML element 526 554 &html_reset; 555 @raw_html = (); 527 556 528 557 # build code for simple substitutions … … 583 612 } elsif ($tag eq 'ifhtml') { 584 613 $in_html = $PROTECTTAG . ++$html_num; 585 push(@ lines, $in_html);614 push(@raw_html, $in_html); 586 615 next; 587 616 } … … 593 622 $in_raw_html = 0; 594 623 } else { 595 push (@ lines, $_);624 push (@raw_html, $_); 596 625 } 597 626 next; … … 608 637 last if $tag eq 'bye'; 609 638 } 639 640 if ($end_tag) { 641 if ($to_ignore{"end $end_tag"}) { 642 $ignore_part = 0; 643 next; 644 } 645 } elsif ($tag) { 646 if ($to_ignore{$tag}) { 647 $ignore_part = 1; 648 } 649 } 650 next if $ignore_part; 651 610 652 # 611 653 # try to remove inlined comments … … 649 691 $in_top = 1; 650 692 $in_preamble = 0; 651 @lines = (); # ignore all lines before top (title page garbage) 693 #@lines = (); # ignore all lines before top (title page garbage) 694 @lines = @raw_html; 652 695 next; 653 696 } elsif ($tag eq 'node') { … … 1487 1530 1488 1531 push(@menu_lines, "<BODY BACKGROUND=\"/rock.gif\">\n"); 1532 push(@menu_lines, "<IMG SRC=\"Singulars.gif\"><P>\n"); 1489 1533 #push(@menu_lines, "<BODY BACKGROUND=\"/rock.gif\" TEXT=\"yellow\""); 1490 1534 #push(@menu_lines, " LINK=#FFFFFF ALINK=#FF00FF VLINK=\"#00FF00\">\n"); 1491 1535 #push(@menu_lines, "<NOBR>\n"); 1492 push(@menu_lines, "< DL>\n");1536 push(@menu_lines, "<OL>\n"); 1493 1537 foreach (@left_index) { 1538 $entry = $_; 1539 @part = split(/\ /); 1540 $name = join(' ', @part[1..$#part]); 1494 1541 if (!/^[A-Z0-9]\./) { 1495 &left_menu_entry($ _);1496 } 1497 } 1498 push(@menu_lines, "</ DL>\n");1542 &left_menu_entry($part[0], $name); 1543 } 1544 } 1545 push(@menu_lines, "</OL>\n"); 1499 1546 print "# end of pass 5\n" if $verbose; 1500 1547 … … 1561 1608 &print_header("$title - $docu_name", "", 1); 1562 1609 print "# creating $docu_main...\n" if $verbose; 1563 &print_frame($docu_name); 1610 #&print_frame($docu_name . "_1.html"); 1611 &print_frame($docu_toc); 1564 1612 &print_toplevel_footer; 1565 1613 close(FILE); … … 1605 1653 &print_header("$title - $section", $links, 0); 1606 1654 1607 $navigation = "<p>Go to the "; 1608 $navigation .= ($prev_doc ? &anchor('', $first_doc, '', "first") : "first"); 1609 $navigation .= ", "; 1610 $navigation .= ($prev_doc ? &anchor('', $prev_doc, '', "previous") : "previous"); 1611 $navigation .= ", "; 1612 $navigation .= ($next_doc ? &anchor('', $next_doc, '', "next") : "next"); 1613 $navigation .= ", "; 1614 $navigation .= ($next_doc ? &anchor('', $last_doc, '', "last") : "last"); 1615 $navigation .= " section, " . &anchor('', $docu_toc, '', "table of contents") . ".\n"; 1655 #$navigation = "<p>Go to the "; 1656 $navigation = "<p>"; 1657 $navigation .= ($prev_doc ? &anchor('', $first_doc, '', $IMG_FIRST_ACTIVE) : $IMG_FIRST_PASSIVE); 1658 $navigation .= " "; 1659 $navigation .= ($prev_doc ? &anchor('', $prev_doc, '', $IMG_PREV_ACTIVE) : $IMG_PREV_PASSIVE); 1660 $navigation .= " "; 1661 $navigation .= ($next_doc ? &anchor('', $next_doc, '', $IMG_NEXT_ACTIVE) : $IMG_NEXT_PASSIVE); 1662 $navigation .= " "; 1663 $navigation .= ($next_doc ? &anchor('', $last_doc, '', $IMG_LAST_ACTIVE) : $IMG_LAST_PASSIVE); 1664 #$navigation .= " section, " . &anchor('', $docu_toc, '', "<IMG SRC=\"toc-b.gif\">") . ".\n"; 1665 $navigation .= " " . &anchor('', $docu_toc, '', $IMG_TOC) . "\n"; 1616 1666 print FILE $navigation; 1617 1667 &print_ruler; … … 1850 1900 1851 1901 sub left_menu_entry { 1852 local($ entry) = @_;1902 local($secnum, $entry) = @_; 1853 1903 local($_); 1854 local($href, $descr); 1855 1904 local($href, $descr, $oltype,$value); 1905 1906 $_ = $secnum; 1907 $value = $secnum; 1908 if (/[A-Z]/) { 1909 $oltype = "<LI TYPE=A"; 1910 $value = $append2num{$secnum}; 1911 } else { 1912 $oltype = "<LI"; 1913 } 1856 1914 $_ = $entry; 1857 print "===>$_\n"; 1858 s/^[0-9A-Z.]+ //; 1915 print "===>($secnum): $entry\n"; 1916 #s/^[0-9A-Z.]+ //; 1917 $_ = $entry; 1859 1918 &normalise_node($_); 1860 1919 $href = $node2href{$_}; … … 1862 1921 $descr =~ s/^\s+//; 1863 1922 $descr = ": $descr" if $descr; 1864 push(@menu_lines, " <DT>" . &anchor('', $href, "Main", $entry) . "$descr</DT>\n");1923 push(@menu_lines, "$oltype VALUE=$value>" . &anchor('', $href, "Main", $entry) . "$descr\n"); 1865 1924 } else { 1866 1925 warn "$ERROR Undefined node ($node): $_"; … … 2056 2115 2057 2116 sub print_frame { 2058 local($docu_right) = $_[0] . "_1";2059 2117 print FILE <<EOT; 2060 2118 <FRAMESET COLS="20%,*" BORDER=0> 2061 2119 <FRAME SRC="$docu_left" NAME="Links"> 2062 <FRAME SRC="$ docu_right.html" NAME="Main">2120 <FRAME SRC="$_[0]" NAME="Main"> 2063 2121 </FRAMESET> 2064 2122
Note: See TracChangeset
for help on using the changeset viewer.