| 1 |
void _manual(string conversion, int usePath, string macroBase) |
| 2 |
{ |
| 3 |
string includes; |
| 4 |
string manualDestination; |
| 5 |
|
| 6 |
includes = " -I.:" + g_wip + ":" + macroBase + ":manual"; |
| 7 |
|
| 8 |
manualDestination = g_install + DOCDOC; |
| 9 |
|
| 10 |
if (usePath) |
| 11 |
{ |
| 12 |
putenv("YODL_BIN=" + g_cwd + g_install + BIN); |
| 13 |
run("yodl2" + conversion + includes + |
| 14 |
" -o" + manualDestination + |
| 15 |
" manual"); |
| 16 |
} |
| 17 |
else |
| 18 |
{ |
| 19 |
run(g_install + BIN + "/yodl" + includes + |
| 20 |
" -o" + g_wip + "/out " + |
| 21 |
conversion + " manual"); |
| 22 |
if (conversion == "latex") |
| 23 |
run("mv " + g_wip + "/out " + g_install + DOCDOC + "/yodl.latex"); |
| 24 |
else |
| 25 |
{ |
| 26 |
run(g_install + BIN + "/yodlpost " |
| 27 |
+ g_wip + "/out.idx " + g_wip + "/out " + |
| 28 |
"yodl." + conversion); |
| 29 |
run("mv yodl*." + conversion + " " + manualDestination); |
| 30 |
} |
| 31 |
} |
| 32 |
|
| 33 |
if (conversion == "latex") |
| 34 |
{ |
| 35 |
fprintf << "/tmp/commands" << "chdir " + g_install + DOCDOC << '\n'; |
| 36 |
chdir(g_install + DOCDOC); |
| 37 |
|
| 38 |
runP(P_NOCHECK, "latex yodl.latex"); |
| 39 |
runP(P_NOCHECK, "latex yodl.latex"); |
| 40 |
run("latex yodl.latex"); |
| 41 |
run("rm yodl.aux yodl.log yodl.toc"); |
| 42 |
|
| 43 |
run("dvips -o yodl.ps yodl.dvi"); |
| 44 |
run("ps2pdf yodl.ps yodl.pdf"); |
| 45 |
fprintf << "/tmp/commands" << g_cwd << '\n'; |
| 46 |
chdir(g_cwd); |
| 47 |
} |
| 48 |
} |
| 49 |
|
| 50 |
void manualMayExit(string variant, |
| 51 |
string path, int doExit) // doExit == 0, then only html |
| 52 |
{ |
| 53 |
int idx; |
| 54 |
int usePath; |
| 55 |
string macroBase; |
| 56 |
|
| 57 |
usePath = path == "path"; |
| 58 |
macroBase = g_wip + "/macros"; |
| 59 |
|
| 60 |
md(g_install + DOCDOC); |
| 61 |
|
| 62 |
if (variant != "latex") |
| 63 |
_manual("html", usePath, macroBase); |
| 64 |
|
| 65 |
if (doExit) |
| 66 |
{ |
| 67 |
if (variant == "") |
| 68 |
_manual("txt", usePath, macroBase); |
| 69 |
if (variant != "html") |
| 70 |
_manual("latex", usePath, macroBase); |
| 71 |
exit(0); |
| 72 |
} |
| 73 |
} |
| 74 |
|
| 75 |
void manualExit(string variant, string path) |
| 76 |
{ |
| 77 |
manualMayExit(variant, path, 1); |
| 78 |
} |