Exemple #1
0
 def init(self):
     self.create_template_bridge()
     Theme.init_themes(self.confdir,
                       self.config.html_theme_path,
                       warn=self.warn)
     self.theme = Theme('default')
     self.templates.init(self, self.theme)
 def init_templates(self):
     Theme.init_themes(self)
     themename, themeoptions = self.get_theme_config()
     self.theme = Theme(themename)
     self.theme_options = themeoptions.copy()
     self.create_template_bridge()
     self.templates.init(self, self.theme)
def init_multi_templates(self):
    self.multithemes = {}
    for key, (themename, themeoptions) in self.config.html_multi_themes.items():
        matcher = re.compile(key)
        theme, options = (Theme(themename), themeoptions.copy())
        templates = create_template_bridge(self)
        templates.init(self, theme)
        self.multithemes[matcher] = theme, options, templates
Exemple #4
0
 def init_templates(self):
     Theme.init_themes(self.confdir, self.config.html_theme_path,
                       warn=self.warn)
     themename, themeoptions = self.get_theme_config()
     self.theme = Theme(themename)
     self.theme_options = themeoptions.copy()
     self.create_template_bridge()
     self.templates.init(self, self.theme)
Exemple #5
0
    def apply_theme(self, themename, themeoptions):
        """Apply a new theme to the document.

        This will store the existing theme configuration and apply a new one.

        """

        # push the existing values onto the Stack
        self._theme_stack.append((self.theme, self.theme_options))

        self.theme = Theme(themename)
        self.theme_options = themeoptions.copy()
        self.templates.init(self, self.theme)

        self._additional_themes.append(self.theme)
Exemple #6
0
 def create(self, themename):
     return Theme(themename)
Exemple #7
0
 def init(self):
     # type: () -> None
     self.create_template_bridge()
     Theme.init_themes(self.confdir, self.config.html_theme_path)
     self.theme = Theme('default')
     self.templates.init(self, self.theme)
Exemple #8
0
 def init_templates(self):
     Theme.init_themes(self)
     self.theme = Theme(self.config.html_theme)
     self.create_template_bridge()
     self.templates.init(self, self.theme)
Exemple #9
0
 def init(self):
     self.create_template_bridge()
     Theme.init_themes(self)
     self.theme = Theme('default')
     self.templates.init(self, self.theme)