--- a/eric7/DocumentationTools/IndexGenerator.py Sun Sep 12 17:30:38 2021 +0200 +++ b/eric7/DocumentationTools/IndexGenerator.py Sun Sep 12 20:22:27 2021 +0200 @@ -13,20 +13,20 @@ from Utilities import joinext +from . import TemplatesListsStyleCSS + class IndexGenerator: """ Class implementing the index generator for the builtin documentation generator. """ - def __init__(self, outputDir, colors, stylesheet=None): + def __init__(self, outputDir): """ Constructor - @param outputDir The output directory for the files. (string) - @param colors Dictionary specifying the various colors for the output. - (dictionary of strings) - @param stylesheet the style to be used for the generated pages (string) + @param outputDir The output directory for the files + @type str """ self.outputDir = outputDir self.packages = { @@ -38,33 +38,16 @@ } self.remembered = False - self.stylesheet = stylesheet - - if self.stylesheet: - from . import TemplatesListsStyleCSS - self.headerTemplate = TemplatesListsStyleCSS.headerTemplate - self.footerTemplate = TemplatesListsStyleCSS.footerTemplate - self.indexBodyTemplate = TemplatesListsStyleCSS.indexBodyTemplate - self.indexListPackagesTemplate = ( - TemplatesListsStyleCSS.indexListPackagesTemplate) - self.indexListModulesTemplate = ( - TemplatesListsStyleCSS.indexListModulesTemplate) - self.indexListEntryTemplate = ( - TemplatesListsStyleCSS.indexListEntryTemplate) - else: - from . import TemplatesListsStyle - self.headerTemplate = ( - TemplatesListsStyle.headerTemplate.format(**colors)) - self.footerTemplate = ( - TemplatesListsStyle.footerTemplate.format(**colors)) - self.indexBodyTemplate = ( - TemplatesListsStyle.indexBodyTemplate.format(**colors)) - self.indexListPackagesTemplate = ( - TemplatesListsStyle.indexListPackagesTemplate.format(**colors)) - self.indexListModulesTemplate = ( - TemplatesListsStyle.indexListModulesTemplate.format(**colors)) - self.indexListEntryTemplate = ( - TemplatesListsStyle.indexListEntryTemplate.format(**colors)) + # TODO: replace these assignments + self.headerTemplate = TemplatesListsStyleCSS.headerTemplate + self.footerTemplate = TemplatesListsStyleCSS.footerTemplate + self.indexBodyTemplate = TemplatesListsStyleCSS.indexBodyTemplate + self.indexListPackagesTemplate = ( + TemplatesListsStyleCSS.indexListPackagesTemplate) + self.indexListModulesTemplate = ( + TemplatesListsStyleCSS.indexListModulesTemplate) + self.indexListEntryTemplate = ( + TemplatesListsStyleCSS.indexListEntryTemplate) def remember(self, file, moduleDocument, basename=""): """ @@ -170,8 +153,7 @@ doc = ( self.headerTemplate.format( - **{"Title": title, - "Style": self.stylesheet} + **{"Title": title} ) + self.indexBodyTemplate.format( **{"Title": title, "Description": package["description"],