Skip to content

Commit 790a349

Browse files
GAPgap
authored andcommitted
Some small changes following hints by Stefan Kohl.
- handle '^' correctly in TeX. - allow HTML markup in <Alt .. for HTML. - use the above changes in Example. - throw out {}'s in BibTeX titles for HTML. git-svn-id: path/gapdoc/trunk@34
1 parent ece5636 commit 790a349

File tree

5 files changed

+33
-18
lines changed

5 files changed

+33
-18
lines changed

example/example.xml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="ISO-8859-1"?>
22

3-
<!-- $Id: example.xml,v 1.5 2001-11-16 15:20:47 gap Exp $ -->
3+
<!-- $Id: example.xml,v 1.6 2002-04-21 22:42:30 gap Exp $ -->
44

55
<!DOCTYPE Book SYSTEM "gapdoc.dtd"
66
[ <!ENTITY see '<Alt Only="LaTeX">$\to$</Alt><Alt Not="LaTeX">--&tgt;</Alt>'>]>
@@ -77,7 +77,7 @@
7777
</ManSection>
7878

7979
<ManSection>
80-
<Meth Name="\A_b" Arg="c" Label="for nothing" Comm="tricky name"/>
80+
<Meth Name="\^" Arg="c" Label="for nothing" Comm="tricky name"/>
8181
<Description>
8282
This method is for an operation with a tricky name.
8383
</Description>
@@ -200,7 +200,8 @@ that are possible in &GAPDoc;:
200200

201201
<Alt Only="LaTeX">This is &LaTeX; output.</Alt>
202202
<Alt Not="LaTeX">This is other than &LaTeX; output, namely:
203-
<Alt Only="HTML">HTML</Alt><Alt Only="Text">Text</Alt> output.</Alt>
203+
<Alt Only="HTML"><![CDATA[<b>HTML</b>]]></Alt>
204+
<Alt Only="Text">Text</Alt> output.</Alt>
204205

205206
<P/>
206207

@@ -311,7 +312,7 @@ Here is a reference to chapter <Ref Chap="First"/>, to appendix
311312

312313
We distinguish among others references
313314
to functions (see <Ref Func="f"/>),
314-
to methods with tricky name (see <Ref Meth="\A_b" Label="for nothing"/>),
315+
to methods with tricky name (see <Ref Meth="\^" Label="for nothing"/>),
315316
to operations (see <Ref Oper="MyOperation"/>),
316317
to methods (see <Ref Meth="MyOperation" Label="First"/> or
317318
<Ref Meth="MyOperation" Label="for bla"/>),
@@ -560,7 +561,7 @@ This is an appendix.
560561
</ManSection>
561562
562563
<ManSection>
563-
<Meth Name="\A_b" Arg="c" Label="for nothing" Comm="tricky name"/>
564+
<Meth Name="\^" Arg="c" Label="for nothing" Comm="tricky name"/>
564565
<Description>
565566
This method is for an operation with a tricky name.
566567
</Description>
@@ -686,7 +687,8 @@ that are possible in &GAPDoc;:
686687
687688
<Alt Only="LaTeX">This is &LaTeX; output.</Alt>
688689
<Alt Not="LaTeX">This is other than &LaTeX; output, namely:
689-
<Alt Only="HTML">HTML</Alt><Alt Only="Text">Text</Alt> output.</Alt>
690+
<Alt Only="HTML"><![CDATA[<b>HTML</b>]]>]<![CDATA[]></Alt>
691+
<Alt Only="Text">Text</Alt> output.</Alt>
690692
691693
<P/>]]>
692694
</Listing>
@@ -815,7 +817,7 @@ Here is a reference to chapter <Ref Chap="First"/>, to appendix
815817
816818
We distinguish among others references
817819
to functions (see <Ref Func="f"/>),
818-
to methods with tricky name (see <Ref Meth="\A_b" Label="for nothing"/>),
820+
to methods with tricky name (see <Ref Meth="\^" Label="for nothing"/>),
819821
to operations (see <Ref Oper="MyOperation"/>),
820822
to methods (see <Ref Meth="MyOperation" Label="First"/> or
821823
<Ref Meth="MyOperation" Label="for bla"/>),

