Changeset 609ba11 in git
- Timestamp:
- Jul 9, 1999, 4:12:59 PM (24 years ago)
- Branches:
- (u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', '0604212ebb110535022efecad887940825b97c3f')
- Children:
- 34fbd934a748fec8c0dcc9325052eddde20bd10e
- Parents:
- 63374c2a45ce7f0660de1047f95a58b4d23d5055
- Location:
- doc
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/STYLEGUIDE
r63374c r609ba11 145 145 ==================================== 146 146 147 * generally use @samllexample for (code) examples 148 147 149 * Die Kommandozeilen in einem Beispiel, das nicht von doc2tex 148 150 gerechnet wird, beginnen NICHT MEHR mit zwei Leerzeichen: 149 @ example151 @smallexample 150 152 ring r; 151 153 ideal i=x,y; 152 @end example154 @end smallexample 153 155 154 156 * Beispiele, die von doc2tex gerechnet werden, muessen weiterhin mit … … 163 165 untersten Zeile des Kommentars stehen (sonst wird in spaeter die 164 166 Singular-Ausgabe zwischen den Kommentar und das Kommando geschoben): 165 @ example167 @smallexample 166 168 @c example 167 169 ring r; … … 169 171 option(prot); // during the Groebner basis computation. 170 172 @c example 171 @end example173 @end smallexample 172 174 173 175 + Bei Beispielen, die nicht wirklich von doc2tex gerechnet, muss nach dem 174 176 @expansion ein Leerzeichen kommen, und geschweifte Klammern muessen 175 177 gequoted werden mit @: 176 @ example178 @smallexample 177 179 int i=3; 178 180 // Kommentare ueber mehere Zeilen duerfen natuerlich … … 180 182 @{@} // quote von geschweiften Klammern 181 183 @expansion{} 3 182 @end example184 @end smallexample 183 185 184 186 + Beim Schreiben von Singular-Beispielen (insbesondere von … … 248 250 249 251 ------------------------------------------------------------ 250 $Id: STYLEGUIDE,v 1.1 0 1999-07-01 12:47:59obachman Exp $252 $Id: STYLEGUIDE,v 1.11 1999-07-09 14:12:46 obachman Exp $ -
doc/doc2tex.pl
r63374c r609ba11 1 1 #!/usr/local/bin/perl 2 # $Id: doc2tex.pl,v 1. 4 1999-07-07 16:38:34obachman Exp $2 # $Id: doc2tex.pl,v 1.5 1999-07-09 14:12:47 obachman Exp $ 3 3 ################################################################### 4 4 # Computer Algebra System SINGULAR … … 292 292 # break after $ex_length characters 293 293 $to_do = $_; 294 while (length($to_do) > $ex_length )294 while (length($to_do) > $ex_length && $to_do =~ /\w/) 295 295 { 296 296 $done .= substr($to_do, 0, $ex_length)."\\\n "; … … 570 570 { 571 571 print LDOC "\@strong{Example:}\n"; 572 print LDOC "\@ example\n\@c example\n";572 print LDOC "\@smallexample\n\@c example\n"; 573 573 print LDOC $example; 574 print LDOC "\n\@c example\n\@end example\n";574 print LDOC "\n\@c example\n\@end smallexample\n"; 575 575 } 576 576 OutRef(\*LDOC, $ref) if $ref; … … 639 639 sub FormatInfoText 640 640 { 641 s/^\s*//; # remove whitespaces from beginning and end 642 s/\s*$//; 643 s/ +/ /g; # replace double whitespeces by one 644 &protect_texi; # protect texinfo special chars 645 s/\n/\n\@*/g; # replace newline by forced newline 641 my $length = shift; 642 $length = 0 unless $length; 643 # insert @* infront of all lines whose previous line is shorter than 644 # 60 characters 645 $_ = ' ' x $length . $_; 646 if (/^(.*)\n/) 647 { 648 $_ .= "\n"; 649 my $pline; 650 my $line; 651 my $ptext = $_; 652 my $text = ''; 653 while ($ptext =~ /(.*)\n/g) 654 { 655 $line = $1; 656 $text .= '@*' 657 if ($line =~ /\w/ && $pline =~ /\w/ && 658 ((length($pline) < 60) || $line =~ /^\s*\w\(.*?\)/)); 659 $line =~ s/\s*$//; 660 $text .= "$line\n"; 661 $pline = $line; 662 } 663 $_ = $text; 664 } 665 s/\t/ /g; 666 s/\n +/\n/g; 667 s/\s*$//g; 668 s/ +/ /g; # replace double whitespaces by one 669 s/\@\*\s*/\@\*/g; 670 s/(\@[^\*])/\@$1/g; # escape @ signs, except @* 671 s/{/\@{/g; 672 s/}/\@}/g; 646 673 } 647 674 … … 678 705 if ($l_fun) 679 706 { 680 print $FH "\@strong{$item }\n\@menu\n";707 print $FH "\@strong{$item:}\n\@menu\n"; 681 708 } 682 709 else 683 710 { 684 print $FH "\@item \@strong{$item }\n\@table \@asis\n";711 print $FH "\@item \@strong{$item:}\n\@table \@asis\n"; 685 712 } 686 713 while ($text =~ /(.*\n)/g) … … 725 752 { 726 753 # just print the text 727 &FormatInfoText;754 FormatInfoText(length($item) + 1); 728 755 # if functions are in text, then make it in code 729 756 s/(\w+\(.*?\))/\@code{$1}/g … … 741 768 s/^[;\s]*//; 742 769 s/\n/ /g; 743 &FormatInfoText;770 FormatInfoText(); 744 771 745 772 if ($l_fun) … … 790 817 # erase EXAMPLE, echo and pause statements 791 818 $example =~ s/"EXAMPLE.*"[^;]*;//g; 792 $example =~ s/echo[^;\n]*;//g; 793 $example =~ s/pause\(.*?\)[^;]*;//g; 819 $example .= "\n"; 820 my ($mexample, $line); 821 while ($example =~ m/(.*)\n/g) 822 { 823 $line = $1; 824 $line =~ s|echo[^;]*;||g if $line !~ m|(.*)//(.*)echo[^;]*;|; 825 $line =~ s|pause\(.*?\)[^;]*;||g if $line !~ m|(.*)//(.*)pause\(.*?\)[^;]*;|; 826 $mexample .= "$line\n"; 827 } 828 $example = $mexample; 794 829 795 830 # prepend LIB command
Note: See TracChangeset
for help on using the changeset viewer.