-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmakedoc.g
60 lines (53 loc) · 1.61 KB
/
makedoc.g
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
49
50
51
52
53
54
55
56
57
58
59
60
Read( "PackageInfo.g" );
info := GAPInfo.PackageInfoCurrent;
pkgName := info.PackageName;
if (
LoadPackage( pkgName, false ) = fail or
LoadPackage( "AutoDoc", false ) = fail
) then
Info( InfoGAPDoc, 1, "#I Could not load required package(s).\n" );
ForceQuitGap( 1 );
fi;
if IsBound( info.Extensions ) then
for ext in info.Extensions do
for pkgver in ext.needed do
LoadPackage( pkgver[1], pkgver[2], false );
od;
od;
fi;
AutoDoc( rec(
autodoc := rec( scan_dirs := [ "doc" ] ),
gapdoc := rec(
LaTeXOptions := rec( LateExtraPreamble := "\\usepackage{amsmath}" )
),
extract_examples := rec( units := "File" )
));
if not ForAll(
[ "doc/manual.six", "doc/manual.pdf", "doc/chap0.html" ],
IsReadableFile
) then
Info( InfoGAPDoc, 1, "#I One or more files could not be created.\n" );
ForceQuitGap( 1 );
else
Info( InfoGAPDoc, 1, "#I Manual files sucessfully created.\n" );
fi;
tstFile := Concatenation(
"tst/",
ReplacedString( LowercaseString( pkgName ), " ", "_" ),
"01.tst"
);
if IsReadableFile( tstFile ) then
Info( InfoGAPDoc, 1, "#I Testing examples found in manual.\n" );
correct := Test( tstFile, rec( compareFunction := "uptowhitespace" ) );
RemoveFile( tstFile );
if correct then
Info( InfoGAPDoc, 1, "#I All examples are correct.\n" );
else
Info( InfoGAPDoc, 1, "#I One or more examples are incorrect.\n" );
ForceQuitGap( 1 );
fi;
else
Info( InfoGAPDoc, 1, "#I No examples found in manual.\n" );
fi;
Info( InfoGAPDoc, 1, "#I Documentation successfully created.\n" );
QuitGap( 0 );