Skip to content
This repository was archived by the owner on May 18, 2019. It is now read-only.

Commit 565b72f

Browse files
hkielOpenModelica-Hudson
authored andcommitted
improve doc generation speed
Belonging to [master]: - #2787
1 parent 789a1ec commit 565b72f

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

Examples/GenerateDoc.mos

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
*/
4141

4242
setDebugFlags("nogen") /* Don't generate dll/so-files when instantiating classes (performance) */;
43+
setCommandLineOptions("--noSimplify");
4344

4445
// rmSymlinks
4546
// (false) should we keep readable names (nice online, if the server handles symbolic links), or
@@ -82,8 +83,6 @@ if getEnvironmentVar("GenerateDocTest") == "YES" then
8283
system("mkdir -p Icons");
8384
else
8485
system("find . -maxdepth 1 -name '*.html' -delete");
85-
system("find Icons -maxdepth 1 -name '*.svg' -delete");
86-
8786
commands:={"python "+py+" --quiet --output-dir Icons "+typeNameString(cl) for cl in getClassNames(builtin=false)};getErrorString();
8887
res:=system_parallel(commands);getErrorString();
8988
//system("rm -f *.json");getErrorString();
@@ -135,11 +134,6 @@ algorithm
135134
uri := OpenModelica.Scripting.stringReplace(uri,\">\",\"x3E\");
136135
end uriEncode;
137136

138-
function notLast
139-
input String str[:];
140-
output String ostr[:] = str[1:end];
141-
end notLast;
142-
143137
function last
144138
input String str[:];
145139
output String ostr = str[end];
@@ -212,7 +206,7 @@ protected
212206
algorithm
213207
docInfo := if item.docInfo[1] == \"\"
214208
then preSuffixIfNotEmpty(\"<h2><a name=\\\"info\\\">Information</a></h2><pre>\", item.comment, \"</pre>\")
215-
else if OpenModelica.Scripting.regexBool(item.docInfo[1],\"<html>\") or OpenModelica.Scripting.regexBool(item.docInfo[1],\"<HTML>\")
209+
else if OpenModelica.Scripting.regexBool(item.docInfo[1],\"<html>\", caseInsensitive=true)
216210
then \"<h2><a name=\\\"info\\\">Information</a></h2>\" + item.docInfo[1]
217211
else preSuffixIfNotEmpty(\"<h2><a name=\\\"info\\\">Information</a></h2><pre>\", toHtml(item.docInfo[1]), \"</pre>\");
218212
revision := if item.docInfo[2] <> \"\" then \"<h2><a name=\\\"revisions\\\">Revisions</a></h2>\" + item.docInfo[2] else \"\";
@@ -460,6 +454,7 @@ system("rm -f tidy.links tidy.out tidy.err tidy.filtered");
460454

461455
"Copying original HTML files to 'old-html-tmp'";
462456
writeFile("copyold.py","#!/usr/bin/env python
457+
import glob
463458
import os
464459
import shutil
465460
oldtmp = 'old-html-tmp'

0 commit comments

Comments
 (0)