Make types optional in documentation generators.
This commit is contained in:
@@ -29,11 +29,17 @@ Device.__tostring = function(self)
|
||||
else
|
||||
doc = doc .. "arg" .. i
|
||||
end
|
||||
doc = doc .. ": " .. p.type
|
||||
if p.type then
|
||||
doc = doc .. ": " .. p.type
|
||||
end
|
||||
i = i + 1
|
||||
end
|
||||
end
|
||||
doc = doc .. "): " .. method.returnType .. "\n"
|
||||
doc = doc .. ")"
|
||||
if method.returnType then
|
||||
doc = doc .. ": " .. method.returnType
|
||||
end
|
||||
doc = doc .. "\n"
|
||||
|
||||
if method.description then
|
||||
doc = doc .. method.description .. "\n"
|
||||
|
||||
@@ -28,9 +28,13 @@ class Device:
|
||||
doc += p["name"]
|
||||
else:
|
||||
doc += "arg" + str(i)
|
||||
doc += ": " + p["type"]
|
||||
if "type" in p:
|
||||
doc += ": " + p["type"]
|
||||
i += 1
|
||||
doc += "): " + method["returnType"] + "\n"
|
||||
doc += ")"
|
||||
if "returnType" in method:
|
||||
doc += ": " + method["returnType"]
|
||||
doc += "\n"
|
||||
|
||||
if "description" in method and method["description"]:
|
||||
doc += method["description"] + "\n"
|
||||
|
||||
Reference in New Issue
Block a user