def toc_dump(self, toc_filename=None, index_filename=None): if toc_filename is None: toc_filename = "index.md" if index_filename is None: index_filename = self.file_prefix + "index.md" Formatter.toc_dump(self, toc_filename, index_filename)
def __init__(self, processor, project_title, file_prefix): Formatter.__init__(self, processor) if file_prefix: file_prefix = file_prefix + "-" else: file_prefix = "" self.headers = processor.headers self.project_title = project_title self.file_prefix = file_prefix self.toc_filename = "index.md" self.index_filename = self.file_prefix + "index.md" self.markdown = mistune.Markdown() self.config = siteconfig.SiteConfig() self.md_index_header = (md_header_1 + md_header_2 + "Global Index" + md_line_sep + md_h1 + project_title + md_api_ref) self.md_toc_header = (md_header_1 + md_header_2 + "Table of Contents" + md_line_sep + md_h1 + project_title + md_api_ref) self.time_footer = ('<div class="timestamp">generated on ' + time.asctime(time.gmtime()) + " UTC" + "</div>") self.columns = 3 self.site_name = project_title + " " + api_ref_text self.site_description = api_ref_text + " Documentation for " + project_title self.site_author = docs_author # Set site config self.config.set_site_info(self.site_name, self.site_description, self.site_author) # Add toc and index self.config.add_single_page("TOC", self.toc_filename) self.config.add_single_page("Index", self.index_filename)
def index_dump(self, index_filename=None): if index_filename is None: index_filename = self.file_prefix + "index.md" Formatter.index_dump(self, index_filename)