From bb978c0574d68d067e355b26a1fe8c5e8163201b Mon Sep 17 00:00:00 2001 From: Jesse Tan Date: Mon, 18 Dec 2017 14:15:29 +0100 Subject: [PATCH 01/13] Prevent footnote and citation references changing line spacing --- sass/_theme_rst.sass | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sass/_theme_rst.sass b/sass/_theme_rst.sass index e3b374ed..03689f8f 100644 --- a/sass/_theme_rst.sass +++ b/sass/_theme_rst.sass @@ -161,7 +161,9 @@ // These are the little citation links [1] that show up within paragraphs. .footnote-reference, .citation-reference - vertical-align: super + vertical-align: baseline + position: relative + top: -0.4em font-size: 90% // Tables! Sphinx LOVES TABLES. Most of wyrm assumes you're only going to use a table as a table From 8355c2162fbb4bf0b216f15afdb9484bd791c649 Mon Sep 17 00:00:00 2001 From: Jesse Tan Date: Mon, 18 Dec 2017 14:24:14 +0100 Subject: [PATCH 02/13] Do not interefere with line-height --- sass/_theme_rst.sass | 1 + 1 file changed, 1 insertion(+) diff --git a/sass/_theme_rst.sass b/sass/_theme_rst.sass index 03689f8f..a2035c51 100644 --- a/sass/_theme_rst.sass +++ b/sass/_theme_rst.sass @@ -164,6 +164,7 @@ vertical-align: baseline position: relative top: -0.4em + line-height: 0 font-size: 90% // Tables! Sphinx LOVES TABLES. Most of wyrm assumes you're only going to use a table as a table From 117be8e1862f3c10eae7db7a5b54bbc4b59bac44 Mon Sep 17 00:00:00 2001 From: Aaron Carlisle Date: Wed, 20 Dec 2017 18:19:03 -0500 Subject: [PATCH 03/13] New documentation structure This splits the docs from the demo so that we can now actually document the theme and its parts. --- {demo_docs => docs}/Makefile | 0 {demo_docs => docs}/source/conf.py | 0 {demo_docs/source => docs/source/demo}/api.rst | 0 {demo_docs/source => docs/source/demo}/demo.rst | 0 {demo_docs/source => docs/source/demo}/index.rst | 6 +++--- .../source => docs/source/demo}/lists_tables.rst | 0 {demo_docs/source => docs/source/demo}/long.rst | 0 .../source => docs/source/demo}/structure.rst | 0 .../source/demo}/test_py_module/__init__.py | 0 .../source/demo}/test_py_module/test.py | 0 docs/source/index.rst | 8 ++++++++ .../source/static/logo-wordmark-light.svg | 0 .../source/static/screen_desktop.png | Bin {demo_docs => docs}/source/static/screen_mobile.png | Bin .../source/static/yi_jing_01_chien.jpg | Bin 15 files changed, 11 insertions(+), 3 deletions(-) rename {demo_docs => docs}/Makefile (100%) rename {demo_docs => docs}/source/conf.py (100%) rename {demo_docs/source => docs/source/demo}/api.rst (100%) rename {demo_docs/source => docs/source/demo}/demo.rst (100%) rename {demo_docs/source => docs/source/demo}/index.rst (81%) rename {demo_docs/source => docs/source/demo}/lists_tables.rst (100%) rename {demo_docs/source => docs/source/demo}/long.rst (100%) rename {demo_docs/source => docs/source/demo}/structure.rst (100%) rename {demo_docs/source => docs/source/demo}/test_py_module/__init__.py (100%) rename {demo_docs/source => docs/source/demo}/test_py_module/test.py (100%) create mode 100644 docs/source/index.rst rename {demo_docs => docs}/source/static/logo-wordmark-light.svg (100%) rename {demo_docs => docs}/source/static/screen_desktop.png (100%) rename {demo_docs => docs}/source/static/screen_mobile.png (100%) rename {demo_docs => docs}/source/static/yi_jing_01_chien.jpg (100%) diff --git a/demo_docs/Makefile b/docs/Makefile similarity index 100% rename from demo_docs/Makefile rename to docs/Makefile diff --git a/demo_docs/source/conf.py b/docs/source/conf.py similarity index 100% rename from demo_docs/source/conf.py rename to docs/source/conf.py diff --git a/demo_docs/source/api.rst b/docs/source/demo/api.rst similarity index 100% rename from demo_docs/source/api.rst rename to docs/source/demo/api.rst diff --git a/demo_docs/source/demo.rst b/docs/source/demo/demo.rst similarity index 100% rename from demo_docs/source/demo.rst rename to docs/source/demo/demo.rst diff --git a/demo_docs/source/index.rst b/docs/source/demo/index.rst similarity index 81% rename from demo_docs/source/index.rst rename to docs/source/demo/index.rst index c439b2cf..b2f4a962 100644 --- a/demo_docs/source/index.rst +++ b/docs/source/demo/index.rst @@ -1,7 +1,7 @@ -***************************** -Read the Docs Theme Demo Docs -***************************** +************************ +Read the Docs Theme Demo +************************ These documents are used to test and stress test the Read the Docs Theme. diff --git a/demo_docs/source/lists_tables.rst b/docs/source/demo/lists_tables.rst similarity index 100% rename from demo_docs/source/lists_tables.rst rename to docs/source/demo/lists_tables.rst diff --git a/demo_docs/source/long.rst b/docs/source/demo/long.rst similarity index 100% rename from demo_docs/source/long.rst rename to docs/source/demo/long.rst diff --git a/demo_docs/source/structure.rst b/docs/source/demo/structure.rst similarity index 100% rename from demo_docs/source/structure.rst rename to docs/source/demo/structure.rst diff --git a/demo_docs/source/test_py_module/__init__.py b/docs/source/demo/test_py_module/__init__.py similarity index 100% rename from demo_docs/source/test_py_module/__init__.py rename to docs/source/demo/test_py_module/__init__.py diff --git a/demo_docs/source/test_py_module/test.py b/docs/source/demo/test_py_module/test.py similarity index 100% rename from demo_docs/source/test_py_module/test.py rename to docs/source/demo/test_py_module/test.py diff --git a/docs/source/index.rst b/docs/source/index.rst new file mode 100644 index 00000000..a411d392 --- /dev/null +++ b/docs/source/index.rst @@ -0,0 +1,8 @@ + +************************ +Read the Docs Theme Docs +************************ + +.. tocree:: + + demo/index.rst diff --git a/demo_docs/source/static/logo-wordmark-light.svg b/docs/source/static/logo-wordmark-light.svg similarity index 100% rename from demo_docs/source/static/logo-wordmark-light.svg rename to docs/source/static/logo-wordmark-light.svg diff --git a/demo_docs/source/static/screen_desktop.png b/docs/source/static/screen_desktop.png similarity index 100% rename from demo_docs/source/static/screen_desktop.png rename to docs/source/static/screen_desktop.png diff --git a/demo_docs/source/static/screen_mobile.png b/docs/source/static/screen_mobile.png similarity index 100% rename from demo_docs/source/static/screen_mobile.png rename to docs/source/static/screen_mobile.png diff --git a/demo_docs/source/static/yi_jing_01_chien.jpg b/docs/source/static/yi_jing_01_chien.jpg similarity index 100% rename from demo_docs/source/static/yi_jing_01_chien.jpg rename to docs/source/static/yi_jing_01_chien.jpg From 5db94ebf5f6f06d36fb961a7cee0b53d426214b6 Mon Sep 17 00:00:00 2001 From: Jesse Tan Date: Thu, 21 Dec 2017 00:50:10 +0100 Subject: [PATCH 04/13] Always call nav.enable() to make nav collapsable (#519) Always call nav.enable() to make nav collapsing work --- js/theme.js | 46 ++++++++++++++++++++++-------------- sphinx_rtd_theme/layout.html | 9 +++---- 2 files changed, 33 insertions(+), 22 deletions(-) diff --git a/js/theme.js b/js/theme.js index 9fb32829..c9158d19 100644 --- a/js/theme.js +++ b/js/theme.js @@ -15,17 +15,22 @@ function ThemeNav () { isRunning: false }; - nav.enable = function () { + nav.enable = function (withStickyNav) { var self = this; - if (!self.isRunning) { - self.isRunning = true; - jQuery(function ($) { - self.init($); + if (self.isRunning) { + // Only allow enabling nav logic once + return; + } - self.reset(); - self.win.on('hashchange', self.reset); + self.isRunning = true; + jQuery(function ($) { + self.init($); + self.reset(); + self.win.on('hashchange', self.reset); + + if (withStickyNav) { // Set scroll monitor self.win.on('scroll', function () { if (!self.linkScroll) { @@ -35,18 +40,23 @@ function ThemeNav () { } } }); + } - // Set resize monitor - self.win.on('resize', function () { - if (!self.winResize) { - self.winResize = true; - requestAnimationFrame(function() { self.onResize(); }); - } - }); - - self.onResize(); + // Set resize monitor + self.win.on('resize', function () { + if (!self.winResize) { + self.winResize = true; + requestAnimationFrame(function() { self.onResize(); }); + } }); - }; + + self.onResize(); + }); + + }; + + nav.enableSticky = function() { + this.enable(true); }; nav.init = function ($) { @@ -176,7 +186,7 @@ function ThemeNav () { module.exports.ThemeNav = ThemeNav(); if (typeof(window) != 'undefined') { - window.SphinxRtdTheme = { StickyNav: module.exports.ThemeNav }; + window.SphinxRtdTheme = { Navigation: module.exports.ThemeNav }; } diff --git a/sphinx_rtd_theme/layout.html b/sphinx_rtd_theme/layout.html index 965cc45c..e647bddd 100644 --- a/sphinx_rtd_theme/layout.html +++ b/sphinx_rtd_theme/layout.html @@ -209,14 +209,15 @@ {% endif %} - {# STICKY NAVIGATION #} - {% if theme_sticky_navigation|tobool %} - {% endif %} {%- block footer %} {% endblock %} From 56bffcb8fb1fb53abc32ced47f456ae606edbf12 Mon Sep 17 00:00:00 2001 From: Eric Holscher Date: Wed, 20 Dec 2017 20:09:36 -0800 Subject: [PATCH 05/13] Rejigger --- docs/Makefile | 4 ++-- docs/{source => }/conf.py | 0 docs/{source => }/demo/api.rst | 0 docs/{source => }/demo/demo.rst | 0 docs/{source => }/demo/index.rst | 0 docs/{source => }/demo/lists_tables.rst | 0 docs/{source => }/demo/long.rst | 0 docs/{source => }/demo/structure.rst | 0 docs/{source => }/demo/test_py_module/__init__.py | 0 docs/{source => }/demo/test_py_module/test.py | 0 docs/{source => }/index.rst | 0 docs/requirements.txt | 1 + docs/{source => }/static/logo-wordmark-light.svg | 0 docs/{source => }/static/screen_desktop.png | Bin docs/{source => }/static/screen_mobile.png | Bin docs/{source => }/static/yi_jing_01_chien.jpg | Bin 16 files changed, 3 insertions(+), 2 deletions(-) rename docs/{source => }/conf.py (100%) rename docs/{source => }/demo/api.rst (100%) rename docs/{source => }/demo/demo.rst (100%) rename docs/{source => }/demo/index.rst (100%) rename docs/{source => }/demo/lists_tables.rst (100%) rename docs/{source => }/demo/long.rst (100%) rename docs/{source => }/demo/structure.rst (100%) rename docs/{source => }/demo/test_py_module/__init__.py (100%) rename docs/{source => }/demo/test_py_module/test.py (100%) rename docs/{source => }/index.rst (100%) create mode 100644 docs/requirements.txt rename docs/{source => }/static/logo-wordmark-light.svg (100%) rename docs/{source => }/static/screen_desktop.png (100%) rename docs/{source => }/static/screen_mobile.png (100%) rename docs/{source => }/static/yi_jing_01_chien.jpg (100%) diff --git a/docs/Makefile b/docs/Makefile index 8c907fd4..9d8f7edc 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -10,9 +10,9 @@ BUILDDIR = build # Internal variables. PAPEROPT_a4 = -D latex_paper_size=a4 PAPEROPT_letter = -D latex_paper_size=letter -ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source +ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . # the i18n builder cannot share the environment and doctrees with the others -I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source +I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . .PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext diff --git a/docs/source/conf.py b/docs/conf.py similarity index 100% rename from docs/source/conf.py rename to docs/conf.py diff --git a/docs/source/demo/api.rst b/docs/demo/api.rst similarity index 100% rename from docs/source/demo/api.rst rename to docs/demo/api.rst diff --git a/docs/source/demo/demo.rst b/docs/demo/demo.rst similarity index 100% rename from docs/source/demo/demo.rst rename to docs/demo/demo.rst diff --git a/docs/source/demo/index.rst b/docs/demo/index.rst similarity index 100% rename from docs/source/demo/index.rst rename to docs/demo/index.rst diff --git a/docs/source/demo/lists_tables.rst b/docs/demo/lists_tables.rst similarity index 100% rename from docs/source/demo/lists_tables.rst rename to docs/demo/lists_tables.rst diff --git a/docs/source/demo/long.rst b/docs/demo/long.rst similarity index 100% rename from docs/source/demo/long.rst rename to docs/demo/long.rst diff --git a/docs/source/demo/structure.rst b/docs/demo/structure.rst similarity index 100% rename from docs/source/demo/structure.rst rename to docs/demo/structure.rst diff --git a/docs/source/demo/test_py_module/__init__.py b/docs/demo/test_py_module/__init__.py similarity index 100% rename from docs/source/demo/test_py_module/__init__.py rename to docs/demo/test_py_module/__init__.py diff --git a/docs/source/demo/test_py_module/test.py b/docs/demo/test_py_module/test.py similarity index 100% rename from docs/source/demo/test_py_module/test.py rename to docs/demo/test_py_module/test.py diff --git a/docs/source/index.rst b/docs/index.rst similarity index 100% rename from docs/source/index.rst rename to docs/index.rst diff --git a/docs/requirements.txt b/docs/requirements.txt new file mode 100644 index 00000000..61346f6e --- /dev/null +++ b/docs/requirements.txt @@ -0,0 +1 @@ +sphinxcontrib.httpdomain diff --git a/docs/source/static/logo-wordmark-light.svg b/docs/static/logo-wordmark-light.svg similarity index 100% rename from docs/source/static/logo-wordmark-light.svg rename to docs/static/logo-wordmark-light.svg diff --git a/docs/source/static/screen_desktop.png b/docs/static/screen_desktop.png similarity index 100% rename from docs/source/static/screen_desktop.png rename to docs/static/screen_desktop.png diff --git a/docs/source/static/screen_mobile.png b/docs/static/screen_mobile.png similarity index 100% rename from docs/source/static/screen_mobile.png rename to docs/static/screen_mobile.png diff --git a/docs/source/static/yi_jing_01_chien.jpg b/docs/static/yi_jing_01_chien.jpg similarity index 100% rename from docs/source/static/yi_jing_01_chien.jpg rename to docs/static/yi_jing_01_chien.jpg From 6e6a8729ca110f350101c28b48a2cdf6acbbba67 Mon Sep 17 00:00:00 2001 From: Eric Holscher Date: Wed, 20 Dec 2017 20:16:03 -0800 Subject: [PATCH 06/13] Lots of cleanup --- docs/Makefile | 155 ++---------------- docs/conf.py | 3 +- .../{ => demo}/static/logo-wordmark-light.svg | 0 docs/{ => demo}/static/screen_desktop.png | Bin docs/{ => demo}/static/screen_mobile.png | Bin docs/{ => demo}/static/yi_jing_01_chien.jpg | Bin docs/index.rst | 2 +- 7 files changed, 13 insertions(+), 147 deletions(-) rename docs/{ => demo}/static/logo-wordmark-light.svg (100%) rename docs/{ => demo}/static/screen_desktop.png (100%) rename docs/{ => demo}/static/screen_mobile.png (100%) rename docs/{ => demo}/static/yi_jing_01_chien.jpg (100%) diff --git a/docs/Makefile b/docs/Makefile index 9d8f7edc..1d570829 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -1,153 +1,20 @@ -# Makefile for Sphinx documentation +# Minimal makefile for Sphinx documentation # # You can set these variables from the command line. SPHINXOPTS = SPHINXBUILD = sphinx-build -PAPER = -BUILDDIR = build - -# Internal variables. -PAPEROPT_a4 = -D latex_paper_size=a4 -PAPEROPT_letter = -D latex_paper_size=letter -ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . -# the i18n builder cannot share the environment and doctrees with the others -I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . - -.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext +SPHINXPROJ = ReadtheDocsSphinxTheme +SOURCEDIR = . +BUILDDIR = _build +# Put it first so that "make" without argument is like "make help". help: - @echo "Please use \`make ' where is one of" - @echo " html to make standalone HTML files" - @echo " dirhtml to make HTML files named index.html in directories" - @echo " singlehtml to make a single large HTML file" - @echo " pickle to make pickle files" - @echo " json to make JSON files" - @echo " htmlhelp to make HTML files and a HTML help project" - @echo " qthelp to make HTML files and a qthelp project" - @echo " devhelp to make HTML files and a Devhelp project" - @echo " epub to make an epub" - @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" - @echo " latexpdf to make LaTeX files and run them through pdflatex" - @echo " text to make text files" - @echo " man to make manual pages" - @echo " texinfo to make Texinfo files" - @echo " info to make Texinfo files and run them through makeinfo" - @echo " gettext to make PO message catalogs" - @echo " changes to make an overview of all changed/added/deprecated items" - @echo " linkcheck to check all external links for integrity" - @echo " doctest to run all doctests embedded in the documentation (if enabled)" + @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) -clean: - -rm -rf $(BUILDDIR)/* +.PHONY: help Makefile -html: - $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html - @echo - @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." - -dirhtml: - $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml - @echo - @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml." - -singlehtml: - $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml - @echo - @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml." - -pickle: - $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle - @echo - @echo "Build finished; now you can process the pickle files." - -json: - $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json - @echo - @echo "Build finished; now you can process the JSON files." - -htmlhelp: - $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp - @echo - @echo "Build finished; now you can run HTML Help Workshop with the" \ - ".hhp project file in $(BUILDDIR)/htmlhelp." - -qthelp: - $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp - @echo - @echo "Build finished; now you can run "qcollectiongenerator" with the" \ - ".qhcp project file in $(BUILDDIR)/qthelp, like this:" - @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/SphinxRTDthemedemo.qhcp" - @echo "To view the help file:" - @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/SphinxRTDthemedemo.qhc" - -devhelp: - $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp - @echo - @echo "Build finished." - @echo "To view the help file:" - @echo "# mkdir -p $$HOME/.local/share/devhelp/SphinxRTDthemedemo" - @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/SphinxRTDthemedemo" - @echo "# devhelp" - -epub: - $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub - @echo - @echo "Build finished. The epub file is in $(BUILDDIR)/epub." - -latex: - $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex - @echo - @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." - @echo "Run \`make' in that directory to run these through (pdf)latex" \ - "(use \`make latexpdf' here to do that automatically)." - -latexpdf: - $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex - @echo "Running LaTeX files through pdflatex..." - $(MAKE) -C $(BUILDDIR)/latex all-pdf - @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." - -text: - $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text - @echo - @echo "Build finished. The text files are in $(BUILDDIR)/text." - -man: - $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man - @echo - @echo "Build finished. The manual pages are in $(BUILDDIR)/man." - -texinfo: - $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo - @echo - @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo." - @echo "Run \`make' in that directory to run these through makeinfo" \ - "(use \`make info' here to do that automatically)." - -info: - $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo - @echo "Running Texinfo files through makeinfo..." - make -C $(BUILDDIR)/texinfo info - @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo." - -gettext: - $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale - @echo - @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale." - -changes: - $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes - @echo - @echo "The overview file is in $(BUILDDIR)/changes." - -linkcheck: - $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck - @echo - @echo "Link check complete; look for any errors in the above output " \ - "or in $(BUILDDIR)/linkcheck/output.txt." - -doctest: - $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest - @echo "Testing of doctests in the sources finished, look at the " \ - "results in $(BUILDDIR)/doctest/output.txt." +# Catch-all target: route all unknown targets to Sphinx using the new +# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). +%: Makefile + @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) \ No newline at end of file diff --git a/docs/conf.py b/docs/conf.py index c4204e69..299d72b5 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -14,8 +14,7 @@ import sys import os -sys.path.append(os.path.abspath('.')) -sys.path.append(os.path.abspath('./test_py_module')) +sys.path.append(os.path.abspath('./demo/')) # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the diff --git a/docs/static/logo-wordmark-light.svg b/docs/demo/static/logo-wordmark-light.svg similarity index 100% rename from docs/static/logo-wordmark-light.svg rename to docs/demo/static/logo-wordmark-light.svg diff --git a/docs/static/screen_desktop.png b/docs/demo/static/screen_desktop.png similarity index 100% rename from docs/static/screen_desktop.png rename to docs/demo/static/screen_desktop.png diff --git a/docs/static/screen_mobile.png b/docs/demo/static/screen_mobile.png similarity index 100% rename from docs/static/screen_mobile.png rename to docs/demo/static/screen_mobile.png diff --git a/docs/static/yi_jing_01_chien.jpg b/docs/demo/static/yi_jing_01_chien.jpg similarity index 100% rename from docs/static/yi_jing_01_chien.jpg rename to docs/demo/static/yi_jing_01_chien.jpg diff --git a/docs/index.rst b/docs/index.rst index a411d392..bfe155da 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -3,6 +3,6 @@ Read the Docs Theme Docs ************************ -.. tocree:: +.. toctree:: demo/index.rst From 38162920b46e045a77bafb6836b6699517fea356 Mon Sep 17 00:00:00 2001 From: Eric Holscher Date: Wed, 20 Dec 2017 20:29:52 -0800 Subject: [PATCH 07/13] More cleanup --- README.rst | 1 + docs/conf.py | 14 +++++++++----- docs/demo/index.rst | 2 -- docs/index.rst | 13 +++++++++---- 4 files changed, 19 insertions(+), 11 deletions(-) diff --git a/README.rst b/README.rst index a080195c..91def048 100644 --- a/README.rst +++ b/README.rst @@ -22,6 +22,7 @@ Read the Docs Sphinx Theme ************************** .. contents:: + :backlinks: none View a working demo_ over on readthedocs.org_. diff --git a/docs/conf.py b/docs/conf.py index 299d72b5..67824eee 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -14,8 +14,12 @@ import sys import os + +sys.path.append(os.path.abspath('..')) sys.path.append(os.path.abspath('./demo/')) +from sphinx_rtd_theme import __version__ + # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. @@ -51,17 +55,17 @@ source_suffix = '.rst' master_doc = 'index' # General information about the project. -project = u'Sphinx RTD theme demo' -copyright = u'2013, Dave Snider' +project = u'Read the Docs Sphinx Theme' +copyright = u'Read the Docs, Inc & contributors' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the # built documents. # # The short X.Y version. -version = '0.2.4' +version = __version__ # The full version, including alpha/beta/rc tags. -release = '0.2.4' +release = __version__ # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. @@ -125,7 +129,7 @@ html_theme_path = ["../.."] # The name of an image file (relative to this directory) to place at the top # of the sidebar. -html_logo = "static/logo-wordmark-light.svg" +html_logo = "demo/static/logo-wordmark-light.svg" # The name of an image file (within the static path) to use as favicon of the # docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 diff --git a/docs/demo/index.rst b/docs/demo/index.rst index b2f4a962..1c85869f 100644 --- a/docs/demo/index.rst +++ b/docs/demo/index.rst @@ -1,5 +1,3 @@ - -************************ Read the Docs Theme Demo ************************ diff --git a/docs/index.rst b/docs/index.rst index bfe155da..27bfdb75 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -1,8 +1,13 @@ -************************ -Read the Docs Theme Docs -************************ +.. include:: ../README.rst + +Content +======= .. toctree:: + :caption: Theme - demo/index.rst +.. toctree:: + :caption: Demo + + demo/index From 8e4167e364491779b7619ea9143fe1046c202647 Mon Sep 17 00:00:00 2001 From: Eric Holscher Date: Wed, 20 Dec 2017 20:31:48 -0800 Subject: [PATCH 08/13] Add badge --- README.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.rst b/README.rst index 91def048..1deb97f9 100644 --- a/README.rst +++ b/README.rst @@ -16,6 +16,9 @@ .. image:: https://img.shields.io/pypi/l/sphinx_rtd_theme.svg :target: https://pypi.python.org/pypi/sphinx_rtd_theme/ :alt: license +.. image:: https://readthedocs.org/projects/sphinx-rtd-theme/badge/?version=latest + :target: http://sphinx-rtd-theme.readthedocs.io/en/latest/?badge=latest + :alt: Documentation Status ************************** Read the Docs Sphinx Theme From 72003513aaf5adbae414fb097d045f55b8fe5bf3 Mon Sep 17 00:00:00 2001 From: Eric Holscher Date: Wed, 20 Dec 2017 20:36:52 -0800 Subject: [PATCH 09/13] Add docs to travis --- .travis.yml | 4 ++++ docs/requirements.txt | 1 + tox.ini | 9 ++++++++- 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index abdeb386..d27d82af 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,6 +4,10 @@ python: - 3.4 - 3.5 - 3.6 +matrix: + include: + - python: 2.7 + env: TOXENV=docs sudo: false install: - pip install tox-travis diff --git a/docs/requirements.txt b/docs/requirements.txt index 61346f6e..41afd03c 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1 +1,2 @@ sphinxcontrib.httpdomain +sphinx diff --git a/tox.ini b/tox.ini index 6052fc03..791f812a 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py{27,34,35,36}-sphinx{13,14,15} +envlist = py{27,34,35,36}-sphinx{13,14,15}, docs [tox:travis] 2.7 = py27-sphinx{13,14,15} @@ -19,3 +19,10 @@ deps = sphinx15: Sphinx < 1.6 commands = py.test {posargs} + +[testenv:docs] +changedir = {toxinidir}/docs +deps = + -r{toxinidir}/docs/requirements.txt +commands = + sphinx-build -b html -d {envtmpdir}/doctrees . {envtmpdir}/html From 612788d8e1d0e535dc059b6956f898877ac6deef Mon Sep 17 00:00:00 2001 From: Eric Holscher Date: Wed, 20 Dec 2017 20:37:27 -0800 Subject: [PATCH 10/13] No double build --- .travis.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.travis.yml b/.travis.yml index d27d82af..2ed49b7f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,3 +13,7 @@ install: - pip install tox-travis script: - tox + +branches: + only: + - master From 161cb8b67f653d356f0f6347565b53240fb273f2 Mon Sep 17 00:00:00 2001 From: Eric Holscher Date: Wed, 20 Dec 2017 20:39:01 -0800 Subject: [PATCH 11/13] More sphinx --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index 791f812a..854f888f 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py{27,34,35,36}-sphinx{13,14,15}, docs +envlist = py{27,34,35,36}-sphinx{13,14,15,16}, docs [tox:travis] 2.7 = py27-sphinx{13,14,15} From 6392329d34b279f1bb22389298cf7fd83ec78cd9 Mon Sep 17 00:00:00 2001 From: Eric Holscher Date: Wed, 20 Dec 2017 20:39:13 -0800 Subject: [PATCH 12/13] With deps --- tox.ini | 1 + 1 file changed, 1 insertion(+) diff --git a/tox.ini b/tox.ini index 854f888f..cf970daf 100644 --- a/tox.ini +++ b/tox.ini @@ -17,6 +17,7 @@ deps = sphinx13: Sphinx < 1.4 sphinx14: Sphinx < 1.5 sphinx15: Sphinx < 1.6 + sphinx16: Sphinx < 1.7 commands = py.test {posargs} From 38ba3fc3ed37e8e467f4d46eaea4bf276cdbb7d1 Mon Sep 17 00:00:00 2001 From: Eric Holscher Date: Thu, 21 Dec 2017 06:27:44 -0800 Subject: [PATCH 13/13] Remove image from readme, and link demo to site (#521) --- README.rst | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/README.rst b/README.rst index 1deb97f9..9b3d30dc 100644 --- a/README.rst +++ b/README.rst @@ -6,7 +6,7 @@ .. _wyrm: http://www.github.com/snide/wyrm/ .. _grunt: http://www.gruntjs.com .. _node: http://www.nodejs.com -.. _demo: http://docs.readthedocs.org +.. _demo: https://sphinx-rtd-theme.readthedocs.io/en/latest/ .. _hidden: http://sphinx-doc.org/markup/toctree.html .. image:: https://img.shields.io/pypi/v/sphinx_rtd_theme.svg @@ -35,9 +35,6 @@ If you'd like to update the theme, please make your edits to the SASS files here, rather than the .css files on checked into the repo. -.. image:: demo_docs/source/static/screen_mobile.png - :width: 100% - Installation ============