加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 资源网站 > 资源 > 正文

html – 修改Sphinx主题的内容宽度“阅读文档”

发布时间:2020-12-14 21:33:34 所属栏目:资源 来源:网络整理
导读:我正在使用“阅读文档”Sphinx主题为我的文档。在原来的主题,下面给出 http://read-the-docs.readthedocs.org/en/latest/theme.html 内容或主要布局宽度被设计为移动友好。但是,对于我的项目,我希望这个更广泛。我不知道HTML,因此如果有任何人可以给我一
我正在使用“阅读文档”Sphinx主题为我的文档。在原来的主题,下面给出

http://read-the-docs.readthedocs.org/en/latest/theme.html

内容或主要布局宽度被设计为移动友好。但是,对于我的项目,我希望这个更广泛。我不知道HTML,因此如果有任何人可以给我一些线索来增加内容(布局)宽度,那么会感激。

解决方法

另一个选择是在source / _static中创建一个样式表,只需要你想要的CSS。
.wy-nav-content {
    max-width: none;
}

要么

.wy-nav-content {
    max-width: 1200px !important;
}

确保目录在源/ conf.py中被引用 – 我认为默认情况下有一行要做,即

# Add any paths that contain custom static files (such as style sheets) here,# relative to this directory. They are copied after the builtin static files,# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']

然后在source / _templates / layout.html中创建一个自定义布局,并执行这样的操作以包含样式表

{% extends "!layout.html" %}
{% block extrahead %}
    <link href="{{ pathto("_static/style.css",True) }}" rel="stylesheet" type="text/css">
{% endblock %}

假设你调用你的样式表style.css

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读