Просмотр исходного кода

Lua docs will no longer display empty sections, changed docs style to match the new design

Ivan Safrin 12 лет назад
Родитель
Сommit
22f28ae1f4

+ 38 - 30
Documentation/Lua/html/css/docs.css

@@ -1,34 +1,43 @@
-
 body, html {
-	background-color: #222222;
-	color: white;
-	font-family: Helvetica, Arial, sans;
+	background-color: #e4e3e0;
 	margin: 0px;
 	padding: 0px;
-	font-size: 14px;
+	font-family: 'Roboto', sans-serif;
+	font-weight: normal;
+	font-size: 13px;
+	font-weight: 300;
+	color: #3b3531;
+}
+
+#content {
+	margin: 0px auto 0px auto;
+	width: 900px;
+	background-color: #e4e3e0;
+	font-size: 16px;
 }
 
 a {
-	color: white;
+	color: #d0592a;
+	text-decoration: none;
 }
 
 #global_header {
-	width: 100%;
 	height: 64px;
-	background-color: black;
-	margin: 0px 0px 0px 0px;
+	margin: 20px auto 0px auto;
+	width: 900px;
 }
 
 #module_links, #class_list {
 	float: left;
-	width: 160px;
+	width: 200px;
+	overflow: hidden;
 	padding: 30px;
-	background: #141414;
 	margin: 0px 0px 0px 0px;
+	text-align: right;
 }
 
 #class_list a {
-	color: #757575;
+	color: #d0592a;
 	text-decoration: none;
 }
 
