1
0

APIDump: Added timestamp to all generated HTML pages.

Ref.: #2204
This commit is contained in:
Mattes D 2015-06-04 12:23:38 +02:00
parent d871c47505
commit f645673bae
2 changed files with 22 additions and 9 deletions

View File

@ -61,7 +61,7 @@ footer
font-family: Segoe UI Light, Helvetica; font-family: Segoe UI Light, Helvetica;
} }
#content #content, #timestamp
{ {
padding: 0px 25px 25px 25px; padding: 0px 25px 25px 25px;
} }

View File

@ -153,6 +153,16 @@ end
--- Returns the timestamp in HTML format
-- The timestamp will be inserted to all generated HTML files
local function GetHtmlTimestamp()
return string.format("<div id='timestamp'>Generated on %s</div>", os.date("%Y-%m-%d %H:%M:%S"))
end
local function WriteArticles(f) local function WriteArticles(f)
f:write([[ f:write([[
<a name="articles"><h2>Articles</h2></a> <a name="articles"><h2>Articles</h2></a>
@ -296,7 +306,9 @@ local function WriteHtmlHook(a_Hook, a_HookNav)
f:write("<p>", (example.Desc or "<i>missing Desc</i>"), "</p>\n"); f:write("<p>", (example.Desc or "<i>missing Desc</i>"), "</p>\n");
f:write("<pre class=\"prettyprint lang-lua\">", (example.Code or "<i>missing Code</i>"), "\n</pre>\n\n"); f:write("<pre class=\"prettyprint lang-lua\">", (example.Code or "<i>missing Code</i>"), "\n</pre>\n\n");
end end
f:write([[</td></tr></table></div><script>prettyPrint();</script></body></html>]]); f:write([[</td></tr></table></div><script>prettyPrint();</script>]])
f:write(GetHtmlTimestamp())
f:write([[</body></html>]])
f:close(); f:close();
end end
@ -941,8 +953,10 @@ local function WriteHtmlClass(a_ClassAPI, a_ClassMenu)
end end
end end
cf:write([[</td></tr></table></div><script>prettyPrint();</script></body></html>]]); cf:write([[</td></tr></table></div><script>prettyPrint();</script>]])
cf:close(); cf:write(GetHtmlTimestamp())
cf:write([[</body></html>]])
cf:close()
end end
@ -1320,11 +1334,10 @@ local function DumpAPIHtml(a_API)
WriteStats(f); WriteStats(f);
f:write([[ </ul> f:write([[</ul></div>]])
</div> f:write(GetHtmlTimestamp())
</body> f:write([[</body></html>]])
</html>]]); f:close()
f:close();
LOG("API subfolder written"); LOG("API subfolder written");
end end