python - 狮身人面像模板

标签 python templates python-sphinx

我正在使用 Sphinx .我想模板化它。所以在阅读文档之后,我正在尝试的是,在我的 conf.py 中,

我写了一行,

templates_path = ['_templates']

我创建了一个文件

_templates/page.html

但这不会覆盖 sphinx 提供的默认模板。我还应该做什么,这个模板需要去哪里?


编辑:

来自评论的目录结构:

conf.py
abc.txt
def.txt
makefile
_templates\
   page.html

最佳答案

请确保您使用主题名称作为模板中的显式目录。例如:

{% extends "basic/layout.html"%}

参见:HTML Theming Support

关于python - 狮身人面像模板,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1079417/

相关文章:

c++11随机数生成: how to re-implement `uniform_int_distribution` with `mt19937` without templates

python - 如何使用 python sphinx 链接到外部库?

python - 如何标记文档字符串以有条件地包含在 Sphinx 中?

python - 将方法调用作为变量传递给错误处理函数

c++ - 使用命名空间标准和模板类

c++ - 仅当语句匹配时如何将参数发送给函数?

python-sphinx - 如何停止 Sphinx 自动方法用类名作为方法名前缀

python - 使用 scipy.optimize.fmin_bfgs 时出现 TypeError : f() missing 1 required positional argument:

python - 创建 self 循环的链条

java - 模运算 : Division over factorials % Prime