跳转至

readthedocs-theme#

I like readthedocs theme, but it is so anoying to see the half page.

for more details, see:

  • https://github.com/readthedocs/sphinx_rtd_theme/issues/295
  • https://github.com/mkdocs/mkdocs/issues/2049

Solution#

vim ~/.pyenv/versions/mkdocs/lib/python3.12/site-packages/mkdocs/themes/readthedocs/base.html

22  {%- block styles %}
23    <link rel="stylesheet" href="{{ 'css/theme.css'|url }}" />
24    <link rel="stylesheet" href="{{ 'css/theme_extra.css'|url }}" />
25    {%- if config.theme.highlightjs %}
26        <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.8.0/styles/{{ config.theme.hljs_style }}.min.css" />
27    {%- endif %}
28    {%- for path in config.extra_css %}
29        <link href="{{ path|url }}" rel="stylesheet" />
30    {%- endfor %}
31    <style>
32      .wy-nav-content { max-width: none; }
33    </style>  
34  {%- endblock %}