示例#1
0
	def _doc_function(self, function_item, child = False):
		"""
		Gets a function item as created by the Inspector and creates the body for the
		corresponding html page.

		This page is automatically added to Generator.pages, and a sidebar link is
		automatically added to the sidebar.
		"""
		sidebar_link = None

		# create the sidebar link
		if child == False:
			sidebar_link = ghtml.generate_nav_link(function_item["name"], function_item["parents"])
			self.sidebar_modules.append(sidebar_link)

		# create the page body
		page = ghtml.fill_info(
			name = function_item['name'], type = 'Function', 
			args = function_item["args"], docstring = function_item["docstring"])
		pagename = function_item["parents"] + function_item["name"] + ".html"

		# add the page
		self.pages[pagename] = page

		pass
示例#2
0
	def _doc_class(self, class_item, child = False):
		"""
		Gets a class item as created by the Inspector and creates the body for
		and html page. 

		This page is automatically added to Generator.pages, and a sidebar link
		is automatically added to the sidebar.
		"""
		sidebar_link = None

		# lists for subelements
		subclasses = []
		subfunctions = []

		if class_item['name'] == None or "":
			return

		# create the sidebar link for this class
		if child == False:
			sidebar_link = ghtml.generate_nav_link(class_item["name"], class_item["parents"])
			self.sidebar_modules.append(sidebar_link)

		# create the page body
		page = ghtml.fill_info(
			name = class_item["name"], type = "Class", 
			args = class_item["args"], docstring = class_item["docstring"],
			classes = class_item["classes"], functions = class_item["functions"])
		pagename = class_item["parents"] + class_item["name"] + ".html"

		for subclass in class_item["classes"]:
			self._doc_class(subclass, child = True)
		for subfunction in class_item["functions"]:
			self._doc_function(subfunction, child = True)

		# add the page
		self.pages[pagename] = page

		pass