【发布时间】:2017-08-02 13:52:27
【问题描述】:
我想更改 sphinx 文档中的默认字体。我正在使用 sphinx_bootstrap_theme 'journal'
我该怎么做?
【问题讨论】:
标签: python-sphinx restructuredtext
我想更改 sphinx 文档中的默认字体。我正在使用 sphinx_bootstrap_theme 'journal'
我该怎么做?
【问题讨论】:
标签: python-sphinx restructuredtext
创建您自己的“_templates”目录和“layout.html”文件(假设您从“源”目录构建):
$ mkdir source/_templates
$ touch source/_templates/layout.html
配置你的“conf.py”:
templates_path = ['_templates']
html_static_path = ['_static']
覆盖文件“source/_templates/layout.html”:
{# Import the theme's layout. #}
{% extends "!layout.html" %}
{# Custom CSS overrides #}
{% set bootswatch_css_custom = ['_static/my-styles.css'] %}
在_static/my-styles.css:
body{
font-family:"Arial", Helvetica, sans-serif;
}
This link 应该更有用
【讨论】:
我找到了一种更简单的方法来做同样的事情。
_static/css-style.css
## conf.py
html_css_files = [
'css/css-style.css',
]
在 _static/css-style.css 中:
body{
font-family:"Arial", Helvetica, sans-serif;
}
参考: https://docs.readthedocs.io/en/stable/guides/adding-custom-css.html
【讨论】: