一个好看的,可定制的狮身人面像主题
sphinx-better-theme的Python项目详细描述
这是什么?
这是默认sphinx主题的修改版本,包含以下内容 目标:
- 去掉轻浮的颜色,特别是硬编码的颜色
- 通过限制宽度和使用更多空格提高可读性
- 鼓励通过css进行可视化定制,而不是通过themeconf
- 使用语义标记
v0.1实现目标1和目标2。目标3是部分完成的;很简单 添加你自己的css文件而不创建一个全新的主题。如果 你想要些改变。
兼容性
Sphinx Better主题与Sphinx 0.6.4+和Jinja 2.3.1+兼容。老年人 版本可以工作,但尚未测试。
安装
方法1:添加到源树
由于狮身人面像更好的主题出现的频率,这种方法是首选的。 改进。
将主题放到源树中。如果使用git,可以添加 sphinx-better-theme的存储库作为子模块。否则你可以 download the zip file并将其扩展到可预测的地方。这是一个 使用git的示例:
> git submodule add \ https://github.com/irskep/sphinx-better-theme.git \ docs/sphinx-better-theme > git submodule update --init
将主题的父文件夹添加到conf.py。如果你使用 文件夹结构在上面的块中,您可以这样做:
html_theme_path = ['sphinx-better-theme']
(因为主题路径是sphinx-better-theme/better。
在conf.py中将html_theme设置为'better'。
方法2:安装到站点包
如果将主题添加到源树不切实际,则需要共享它 在多个存储库中,或者如果您更喜欢 更新,你可以像普通的python包一样安装它。
Download the zip file并运行通常的命令:
> python setup.py install
或者从pypi安装:
> pip install sphinx-better-theme
若要使用主题,请将html_theme_path设置为包含 better.better_theme_path,并将html_theme设置为'better':
from better import better_theme_path html_theme_path = [better_theme_path] html_theme = 'better'