def contents_html_template(self): html_template = HtmlTemplate() html_template.title = "%s %s" % (self.type_element.ToString("f"), self.text()) html_template.h1 = "%s %s" % (self.type_element.ToString("s"), self.text()) html_template.main = fmt_non_empty( self.widget_member_filter(show_inherited = not isinstance(self, ConstructorsNode)) + "%s", self.main_html_table()) return html_template
def contents_html_template(self): html_template = HtmlTemplate() html_template.title = "%s Class Diagram" % self.namespace_element.Namespace # ignore static types # take types with no base class or base class outside the documentation scope root_types = [ t for t in self.namespace_element.Types if not t.IsStatic and (not t.BaseType or not t.BaseType.IsLocalType) ] html_template.main = self.__ul(root_types) return html_template
def contents_html_template(self): html_template = HtmlTemplate() html_template.title = "%s %s" % (self.constructor_element.OwnerType.ToString("f"), "Constructor") html_template.h1 = "%s %s" % (self.constructor_element.OwnerType.ToString("s"), "Constructor") html_template.main = self.__summary_section() + \ self.__syntax_section() + \ self.__exceptions_section() + \ self.__remarks_section() + \ self.__example_section() + \ self.__see_also_section() return html_template
def contents_html_template(self): method_name = self.method_element.Name html_template = HtmlTemplate() html_template.title = "%s %s" % (method_name, "Method") html_template.h1 = "%s.%s %s" % (self.method_element.OwnerType.ToString("s"), method_name, "Method") html_template.main = self.__summary_section() + \ self.__syntax_section() + \ self.__exceptions_section() + \ self.__remarks_section() + \ self.__example_section() + \ self.__see_also_section() return html_template
def contents_html_template(self): print "Generating page for namespace %s" % self.namespace_element.Namespace html_template = HtmlTemplate() html_template.title = self.text() html_template.main = "\n".join([ self.__table("Classes", [t for t in self.namespace_element.Types if t.IsClass]), self.__table("Interfaces", [t for t in self.namespace_element.Types if t.IsInterface]), self.__table("Enumerations", [t for t in self.namespace_element.Types if t.IsEnum]) ]) # TODO: delegates return html_template
def contents_html_template(self): property_name = self.property_element.Name html_template = HtmlTemplate() html_template.title = "%s %s" % (property_name, "Property") html_template.h1 = "%s.%s %s" % (self.property_element.OwnerType.ToString("s"), property_name, "Property") html_template.main = fmt_non_empty(""" <h2>Summary</h2> <p>%s</p> """, self.property_element.XmlComment.Summary()) + \ """ <h2>Syntax</h2> <code class="syntax"> %s </code> """ % self.property_element.ToSyntax() return html_template
def contents_html_template(self): print "Generating page for enum %s" % self.type_element.ToString("f") type_kind = self.type_element.TypeKind has_flags = self.type_element.HasAttribute("System.FlagsAttribute") html_template = HtmlTemplate() html_template.title = "%s %s" % (self.type_element.ToString("f"), type_kind) html_template.h1 = "%s %s" % (self.type_element.ToString("s"), type_kind) html_template.main = fmt_non_empty(""" <h2>Summary</h2> <p>%s</p>""", self.type_element.XmlComment.Summary()) if has_flags: html_template.main += """ <p class="info">This is a flags enum; its members can be combined with bitwise operators.</p>""" html_template.main += self.__members_section() return html_template
def contents_html_template(self): html_template = HtmlTemplate() html_template.title = "%s Extension Methods" % self.namespace_element.Namespace extension_methods = self.__get_extension_methods() methods_by_extended_type = { } for m in extension_methods: extended_type = m.GetParameters()[0].ParameterType lst = methods_by_extended_type.get(extended_type) if lst == None: lst = [] methods_by_extended_type[extended_type] = lst lst.append(m) html_template.main = "" for extended_type in list(methods_by_extended_type): html_template.main += "<h2>Extension methods for %s</h2>" % extended_type.ToHtml() html_template.main += self.methods_table(methods_by_extended_type[extended_type]) return html_template
def contents_html_template(self): print "Generating page for type %s" % self.type_element.ToString("f") type_kind = self.type_element.TypeKind html_template = HtmlTemplate() html_template.title = "%s %s" % (self.type_element.ToString("f"), type_kind) html_template.h1 = "%s %s" % (self.type_element.ToString("s"), type_kind) html_template.main = "\n".join([ fmt_non_empty(""" <h2>Summary</h2> <p>%s</p>""", self.type_element.XmlComment.Summary()), self.__base_type_section(), self.__interfaces_section(), self.__derived_types_section(), self.__syntax_section(), self.__constructors_section(), self.__properties_section(), self.__methods_section(), self.__extension_methods_section() ]) # TODO: operators # TODO: separate attribute template? return html_template