Improve documentation generation

This commit is contained in:
Vincent Jacques
2012-02-26 14:32:29 +00:00
parent f71bf13461
commit 37a62f4c6f
6 changed files with 45 additions and 37 deletions
+8 -3
View File
@@ -70,8 +70,13 @@ class InternalAttribute:
cls._addAttribute( self.__attributeName, InternalAttribute.AttributeDefinition( self.__typePolicy ) )
def autoDocument( self ):
return ""
return "* `" + self.__attributeName + "`: `" + self.__typePolicy.documentTypeName() + "`\n"
if self.__attributeName.startswith( "_" ):
return ""
doc = "* `" + self.__attributeName + "`"
if self.__typePolicy.hasMeaningfulDocumentation():
doc += ": " + self.__typePolicy.documentTypeName()
doc += "\n"
return doc
class ExternalAttribute:
def __init__( self, attributeName, typePolicy ):
@@ -88,7 +93,7 @@ class ExternalAttribute:
)
def autoDocument( self ):
return "* `get_" + self.__attributeName + "()`: `" + self.__typePolicy.documentTypeName() + "`\n"
return "* `get_" + self.__attributeName + "()`: " + self.__typePolicy.documentTypeName() + "\n"
class SeveralAttributePolicies:
def __init__( self, attributePolicies, documentationSection = None ):