@@ -38,31 +47,32 @@ a {
 }
 
 .class_entry {
-	font-size: 14px;
+	font-size: 16px;
 	margin: 3px 0px 0px 0px;
 }
 
 .class_main {
-	margin: 0px 0px 0px 220px;
+	margin: 0px 0px 0px 260px;
 	padding: 20px;
 }
 
 .class_name {
 	font-size: 32px;
 	margin: 0px 0px 30px 0px;
-	color: #b8b8b8;
+	color: #d0592a;
 }
 
 .class_extends {
 	font-size: 24px;
 	margin: 0px 0px 30px 0px;
-	color: #4a4a4a;
+	color: #3b3531;
 }
 
 .class_extends_class a {
 	font-size: 24px;
 	margin: 0px 0px 30px 0px;
-	color: #925381;
+	color: #d0592a;
+	text-decoration: underline;
 }
 
 .class_desc {
@@ -73,7 +83,6 @@ a {
 
 .class_properties_list, .class_methods_list {
 	padding: 10px;
-	background-color: #1a1a1a;
 }
 
 .class_property, .class_method {
@@ -88,11 +97,11 @@ a {
 }
 
 .class_property_name {
-	color: #70bd38;
+	color: #d0592a;
 }
 
 .class_property_type {
-	color: #925381;
+	color: #8c8c8c;
 }
 
 .class_property_desc {
@@ -100,13 +109,13 @@ a {
 }
 
 .class_method_name {
-	color: #4e87c8;
-	font-size: 16px;
+	color: #d0592a;
+	font-size: 20px;
 }
 
 .class_method_type {
-	color: #925381;
-	font-size: 12px;
+	color: #8c8c8c;
+	font-size: 16px;
 }
 
 .class_method_desc {
@@ -122,12 +131,12 @@ a {
 }
 
 .class_method_param_name {
-	color: #70bd38;
+	color: #d0592a;
 }
 
 .class_method_param_type {
-	color: #925381;
-	font-size: 12px;
+	color: #8c8c8c;
+	font-size: 16px;
 }
 
 .class_method_param_desc {
@@ -141,12 +150,11 @@ a {
 }
 
 .inline_param {
-	color: #70bd38;
+	color: #3b3531;
 }
 
 .inline_type {
-	color: #925381;
-	font-size: 12px;
+	color: #8c8c8c;
 }
 
 .static_value {

BIN
Documentation/Lua/html/images/docs_header.png


+ 48 - 31
Documentation/Lua/scripts/make_html.py

@@ -7,6 +7,7 @@ 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"
@@ -32,6 +33,20 @@ globalFooter += "\t</body>\n"
 globalFooter += "\t</html>\n"
 
 def createMethods(className, item, static):
+
+	numStatic = 0
+	numRegular = 0
+	for subitem in item.getElementsByTagName('method'):
+		if subitem.hasAttribute("static") == True:
+			numStatic = numStatic + 1
+		else:
+			numRegular = numRegular + 1
+
+	if static == True and numStatic == 0:
+		return ""
+	if static == False and numRegular == 0:
+		return ""
+
 	html = ""
 	html += "\t\t\t\t\t<div class=\"class_methods\">\n"
 	if static == True:
@@ -108,37 +123,39 @@ def makePage(item, classList, classListPlain, moduleName):
 		descText = desc[0].childNodes[0].data
 	html += "\t\t\t\t\t<div class=\"class_desc\">%s</div>\n" % descText
 
-	html += "\t\t\t\t\t<div class=\"class_properties\">\n"
-	html += "\t\t\t\t\t\t<div class=\"class_properties_title\">Static Properties</div>\n"
-	html += "\t\t\t\t\t\t<div class=\"class_properties_list\">\n"
-	for subitem in item.getElementsByTagName('static_member'):
-		html += "\t\t\t\t\t\t\t<div class=\"class_property\">\n"
-		html += "\t\t\t\t\t\t\t\t<div class=\"class_property_name\">%s.%s <span class=\"static_value\">= %s</span></div>\n" % (item.attributes["name"].value, subitem.attributes["name"].value, subitem.attributes["value"].value)
-		html += "\t\t\t\t\t\t\t\t<div class=\"class_property_type\">%s</div>\n" % (subitem.attributes["type"].value)
-		desc = subitem.getElementsByTagName('desc')
-		descText = "No description."
-		if len(desc) > 0:
-			descText = desc[0].childNodes[0].data
-		html += "\t\t\t\t\t\t\t\t<div class=\"class_property_desc\">%s</div>\n" % (descText)
-		html += "\t\t\t\t\t\t\t</div>\n"
-	html += "\t\t\t\t\t\t</div>\n"
-	html += "\t\t\t\t\t</div>\n"
-
-	html += "\t\t\t\t\t<div class=\"class_properties\">\n"
-	html += "\t\t\t\t\t\t<div class=\"class_properties_title\">Properties</div>\n"
-	html += "\t\t\t\t\t\t<div class=\"class_properties_list\">\n"
-	for subitem in item.getElementsByTagName('member'):
-		html += "\t\t\t\t\t\t\t<div class=\"class_property\">\n"
-		html += "\t\t\t\t\t\t\t\t<div class=\"class_property_name\">%s</div>\n" % (subitem.attributes["name"].value)
-		html += "\t\t\t\t\t\t\t\t<div class=\"class_property_type\">%s</div>\n" % (subitem.attributes["type"].value)
-		desc = subitem.getElementsByTagName('desc')
-		descText = "No description."
-		if len(desc) > 0:
-			descText = desc[0].childNodes[0].data
-		html += "\t\t\t\t\t\t\t\t<div class=\"class_property_desc\">%s</div>\n" % (descText)
-		html += "\t\t\t\t\t\t\t</div>\n"
-	html += "\t\t\t\t\t\t</div>\n"
-	html += "\t\t\t\t\t</div>\n"
+	if len(item.getElementsByTagName('static_member')) > 0:
+		html += "\t\t\t\t\t<div class=\"class_properties\">\n"
+		html += "\t\t\t\t\t\t<div class=\"class_properties_title\">Static Properties</div>\n"
+		html += "\t\t\t\t\t\t<div class=\"class_properties_list\">\n"
+		for subitem in item.getElementsByTagName('static_member'):
+			html += "\t\t\t\t\t\t\t<div class=\"class_property\">\n"
+			html += "\t\t\t\t\t\t\t\t<div class=\"class_property_name\">%s.%s <span class=\"static_value\">= %s</span></div>\n" % (item.attributes["name"].value, subitem.attributes["name"].value, subitem.attributes["value"].value)
+			html += "\t\t\t\t\t\t\t\t<div class=\"class_property_type\">%s</div>\n" % (subitem.attributes["type"].value)
+			desc = subitem.getElementsByTagName('desc')
+			descText = "No description."
+			if len(desc) > 0:
+				descText = desc[0].childNodes[0].data
+			html += "\t\t\t\t\t\t\t\t<div class=\"class_property_desc\">%s</div>\n" % (descText)
+			html += "\t\t\t\t\t\t\t</div>\n"
+		html += "\t\t\t\t\t\t</div>\n"
+		html += "\t\t\t\t\t</div>\n"
+
+	if len(item.getElementsByTagName('member')) > 0:
+		html += "\t\t\t\t\t<div class=\"class_properties\">\n"
+		html += "\t\t\t\t\t\t<div class=\"class_properties_title\">Properties</div>\n"
+		html += "\t\t\t\t\t\t<div class=\"class_properties_list\">\n"
+		for subitem in item.getElementsByTagName('member'):
+			html += "\t\t\t\t\t\t\t<div class=\"class_property\">\n"
+			html += "\t\t\t\t\t\t\t\t<div class=\"class_property_name\">%s</div>\n" % (subitem.attributes["name"].value)
+			html += "\t\t\t\t\t\t\t\t<div class=\"class_property_type\">%s</div>\n" % (subitem.attributes["type"].value)
+			desc = subitem.getElementsByTagName('desc')
+			descText = "No description."
+			if len(desc) > 0:
+				descText = desc[0].childNodes[0].data
+			html += "\t\t\t\t\t\t\t\t<div class=\"class_property_desc\">%s</div>\n" % (descText)
+			html += "\t\t\t\t\t\t\t</div>\n"
+		html += "\t\t\t\t\t\t</div>\n"
+		html += "\t\t\t\t\t</div>\n"
 
 	html += createMethods(item.attributes["name"].value, item, True)
 	html += createMethods(item.attributes["name"].value, item, False)