Changeset fb646a in git for doc


Ignore:
Timestamp:
Jun 9, 1998, 3:16:27 PM (26 years ago)
Author:
Kai Krüger <krueger@…>
Branches:
(u'spielwiese', '2a584933abf2a2d3082034c7586d38bb6de1a30a')
Children:
6165cfa08216fa79fc9ffe13765311106854cbca
Parents:
217abb8b481b9f09f189cbc1a8802ab024b307c7
Message:
*** empty log message ***


git-svn-id: file:///usr/local/Singular/svn/trunk@2106 2c84dea3-7e68-4137-9b89-c4e89433aadc
File:
1 edited

Legend:

Unmodified
Added
Removed
  • doc/texi2html

    r217abb rfb646a  
    22'di ';
    33'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 $
    55# Description: Program to transform most Texinfo documents to HTML.
    66# The plan is for the next version of makeinfo to support HTML output
     
    3535$DEBUG_HTML  = 32;
    3636$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\">";
    3747
    3848$BIBRE = '\[[\w\/]+\]';                 # RE for a bibliography reference
     
    282292# things to skip
    283293#
     294%to_ignore = (
     295            'manual', 1,
     296            'end manual', 1,
     297            );
     298
    284299%to_skip = (
    285300            # comments
     
    323338            );
    324339
     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               );
    325352#+++############################################################################
    326353#                                                                              #
     
    348375$make_menu_page = 1;
    349376$section_type = 0;
     377$ignore_part = 0;
    350378$usage = <<EOT;
    351379This is $THISPROG
     
    525553$html_element = '';                     # current HTML element
    526554&html_reset;
     555@raw_html = ();
    527556
    528557# build code for simple substitutions
     
    583612    } elsif ($tag eq 'ifhtml') {
    584613        $in_html = $PROTECTTAG . ++$html_num;
    585         push(@lines, $in_html);
     614        push(@raw_html, $in_html);
    586615        next;
    587616    }
     
    593622            $in_raw_html = 0;
    594623        } else {
    595             push (@lines, $_);
     624            push (@raw_html, $_);
    596625        }
    597626        next;
     
    608637        last if $tag eq 'bye';
    609638    }
     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
    610652    #
    611653    # try to remove inlined comments
     
    649691            $in_top = 1;
    650692            $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;
    652695            next;
    653696        } elsif ($tag eq 'node') {
     
    14871530
    14881531push(@menu_lines, "<BODY BACKGROUND=\"/rock.gif\">\n");
     1532push(@menu_lines, "<IMG SRC=\"Singulars.gif\"><P>\n");
    14891533#push(@menu_lines, "<BODY BACKGROUND=\"/rock.gif\" TEXT=\"yellow\"");
    14901534#push(@menu_lines, " LINK=#FFFFFF ALINK=#FF00FF VLINK=\"#00FF00\">\n");
    14911535#push(@menu_lines, "<NOBR>\n");
    1492 push(@menu_lines, "<DL>\n");
     1536push(@menu_lines, "<OL>\n");
    14931537foreach (@left_index) {
     1538    $entry = $_;
     1539    @part = split(/\ /);
     1540    $name = join(' ', @part[1..$#part]);
    14941541    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}
     1545push(@menu_lines, "</OL>\n");
    14991546print "# end of pass 5\n" if $verbose;
    15001547
     
    15611608        &print_header("$title - $docu_name", "", 1);
    15621609        print "# creating $docu_main...\n" if $verbose;
    1563         &print_frame($docu_name);
     1610        #&print_frame($docu_name . "_1.html");
     1611        &print_frame($docu_toc);
    15641612        &print_toplevel_footer;
    15651613        close(FILE);
     
    16051653            &print_header("$title - $section", $links, 0);
    16061654
    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";
    16161666            print FILE $navigation;
    16171667            &print_ruler;
     
    18501900
    18511901sub left_menu_entry {
    1852     local($entry) = @_;
     1902    local($secnum, $entry) = @_;
    18531903    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    }
    18561914    $_ = $entry;
    1857     print "===>$_\n";
    1858     s/^[0-9A-Z.]+ //;
     1915    print "===>($secnum): $entry\n";
     1916    #s/^[0-9A-Z.]+ //;
     1917    $_ = $entry;
    18591918    &normalise_node($_);
    18601919    $href = $node2href{$_};
     
    18621921        $descr =~ s/^\s+//;
    18631922        $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");
    18651924    } else {
    18661925        warn "$ERROR Undefined node ($node): $_";
     
    20562115
    20572116sub print_frame {
    2058     local($docu_right) = $_[0] . "_1";
    20592117    print FILE <<EOT;
    20602118<FRAMESET COLS="20%,*" BORDER=0>
    20612119<FRAME SRC="$docu_left" NAME="Links">
    2062 <FRAME SRC="$docu_right.html" NAME="Main">
     2120<FRAME SRC="$_[0]" NAME="Main">
    20632121</FRAMESET>
    20642122
Note: See TracChangeset for help on using the changeset viewer.