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 61 62 63 64
|
#!/usr/bin/env bash
set -e
set -o pipefail
GAP=@abs_top_builddir@/bin/gap.sh
GAPARGS="-b -m 1g -x 80 -q -r --quitonbreak"
echo "--------------------"
echo "Building GAP manuals"
echo "--------------------"
"$GAP" $GAPARGS -A <<EOF
base:="@abs_top_srcdir@";;
books:=["ref", "tut", "changes", "hpc", "dev"];;
latexOpts := rec(Maintitlesize := "\\\\fontsize{36}{38}\\\\selectfont");;
for run in [1,2] do
for book in books do
path := Concatenation(base, "/doc/", book);
dir := Directory(path);
# skip over missing manuals
if not IsDirectoryPath(path) then
continue;
fi;
Print("----------------------------\n");
Print("Building GAP manual '",book,"' at ",path,"\n");
Print("Run ",run," of 2\n");
Print("----------------------------\n");
# for the reference manual, extra list of source files to scan
if book = "ref" then
f := Filename(dir, "makedocreldata.g");
Read(f);
files := GAPInfo.ManualDataRef.files;
else
files := [];
fi;
if run = 2 then
# create black&white version of manual (but only on second run)
SetGapDocLaTeXOptions("nocolor", latexOpts);
MakeGAPDocDoc( path, "main.xml", files, book, "../..", "MathJax" );;
# Rename the generated black&white PDF
f1 := Filename(dir, "manual.pdf");
f2 := Filename(dir, "manual-bw.pdf");
Exec(Concatenation("mv -f ", f1, " ", f2));
# convert manual.six to manual.lab, to allow old-style package manuals
# to reference the manual
GAPDocManualLabFromSixFile( book, Filename(dir, "manual.six") );;
#
CopyHTMLStyleFiles(dir);
fi;
# create manuals with color
SetGapDocLaTeXOptions("color", latexOpts);
MakeGAPDocDoc( path, "main.xml", files, book, "../..", "MathJax" );;
od;
od;
EOF
|