|
|
@@ -1,36 +1,51 @@
|
|
|
import os
|
|
|
+import sys
|
|
|
from xml.dom.minidom import parse
|
|
|
|
|
|
+siteDocs = False
|
|
|
+
|
|
|
+if len(sys.argv) > 1:
|
|
|
+ if sys.argv[1] == "site":
|
|
|
+ siteDocs = True
|
|
|
+
|
|
|
globalHeaderMain = ""
|
|
|
|
|
|
-globalHeaderMain += "<html>\n"
|
|
|
-globalHeaderMain += "\t<head>\n"
|
|
|
-globalHeaderMain += "\t\t<title>Polycode Documentation</title>\n"
|
|
|
-globalHeaderMain += "\t\t<link rel=\"stylesheet\" type=\"text/css\" href=\"css/docs.css\" />\n"
|
|
|
-globalHeaderMain += "\t\t<link href='http://fonts.googleapis.com/css?family=Roboto:400,300' rel='stylesheet' type='text/css'>\n"
|
|
|
-globalHeaderMain += "\t\t<script type=\"text/javascript\" src=\"js/docs.js\"></script>"
|
|
|
-globalHeaderMain += "\t</head>\n"
|
|
|
-globalHeaderMain += "\t<body>\n"
|
|
|
-globalHeaderMain += "\t\t<div id=\"global_header\"><a href=\"index.html\"><img border=\"0\" src=\"images/docs_header.png\"/></a></div>\n"
|
|
|
-globalHeaderMain += "\t\t<div id=\"content\">\n"
|
|
|
-
|
|
|
-globalHeader = ""
|
|
|
-globalFooter = ""
|
|
|
-
|
|
|
-globalHeader += "<html>\n"
|
|
|
-globalHeader += "\t<head>\n"
|
|
|
-globalHeader += "\t\t<title>Polycode Documentation</title>\n"
|
|
|
-globalHeader += "\t\t<link rel=\"stylesheet\" type=\"text/css\" href=\"../css/docs.css\" />\n"
|
|
|
-globalHeader += "\t\t<script type=\"text/javascript\" src=\"js/docs.js\"></script>"
|
|
|
-globalHeader += "\t</head>\n"
|
|
|
-globalHeader += "\t<body>\n"
|
|
|
-globalHeader += "\t\t<div id=\"global_header\"><a href=\"../index.html\"><img border=\"0\" src=\"../images/docs_header.png\"/></a></div>\n"
|
|
|
-globalHeader += "\t\t<div id=\"content\">\n"
|
|
|
-
|
|
|
-
|
|
|
-globalFooter += "\t\t</div>\n"
|
|
|
-globalFooter += "\t</body>\n"
|
|
|
-globalFooter += "\t</html>\n"
|
|
|
+if siteDocs == True:
|
|
|
+ header_f = open("site_header.html", 'r')
|
|
|
+ globalHeaderMain = header_f.read()
|
|
|
+ globalHeader = globalHeaderMain
|
|
|
+ footer_f = open("site_footer.html", 'r')
|
|
|
+ globalFooter = footer_f.read()
|
|
|
+
|
|
|
+else:
|
|
|
+ globalHeaderMain += "<html>\n"
|
|
|
+ globalHeaderMain += "\t<head>\n"
|
|
|
+ globalHeaderMain += "\t\t<title>Polycode Documentation</title>\n"
|
|
|
+ globalHeaderMain += "\t\t<link rel=\"stylesheet\" type=\"text/css\" href=\"css/docs.css\" />\n"
|
|
|
+ globalHeaderMain += "\t\t<link href='http://fonts.googleapis.com/css?family=Roboto:400,300' rel='stylesheet' type='text/css'>\n"
|
|
|
+ globalHeaderMain += "\t\t<script type=\"text/javascript\" src=\"js/docs.js\"></script>"
|
|
|
+ globalHeaderMain += "\t</head>\n"
|
|
|
+ globalHeaderMain += "\t<body>\n"
|
|
|
+ globalHeaderMain += "\t\t<div id=\"global_header\"><a href=\"index.html\"><img border=\"0\" src=\"images/docs_header.png\"/></a></div>\n"
|
|
|
+ globalHeaderMain += "\t\t<div id=\"content\">\n"
|
|
|
+
|
|
|
+ globalHeader = ""
|
|
|
+ globalFooter = ""
|
|
|
+
|
|
|
+ globalHeader += "<html>\n"
|
|
|
+ globalHeader += "\t<head>\n"
|
|
|
+ globalHeader += "\t\t<title>Polycode Documentation</title>\n"
|
|
|
+ globalHeader += "\t\t<link rel=\"stylesheet\" type=\"text/css\" href=\"../css/docs.css\" />\n"
|
|
|
+ globalHeader += "\t\t<script type=\"text/javascript\" src=\"js/docs.js\"></script>"
|
|
|
+ globalHeader += "\t</head>\n"
|
|
|
+ globalHeader += "\t<body>\n"
|
|
|
+ globalHeader += "\t\t<div id=\"global_header\"><a href=\"../index.html\"><img border=\"0\" src=\"../images/docs_header.png\"/></a></div>\n"
|
|
|
+ globalHeader += "\t\t<div id=\"content\">\n"
|
|
|
+
|
|
|
+
|
|
|
+ globalFooter += "\t\t</div>\n"
|
|
|
+ globalFooter += "\t</body>\n"
|
|
|
+ globalFooter += "\t</html>\n"
|
|
|
|
|
|
def createMethods(className, item, static):
|
|
|
|
|
|
@@ -180,19 +195,28 @@ def makeHTML(fileName, moduleName):
|
|
|
classList += "\t\t\t</div>\n"
|
|
|
classList += "\n"
|
|
|
|
|
|
- directory = "../html/%s" % (moduleName)
|
|
|
+ if siteDocs == True:
|
|
|
+ directory = "../site_html/%s" % (moduleName)
|
|
|
+ else:
|
|
|
+ directory = "../html/%s" % (moduleName)
|
|
|
if not os.path.exists(directory):
|
|
|
os.makedirs(directory)
|
|
|
|
|
|
html = globalHeader
|
|
|
html += classList
|
|
|
html += globalFooter
|
|
|
- f = open("../html/%s/index.html" % (moduleName), 'w')
|
|
|
+ if siteDocs == True:
|
|
|
+ f = open("../site_html/%s/index.html" % (moduleName), 'w')
|
|
|
+ else:
|
|
|
+ f = open("../html/%s/index.html" % (moduleName), 'w')
|
|
|
f.write(html)
|
|
|
f.close()
|
|
|
|
|
|
for item in dom.documentElement.getElementsByTagName('class'):
|
|
|
- f = open("../html/%s/%s.html" % (moduleName, item.attributes["name"].value), 'w')
|
|
|
+ if siteDocs == True:
|
|
|
+ f = open("../site_html/%s/%s.html" % (moduleName, item.attributes["name"].value), 'w')
|
|
|
+ else:
|
|
|
+ f = open("../html/%s/%s.html" % (moduleName, item.attributes["name"].value), 'w')
|
|
|
html = makePage(item, classList, classListPlain, moduleName)
|
|
|
f.write(html)
|
|
|
f.close()
|
|
|
@@ -211,7 +235,11 @@ for fname in dirList:
|
|
|
|
|
|
indexhtml += "\t</div>\n"
|
|
|
|
|
|
-f = open("../html/index.html", 'w')
|
|
|
+if siteDocs == True:
|
|
|
+ f = open("../site_html/index.html", 'w')
|
|
|
+else:
|
|
|
+ f = open("../html/index.html", 'w')
|
|
|
+
|
|
|
f.write(indexhtml)
|
|
|
f.close()
|
|
|
indexhtml += globalFooter
|