4
WriteString("Creating Book ");
5
WriteString(title);NewLine();
7
plain["Title"] := title;
12
currentBody[2] := currentBody[2]:text;
16
plain["Chapters"][currentChapter]["Body"]:=
17
plain["Chapters"][currentChapter]["Body"] : text;
24
WriteString(" Creating Chapter ");
25
WriteString(title);NewLine();
26
currentChapter:=title;
27
currentChapterIndex++;
28
currentSectionIndex:=0;
29
plain["Chapters"][currentChapter]:={};
30
plain["Chapters"][currentChapter]["Sections"]:={};
31
plain["Chapters"][currentChapter]["Body"]:="";
33
currentBody := Assoc("Body",plain["Chapters"][currentChapter]);
35
plain["Chapters"][currentChapter]["Index"]:=currentChapterIndex;
36
plain["Chapters"][currentChapter]["Intro"]:=HtmlTag(chapter, title);
37
plain["Chapters"][currentChapter]["Commands"]:={};
39
/*TODO remove? AddAnchor(ChapterTag(currentChapterIndex)); */
44
plain["Chapters"][currentChapter]["Intro"] :=
45
plain["Chapters"][currentChapter]["Intro"] : text : newline;
48
Bodied("ChapterIntro", 60000);
52
AddBody(HtmlAnchor()aAnchor);
53
plain["Chapters"][currentChapter]["Commands"] :=
54
Concat(plain["Chapters"][currentChapter]["Commands"],
55
{{ChapterLink(aAnchor), ""}});
58
SectionTag(chapterIndex,sectionIndex):=
59
"c" : String(chapterIndex) : "s" : String(sectionIndex) ;
61
ChapterTag(chapterIndex):=
62
"c" : String(chapterIndex) ;
66
WriteString(" Creating Section ");
67
WriteString(title);NewLine();
69
currentSectionIndex++;
70
plain["Chapters"][currentChapter]["Sections"][title]:=
72
AddBody(HtmlAnchor()SectionTag(currentChapterIndex,currentSectionIndex));
73
AddBody(HtmlTag(section,"<HR>":title));
76
CmdDescription(cmd, desc) :=
78
AddBody(HtmlAnchor() cmd);
79
AddBody(HtmlAnchor() ToLowerCase(cmd)); // add a lowercase version for easier help
80
SubSection(cmd : " -- " : desc);
81
plain["Chapters"][currentChapter]["Commands"] :=
82
Concat(plain["Chapters"][currentChapter]["Commands"],
83
{{ChapterLink(cmd), desc}});
87
HtmlLink(aLink, plain["BaseName"] : "chapter"
88
: String(currentChapterIndex) : ".html",
94
WriteString(" Sub section ");
95
WriteString(title);NewLine();
97
AddBody(HtmlTag(subsection,"<HR>":title));
102
AddBody(HtmlTag(topical,title));
108
AddBody(text : newline);
114
plain["Blurb"]:=text;
117
HtmlCommand(command):=
120
"<TR>" : "<TD WIDTH=100% bgcolor=e0e0e0>" : "<PRE>" : command : "</PRE></TR>"
124
HtmlTerm(term):= ("<B><TT>" : EscapeLtGt(term) : "</TT></B>");
126
HtmlEmphasis(word) := ("<I>" : word : "</I>");
128
HtmlBreak():="<P> </P>";
133
"<UL>" : body : "</UL>";
135
Bodied("Enumerate",2);
139
"<UL>" : body : "</UL>";
153
Bodied("Book",60000);
155
Bodied("Title",60000);
156
Bodied("Author",60000);
158
Bodied("Chapter",60000);
160
Bodied("Section",60000);
161
Bodied("SubSection",60000);
162
Bodied("Topical",60000);
163
Bodied("Text",60000);
165
Bodied("Blurb",60000);
166
Bodied("DocumentationComment",60000);
169
RuleBase("WriteItem",{item});
170
Rule("WriteItem",1,1,IsString(item)) WriteString(item);
171
Rule("WriteItem",1,2,True) Write(item);
189
plain:=site["Books"][book];
194
/* create a new book */
195
site["Books"][basename]:={};
196
SelectBook(basename);
197
plain["BaseName"]:=basename;
198
plain["Chapters"] := {};
201
currentChapterIndex:=0;
202
currentSectionIndex:=0;
207
SimpleSectionsIndex(filename,chapter,sections):=
209
Local(bl,section,index);
211
index:=plain["Chapters"][chapter]["Index"];
213
ForEach(section,sections)
215
bl := bl:HtmlTag(bullet,
216
HtmlLink(section,filename,SectionTag(index,
217
plain["Chapters"][chapter]["Sections"][section]),""));
223
SimpleChapterIndex(filename,chapters):=
227
ForEach(chapter,chapters)
229
bl := bl:HtmlTag(bullet,
230
HtmlLink(chapter,filename,
231
ChapterTag(plain["Chapters"][chapter]["Index"]),""));
233
sections:=AssocIndices(plain["Chapters"][chapter]["Sections"]);
236
bl:=bl : HtmlTag(bullets,SimpleSectionsIndex(filename,chapter,sections));
243
FramedSectionsIndex(filename,chapter,sections):=
245
Local(bl,section,index);
247
/* sections:=AssocIndices(plain["Chapters"][chapter]["Sections"]); */
248
index:=plain["Chapters"][chapter]["Index"];
250
ForEach(section,sections)
252
bl := bl:HtmlTag(bullet,
253
HtmlLink(section,filename,SectionTag(index,
254
plain["Chapters"][chapter]["Sections"][section]),"Chapters"));
259
FramedChapterIndex(chapters):=
263
ForEach(chapter,chapters)
266
index:=plain["Chapters"][chapter]["Index"];
267
file:=plain["BaseName"] : "chapter" : String(index) : ".html";
268
bl := bl:HtmlTag(bullet,
269
HtmlLink(chapter,file,
270
ChapterTag(plain["Chapters"][chapter]["Index"]),"Chapters"));
273
sections:=AssocIndices(plain["Chapters"][chapter]["Sections"]);
276
bl:=bl : HtmlTag(bullets,FramedSectionsIndex(file,chapter,sections));
285
GroupBooks(first,second):=
287
site["Books"][first]["Chapters"] :=
288
Concat(site["Books"][second]["Chapters"], site["Books"][first]["Chapters"]);
295
filename:=plain["BaseName"] : ".html";
297
WriteString("Writing ");
298
WriteString(filename);
301
ToFile(HtmlFile(filename))
303
Local(bodytext,chapter,chapters,pcc);
305
chapters:=AssocIndices(plain["Chapters"]);
306
bodytext:=bodytext : HtmlTag(book,plain["Title"]);
308
bodytext:= bodytext : HtmlTag(bullets,SimpleChapterIndex(filename,chapters));
310
ForEach(chapter,chapters)
312
pcc := plain["Chapters"][chapter];
313
bodytext:=bodytext : (HtmlAnchor() ChapterTag(pcc["Index"]))
314
: ChapterHeader(pcc["Commands"]) : pcc["Intro"] : pcc["Body"]
321
HtmlTitle(plain["Title"]) :
322
HtmlTag(font,HtmlTag(body,bodytext)) /*hier*/
329
Local(chapter,chapters);
330
chapters:=AssocIndices(plain["Chapters"]);
332
ToFile(HtmlFile(plain["BaseName"] : "manual.html"))
337
HtmlFrameSetCols("240,*",
338
HtmlFrameSetRows("110,*",
339
HtmlFrame("manicon.html","") :
340
HtmlFrame(plain["BaseName"] : "chapters.html","")
342
HtmlFrame(plain["BaseName"] : "chapter1.html","Chapters")
349
WriteString("Writing ");
350
WriteString(plain["BaseName"]);
353
ToFile(HtmlFile(plain["BaseName"] : "chapters.html"))
356
HtmlTag(font,HtmlTag(indexbody,
357
HtmlTag(bullets,FramedChapterIndex(chapters)))
360
ForEach(chapter,chapters)
362
Local(pcc,file,index,str,keyword);
363
pcc := plain["Chapters"][chapter];
364
index := pcc["Index"];
365
file := plain["BaseName"] : "chapter" : String(index) : ".html";
366
str := HtmlAnchor() ChapterTag(index);
367
str := str : ChapterHeader(pcc["Commands"]);
368
str := str : pcc["Intro"] : "<p> </p>" : newline;
369
If (pcc["Commands"] != {},
370
str := str : ChapterTOC(pcc["Commands"]));
371
str := str : pcc["Body"];
372
str := HtmlTitle(chapter) : newline : HtmlTag(body, HtmlTag(font, str));
373
ToFile(HtmlFile(file)) WriteString(HtmlTag(html, str));
378
10 # ChapterHeader({}) <-- "";
379
20 # ChapterHeader(_alist) <--
382
str := Head(alist)[1];
383
ForEach(keyword, Tail(alist))
384
str := str : ", " : keyword[1];
385
str := str : "." : newline;
390
Local(str, flag, keyword);
392
ForEach(keyword, alist)
393
flag := flag And (keyword[2] = "");
395
str := "", /* If there are no descriptions, a TOC has no use */
397
str := "<CENTER><TABLE>";
398
str := str : newline;
399
ForEach(keyword, alist)
400
str := str : "<TR BGCOLOR=#E0E0E0>" : newline
401
: "<TD>" : keyword[1] : "</TD>" : newline
402
: "<TD>" : keyword[2] : "</TD>" : newline
404
str := str : "</TABLE></CENTER>" : newline;
410
Local(book,books,bl);
412
books:=AssocIndices(site["Books"]);
416
bookinfo:=site["Books"][book];
419
"<TR>" : "<TD bgcolor=e0e0e0><FONT face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"3\">
420
" : HtmlLink(bookinfo["Title"],book:"manual.html","","_top") :
421
/* " or " : HtmlLink(" (single file) ",bookinfo["BaseName"]:".html","","_top") : */
422
"</TR><TR>" : "<TD bgcolor=ffffff><FONT face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"3\">
423
" : bookinfo["Blurb"] :"</TR>";
431
WriteString("Creating book index"); NewLine();
432
ToFile(HtmlFile("books.html"))
436
HtmlTitle("Yacas documentation") :
438
"<center><H1>Yacas documentation</H1></center>":
439
HtmlTag(body,HtmlTable(3,"",
440
/* HtmlCaption("Yacas documentation"): */
441
BookList()))) /*hier*/
449
10 # SeeAlso({}) <-- True;
450
20 # SeeAlso(_list) <--
453
AddBody(SeeAlso1(Head(list)));
454
ForEach(item, Tail(list)) AddBody(", " : SeeAlso1(item));
458
SeeAlso1(_seealso) <-- HtmlLink(seealso, "ref.html", seealso, "Chapters");
465
AddBody(HtmlLink(item,"ref.html",item,"Chapters"):", ");
470
BuiltIn() <-- AddBody("<h5 align=right>Internal function</h5>");
471
UnixSpecific() <-- AddBody("<h5 align=right>Unix-specific add-on</h5>");
472
MacSpecific() <-- AddBody("<h5 align=right>Macintosh-specific add-on</h5>");
473
MSWinSpecific() <-- AddBody("<h5 align=right>MS Windows-specific add-on</h5>");
474
StandardLib() <-- AddBody("<h5 align=right>Standard library</h5>");
476
/* alias for Load() that can be redefined */
477
IncludeFile(x) := [ Load(x); GarbageCollect(); ];
479
RuleBase("TeXMath", {x});
480
RuleBase("TeXMathD", {x});
481
RuleBase("TeXMathD", {x,y});
483
/* mathematical expressions */
484
TeXMath(x) := "<b>" : EscapeLtGt(ToString() Write(x)) : "</b>";
486
<p><center><b> " : EscapeLtGt(ToString() Write(x)) : " </b></center></p>
488
// special form: punctuation at the end of a displayed equation
489
TeXMathD(_x, _string) <-- "
490
<p><center><b> " : EscapeLtGt(ToString() Write(x)) : string : " </b></center></p>
493
HoldArg("TeXMath",x);
494
HoldArg("TeXMathD",x);
496
/* Replace all < and > characters in a string by < and > */
497
EscapeLtGtStrings := { {"<", "<"}, {">", ">"}, {"&", "&"} };
498
EscapeLtGt(string) := [
501
For(i:=1, i<=Length(string), i++) result := result : If(EscapeLtGtStrings[string[i]] != Empty, EscapeLtGtStrings[string[i]], string[i]);
505
/* Convert ASCII-7 string to lowercase */
564
ToLowerCase(string) :=
568
For(i:=1, i<=Length(string), i++) result := result : If(UCStrings[string[i]] != Empty, UCStrings[string[i]], string[i]);