init.g

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
##
33
#A init.g GAPDoc Frank Lübeck / Max Neunhöffer
44
##
5-
#H @(#)$Id: init.g,v 1.5 2001-11-28 15:07:04 gap Exp $
5+
#H @(#)$Id: init.g,v 1.6 2002-04-21 22:42:30 gap Exp $
66
##
77
#Y Copyright (C) 2000, Frank Lübeck and Max Neunhöffer,
88
#Y Lehrstuhl D für Mathematik, RWTH Aachen
@@ -14,8 +14,6 @@ DeclarePackageAutoDocumentation("GAPDoc", "doc", "GAPDoc",
1414
DeclarePackageAutoDocumentation("GAPDoc", "example", "GAPDoc Example",
1515
"Extensive Example for GAPDoc");
1616

17-
#DeclarePackage("gapdoc", "0.9", ReturnTrue);
18-
#DeclarePackageDocumentation("gapdoc", "doc");
1917

2018
ReadPkg("GAPDoc", "banner.g");
2119

lib/BibTeX.gi

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
##
33
#W BibTeX.gi GAPDoc Frank Lübeck
44
##
5-
#H @(#)$Id: BibTeX.gi,v 1.7 2001-11-26 13:57:32 gap Exp $
5+
#H @(#)$Id: BibTeX.gi,v 1.8 2002-04-21 22:42:30 gap Exp $
66
##
77
#Y Copyright (C) 2000, Frank Lübeck, Lehrstuhl D für Mathematik,
88
#Y RWTH Aachen
@@ -513,16 +513,17 @@ InstallGlobalFunction(PrintBibAsHTML, function(arg)
513513
Print("(", r.editor, ",Ed.)");
514514
fi;
515515
if IsBound(r.title) then
516-
Print(",\n <i>", r.title, "</i>");
516+
# throw out {}'s
517+
Print(",\n <i>", Filtered(r.title, x -> not x in "{}"), "</i>");
517518
fi;
518519
if IsBound(r.booktitle) then
519520
if r.Type in ["inproceedings", "incollection"] then
520521
Print(" in ");
521522
fi;
522-
Print(",\n <i>", r.booktitle, "</i>");
523+
Print(",\n <i>", Filtered(r.booktitle, x -> not x in "{}"), "</i>");
523524
fi;
524525
if IsBound(r.subtitle) then
525-
Print(",\n <i> -- ", r.subtitle, "</i>");
526+
Print(",\n <i> -- ",Filtered(r.subtitle, x -> not x in "{}"), "</i>");
526527
fi;
527528
if IsBound(r.journal) then
528529
Print(",\n ", r.journal);

lib/GAPDoc2HTML.gi

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
##
33
#W GAPDoc2HTML.gi GAPDoc Frank Lübeck
44
##
5-
#H @(#)$Id: GAPDoc2HTML.gi,v 1.10 2001-11-28 14:20:49 gap Exp $
5+
#H @(#)$Id: GAPDoc2HTML.gi,v 1.11 2002-04-21 22:42:30 gap Exp $
66
##
77
#Y Copyright (C) 2000, Frank Lübeck, Lehrstuhl D für Mathematik,
88
#Y RWTH Aachen
@@ -787,8 +787,8 @@ end;
787787
GAPDoc2HTMLProcs.PCDATAFILTER := function(r, str)
788788
local s, a;
789789
s := r.content;
790-
if Position(s, '<') <> fail or Position(s, '&') <> fail or
791-
Position(s, '>') <> fail then
790+
if not IsBound(r.HTML) and (Position(s, '<') <> fail or
791+
Position(s, '&') <> fail or Position(s, '>') <> fail) then
792792
for a in s do
793793
if a='<' then
794794
Append(str, "&lt;");
@@ -1304,11 +1304,24 @@ GAPDoc2HTMLProcs.TheIndex := function(r, par)
13041304
end;
13051305

13061306
GAPDoc2HTMLProcs.AltYes := function(r)
1307+
local mark;
1308+
# recursively mark text as HTML code (no excaping of HTML markup)
1309+
mark := function(r)
1310+
local a;
1311+
if IsString(r.content) then
1312+
r.HTML := true;
1313+
elif IsList(r.content) then
1314+
for a in r.content do
1315+
mark(a);
1316+
od;
1317+
fi;
1318+
end;
13071319
if (not IsBound(r.attributes.Only) and not IsBound(r.attributes.Not)) or
13081320
(IsBound(r.attributes.Only) and
13091321
"HTML" in SplitString(r.attributes.Only, "", " ,")) or
13101322
(IsBound(r.attributes.Not) and
13111323
not "HTML" in SplitString(r.attributes.Not, "", " ,")) then
1324+
mark(r);
13121325
return true;
13131326
else
13141327
return false;

lib/GAPDoc2LaTeX.gi

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
##
33
#W GAPDoc2LaTeX.gi GAPDoc Frank Lübeck
44
##
5-
#H @(#)$Id: GAPDoc2LaTeX.gi,v 1.3 2001-01-24 14:05:12 gap Exp $
5+
#H @(#)$Id: GAPDoc2LaTeX.gi,v 1.4 2002-04-21 22:42:30 gap Exp $
66
##
77
#Y Copyright (C) 2000, Frank Lübeck, Lehrstuhl D für Mathematik,
88
#Y RWTH Aachen
@@ -120,6 +120,7 @@ end);
120120
GAPDoc2LaTeXProcs.EscapeUsBs := function(str)
121121
str := SubstitutionSublist(str, "\\", "\\texttt{\\symbol{92}}");
122122
str := SubstitutionSublist(str, "_", "{\\_}");
123+
str := SubstitutionSublist(str, "^", "{\\^{}}");
123124
return str;
124125
end;
125126

0 commit comments

Comments
 (0)