Modifying content width of the Sphinx theme 'Read the Docs'

前端 未结 9 862
小鲜肉
小鲜肉 2020-12-13 18:04

I am using \'Read the Docs\' Sphinx theme for my documentation. In the original theme, given below

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

9条回答
  •  悲哀的现实
    2020-12-13 18:48

    Just in case someone is still searching for a simple answer... combining the ideas from https://samnicholls.net/2016/06/15/how-to-sphinx-readthedocs/ and the above suggestions i found that the most easy way of getting a custom window-width is the following:

    in conf.py add a function that adds your custom stylesheet (just add the following lines):

    def setup(app):
        app.add_css_file('my_theme.css')
    

    and then create a file called my_theme.css in the _static folder that simply contains the following lines:

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

提交回复
热议问题