From: Ben Darnell Date: Sun, 13 Jul 2014 02:57:16 +0000 (-0400) Subject: Use sphinx_rtd_theme instead of our lightly-customized version of sphinx default. X-Git-Tag: v4.0.0~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b96d6f6b521af48ca472ddc36970b4df13ac0487;p=thirdparty%2Ftornado.git Use sphinx_rtd_theme instead of our lightly-customized version of sphinx default. The main benefit of this change is the responsive layout for phones and tablets. --- diff --git a/docs/Makefile b/docs/Makefile index 97b258758..a4916851a 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -1,3 +1,6 @@ +.PHONY: all +all: sphinx + SPHINXOPTS=-n -W -d build/doctrees . .PHONY: sphinx diff --git a/docs/conf.py b/docs/conf.py index 89882afa1..d9b4761ce 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -75,32 +75,6 @@ coverage_ignore_functions = [ "multi_future", ] -html_static_path = ['tornado.css'] -html_theme = 'default' -html_style = "tornado.css" -highlight_language = "none" -html_theme_options = dict( - footerbgcolor="#fff", - footertextcolor="#000", - sidebarbgcolor="#fff", - #sidebarbtncolor - sidebartextcolor="#4d8cbf", - sidebarlinkcolor="#216093", - relbarbgcolor="#fff", - relbartextcolor="#000", - relbarlinkcolor="#216093", - bgcolor="#fff", - textcolor="#000", - linkcolor="#216093", - visitedlinkcolor="#216093", - headbgcolor="#fff", - headtextcolor="#4d8cbf", - codebgcolor="#fff", - codetextcolor="#060", - bodyfont="Georgia, serif", - headfont="Calibri, sans-serif", - stickysidebar=True, - ) html_favicon = 'favicon.ico' latex_documents = [ @@ -123,3 +97,13 @@ extlinks = { intersphinx_mapping = { 'python': ('http://python.readthedocs.org/en/latest/', None), } + +on_rtd = os.environ.get('READTHEDOCS', None) == 'True' + +# On RTD we can't import sphinx_rtd_theme, but it will be applied by +# default anyway. This block will use the same theme when building locally +# as on RTD. +if not on_rtd: + import sphinx_rtd_theme + html_theme = 'sphinx_rtd_theme' + html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] diff --git a/docs/tornado.css b/docs/tornado.css deleted file mode 100644 index 20598a3bd..000000000 --- a/docs/tornado.css +++ /dev/null @@ -1,73 +0,0 @@ -@import url("default.css"); - -/* These style tweaks are probably going to turn out to be a little fragile. - They're currently based on the default theme from sphinx 1.0.7. -*/ - -div.body h1, -div.body h2, -div.body h3, -div.body h4, -div.body h5, -div.body h6, -div.sphinxsidebar h3, -div.sphinxsidebar h4 { - font-weight: bold; - border-bottom: none; -} - -pre { - line-height: 14pt; - margin: 17pt; - padding-left: 1em; - border: none; - border-left: 1px solid #ccc; -} - -div.body p, div.body dd, div.body li { - text-align: left; -} - -.highlight { - background: #fff !important; -} - -th.field-name { - background: #fff; -} - -tt { - background: #fff; -} - -/* "related" = top header */ -div.related { - position: fixed; -} - -/* body settings copied from div.sphinxsidebar so following a link to a - specific object positions that object below the fixed header */ -div.body { - top: 30px; - bottom: 0; - right: 0; - left: 230px; - margin: 0; - position: fixed; - overflow: auto; - height: auto; -} - -div.related, div.sphinxsidebar { - font-family: Calibri, sans-serif; -} - -div.section { - max-width: 850px; -} - -/* sphinx renders an em tag inside internal reference links; we don't want - these to be italic */ -a.reference.internal em { - font-style: normal; -} \ No newline at end of file diff --git a/maint/requirements.txt b/maint/requirements.txt index 90f3a4035..f4166a63d 100644 --- a/maint/requirements.txt +++ b/maint/requirements.txt @@ -21,6 +21,7 @@ autopep8==1.0.2 coverage==3.7.1 pep8==1.5.6 pyflakes==0.8.1 +sphinx-rtd-theme==0.1.6 tox==1.7.1 virtualenv==1.11.6