Progressed on generalizing functions.
This commit is contained in:
@ -41,15 +41,16 @@ $content->load(__DIR__ . "/$sourceFolder/$lang.htm");
|
||||
// Find out title
|
||||
|
||||
$title = $content->getElementsByTagName("h1")[0]->nodeValue;
|
||||
$bgImg = $content->getElementsByTagName("h1")[0]->getAttribute("data-bgimage");
|
||||
|
||||
// Generate PDF if need be.
|
||||
|
||||
if (filemtime(__DIR__ . "/tex/$lang/$sourceTeXFile.tex") -5000 < filemtime(__DIR__ . "/$sourceFolder/$lang.htm")) {
|
||||
if (filemtime(__DIR__ . "/tex/$lang/$sourceTeXFile.tex") < filemtime(__DIR__ . "/$sourceFolder/$lang.htm")) {
|
||||
|
||||
foreach ($content->getElementsByTagName("section") as $c) {
|
||||
DOMtoTeX($c, "tex/$lang");
|
||||
}
|
||||
runPDF("tex/$lang", "$sourceFile", "$sourceFile", $title, $lang, true);
|
||||
runPDF("tex/$lang", "$sourceFile", "$sourceFile", ["title" => $title, "bgImg" => $bgImg], $lang, true);
|
||||
|
||||
}
|
||||
|
||||
@ -59,6 +60,6 @@ $content = file_get_contents(__DIR__ . "/$sourceFolder/$lang.htm");
|
||||
|
||||
$content = str_replace("\\today", date("Y-m-d", filemtime(__DIR__ . "/$sourceFolder/$lang.htm")), $content);
|
||||
|
||||
echo printHTMLPage("about:" . $title, $content, $lang, $availableLangs);
|
||||
echo printHTMLPage("about:" . $title, $content, $lang, $availableLangs, "", $sourceFile);
|
||||
|
||||
?>
|
||||
|
Reference in New Issue
Block a user