[DEV] add some color...
This commit is contained in:
parent
1560981f6c
commit
dc6fcf7415
@ -4,7 +4,7 @@ import sys
|
|||||||
import lutinTools
|
import lutinTools
|
||||||
# TODO : Add try of generic input ...
|
# TODO : Add try of generic input ...
|
||||||
sys.path.append(lutinTools.GetCurrentPath(__file__) + "/ply/ply/")
|
sys.path.append(lutinTools.GetCurrentPath(__file__) + "/ply/ply/")
|
||||||
sys.path.append(lutinTools.GetCurrentPath(__file__) + "/cppParser/CppheaderParser/")
|
sys.path.append(lutinTools.GetCurrentPath(__file__) + "/cppParser/CppHeaderParser/")
|
||||||
import lutinDocHtml
|
import lutinDocHtml
|
||||||
import lutinDocMd
|
import lutinDocMd
|
||||||
|
|
||||||
|
@ -2,12 +2,24 @@
|
|||||||
import lutinDebug as debug
|
import lutinDebug as debug
|
||||||
import sys
|
import sys
|
||||||
import lutinTools
|
import lutinTools
|
||||||
# TODO : Add try of generic input ...
|
|
||||||
sys.path.append(lutinTools.GetCurrentPath(__file__) + "/ply/ply/")
|
|
||||||
sys.path.append(lutinTools.GetCurrentPath(__file__) + "/cppParser/CppheaderParser/")
|
|
||||||
import CppHeaderParser
|
import CppHeaderParser
|
||||||
import lutinDocHtml
|
|
||||||
import lutinDocMd
|
def display_doxygen_param(comment, input, output):
|
||||||
|
data = "<b>Parameter"
|
||||||
|
if input == True:
|
||||||
|
data += " [input]"
|
||||||
|
if output == True:
|
||||||
|
data += " [output]"
|
||||||
|
data += ":</b> "
|
||||||
|
#extract first element:
|
||||||
|
val = comment.find(" ")
|
||||||
|
var = comment[:val]
|
||||||
|
endComment = comment[val:]
|
||||||
|
data += "<span class=\"code-argument\">" + var + "</span> " + endComment
|
||||||
|
|
||||||
|
data += "<br/>"
|
||||||
|
return data
|
||||||
|
|
||||||
|
|
||||||
def parse_doxygen(data) :
|
def parse_doxygen(data) :
|
||||||
pos = data.find("/*");
|
pos = data.find("/*");
|
||||||
@ -56,21 +68,13 @@ def parse_doxygen(data) :
|
|||||||
None
|
None
|
||||||
elif element[:14] == "param[in,out] " \
|
elif element[:14] == "param[in,out] " \
|
||||||
or element[:14] == "param[out,in] ":
|
or element[:14] == "param[out,in] ":
|
||||||
data3 += "<b>Parameter [input] [output]:</b> "
|
data3 += display_doxygen_param(element[14:], True, True)
|
||||||
data3 += element[14:]
|
|
||||||
data3 += "<br/>"
|
|
||||||
elif element[:10] == "param[in] ":
|
elif element[:10] == "param[in] ":
|
||||||
data3 += "<b>Parameter [input]:</b> "
|
data3 += display_doxygen_param(element[10:], True, False)
|
||||||
data3 += element[10:]
|
|
||||||
data3 += "<br/>"
|
|
||||||
elif element[:11] == "param[out] ":
|
elif element[:11] == "param[out] ":
|
||||||
data3 += "<b>Parameter [output]:</b> "
|
data3 += display_doxygen_param(element[11:], False, True)
|
||||||
data3 += element[11:]
|
|
||||||
data3 += "<br/>"
|
|
||||||
elif element[:6] == "param ":
|
elif element[:6] == "param ":
|
||||||
data3 += "<b>Parameter:</b> "
|
data3 += display_doxygen_param(element[6:], False, False)
|
||||||
data3 += element[6:]
|
|
||||||
data3 += "<br/>"
|
|
||||||
elif element[:7] == "return ":
|
elif element[:7] == "return ":
|
||||||
data3 += "<b>Return:</b> "
|
data3 += "<b>Return:</b> "
|
||||||
data3 += element[7:]
|
data3 += element[7:]
|
||||||
@ -99,11 +103,11 @@ def displayReductFunction(function, file, classement, sizeReturn, sizefunction)
|
|||||||
lineData += writeExpendSize("", sizeReturn+1)
|
lineData += writeExpendSize("", sizeReturn+1)
|
||||||
else :
|
else :
|
||||||
lineData += writeExpendSize(function["rtnType"], sizeReturn+1)
|
lineData += writeExpendSize(function["rtnType"], sizeReturn+1)
|
||||||
|
parameterPos = len(lineData) + sizefunction+2;
|
||||||
lineData += writeExpendSize(function["name"], sizefunction+1)
|
lineData +="<a class=\"code-function\" href=\"#"+ function["name"] + "\">" + function["name"] + "</a>"
|
||||||
|
lineData += writeExpendSize("", sizefunction+1 - len(function["name"]))
|
||||||
lineData += "("
|
lineData += "("
|
||||||
file.write(lineData);
|
file.write(lineData);
|
||||||
parameterPos = len(lineData);
|
|
||||||
isFirst = True
|
isFirst = True
|
||||||
for param in function["parameters"]:
|
for param in function["parameters"]:
|
||||||
if isFirst == False:
|
if isFirst == False:
|
||||||
@ -112,7 +116,7 @@ def displayReductFunction(function, file, classement, sizeReturn, sizefunction)
|
|||||||
file.write(param['type'])
|
file.write(param['type'])
|
||||||
if param['name'] != "":
|
if param['name'] != "":
|
||||||
file.write(" ")
|
file.write(" ")
|
||||||
file.write(param['name'])
|
file.write("<span class=\"code-argument\">" + param['name'] + "</span>")
|
||||||
isFirst = False
|
isFirst = False
|
||||||
file.write(");")
|
file.write(");")
|
||||||
file.write("<br>")
|
file.write("<br>")
|
||||||
@ -127,21 +131,21 @@ def displayFunction(namespace, function, file, classement, sizeReturn, sizefunct
|
|||||||
lineData = namespace + "::"
|
lineData = namespace + "::"
|
||||||
if function['destructor'] :
|
if function['destructor'] :
|
||||||
lineData += "~"
|
lineData += "~"
|
||||||
lineData += function["name"] + "( ... )"
|
lineData +="<a id=\""+ function["name"] + "\">" + function["name"] + "</a> ()"
|
||||||
file.write("<h3>" + lineData + "</h3>\n\n")
|
file.write("<h3>" + lineData + "</h3>\n\n")
|
||||||
|
|
||||||
|
file.write("<pre>\n");
|
||||||
if function['destructor'] :
|
if function['destructor'] :
|
||||||
lineData = "~"
|
lineData = "~"
|
||||||
elif function['constructor'] :
|
elif function['constructor'] :
|
||||||
lineData = ""
|
lineData = ""
|
||||||
else :
|
else :
|
||||||
lineData = function["rtnType"] + " "
|
lineData = function["rtnType"] + " "
|
||||||
|
|
||||||
file.write("<pre>\n");
|
parameterPos = len(lineData) + len(function["name"]) + 1;
|
||||||
lineData += function["name"]
|
lineData += "<span class=\"code-function\">" + function["name"] + "</span>"
|
||||||
lineData += "("
|
lineData += "("
|
||||||
file.write(lineData);
|
file.write(lineData);
|
||||||
parameterPos = len(lineData);
|
|
||||||
isFirst = True
|
isFirst = True
|
||||||
for param in function["parameters"]:
|
for param in function["parameters"]:
|
||||||
if isFirst == False:
|
if isFirst == False:
|
||||||
@ -150,7 +154,7 @@ def displayFunction(namespace, function, file, classement, sizeReturn, sizefunct
|
|||||||
file.write(param['type'])
|
file.write(param['type'])
|
||||||
if param['name'] != "":
|
if param['name'] != "":
|
||||||
file.write(" ")
|
file.write(" ")
|
||||||
file.write(param['name'])
|
file.write("<span class=\"code-argument\">" + param['name'] + "</span>")
|
||||||
isFirst = False
|
isFirst = False
|
||||||
file.write(");")
|
file.write(");")
|
||||||
file.write("</pre>\n");
|
file.write("</pre>\n");
|
||||||
|
@ -72,7 +72,7 @@ p {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pre {
|
pre {
|
||||||
margin-left: 20px;
|
#margin-left: 20px;
|
||||||
display: block;
|
display: block;
|
||||||
padding: 9.5px;
|
padding: 9.5px;
|
||||||
margin: 0 0 10px;
|
margin: 0 0 10px;
|
||||||
@ -88,3 +88,21 @@ pre {
|
|||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.code-function {
|
||||||
|
text-decoration:none;
|
||||||
|
color:#09857e;
|
||||||
|
font-weight:bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.code-type {
|
||||||
|
text-decoration:none;
|
||||||
|
color:#376d0a;
|
||||||
|
font-weight:bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.code-argument {
|
||||||
|
text-decoration:none;
|
||||||
|
color:#B80000;
|
||||||
|
font-weight:bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user