File: updateUndocumented.gi

package info (click to toggle)
gap-hap 1.73%2Bds-1
  • links: PTS
  • area: main
  • in suites: forky
  • size: 58,508 kB
  • sloc: xml: 16,467; sh: 197; javascript: 155; makefile: 121; ansic: 47; perl: 24
file content (48 lines) | stat: -rw-r--r-- 1,488 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#To run this file just something like the following (the -A is important). 
#    gap -l '/home/graham/;' -A -r update.gi

root:=DirectoriesPackageLibrary("HAP");
rootversion:=Filename(root,"../version");
root:=Filename(root,".");
root:=Concatenation(root{[1..Length(root)-5]},"doc/");

MakeGAPDocDoc(root,"newHapMan.xml",[],"HAP","MathJax");
i:=InputTextFile(rootversion);;
version:=ReadAll(i);;
version:=NormalizedWhitespace(version);;

hapvariables:= PackageVariablesInfo("HAP",version);;
h:=List(hapvariables,x->x[2]);;
hapvariables:=[];;
for i in [1..Length(h)] do
for j in [1..Length(h[i])] do
Add(hapvariables,h[i][j][1]);
od;od;


input:=InputTextFile(Concatenation(root,"chapInd.txt"));
hapindex:=ReadAll(input);;
hapindex:=ReplacedString(hapindex,"[2X","@");;
hapindex:=SplitString(hapindex,['@']);;
hapindex:=hapindex{[2..Length(hapindex)]};;
hapindex:=List(hapindex,s->SplitString(s,['\033']));;
hapindex:=List(hapindex,x->x[1]);;

hapundocumented:=Filtered(hapvariables,x->not x[1] in hapindex);;

s:="<Chapter><Heading>HAP variables that are not yet documented</Heading>\n<Section><Heading> &nbsp;</Heading><Br/>";

PrintTo(Concatenation(root,"Undocumented.xml"),s);

for x in hapundocumented do
s:=ReplacedString(x[1],"<","\<");
s:=Concatenation("<C>",s,"</C><Br/>\n");

AppendTo(Concatenation(root,"Undocumented.xml"),s);
od;

s:="</Section>\n</Chapter>\n";
AppendTo(Concatenation(root,"Undocumented.xml"),s);

MakeGAPDocDoc(root,"newHapMan.xml",[],"HAP","MathJax");
QUIT;