theming.py 文件源码

python
阅读 21 收藏 0 点赞 0 评论 0

项目:chalktalk_docs 作者: loremIpsum1771 项目源码 文件源码
def load_extra_theme(cls, name):
        if name in ('alabaster', 'sphinx_rtd_theme'):
            if name == 'alabaster':
                import alabaster
                themedir = alabaster.get_path()
                # alabaster theme also requires 'alabaster' extension, it will be loaded
                # at sphinx.application module.
            elif name == 'sphinx_rtd_theme':
                import sphinx_rtd_theme
                themedir = sphinx_rtd_theme.get_html_theme_path()
            else:
                raise NotImplementedError('Programming Error')

        else:
            for themedir in load_theme_plugins():
                if path.isfile(path.join(themedir, name, THEMECONF)):
                    break
            else:
                # specified theme is not found
                return

        cls.themepath.append(themedir)
        cls.themes[name] = (path.join(themedir, name), None)
        return
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号