Merge pull request #102 from pallets/docs

fix docs build
diff --git a/docs/Makefile b/docs/Makefile
index d10ee88..5128596 100644
--- a/docs/Makefile
+++ b/docs/Makefile
@@ -4,7 +4,6 @@
 # You can set these variables from the command line.
 SPHINXOPTS    =
 SPHINXBUILD   = sphinx-build
-SPHINXPROJ    = MarkupSafe
 SOURCEDIR     = .
 BUILDDIR      = _build
 
@@ -17,4 +16,4 @@
 # 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
+	@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
diff --git a/docs/conf.py b/docs/conf.py
index 0fe75a4..3753fde 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -1,72 +1,42 @@
-# -*- coding: utf-8 -*-
-from __future__ import print_function
-
-from pallets_sphinx_themes import ProjectLink, get_version
+from pallets_sphinx_themes import get_version
+from pallets_sphinx_themes import ProjectLink
 
 # Project --------------------------------------------------------------
 
-project = 'MarkupSafe'
-copyright = '2010 Pallets team'
-author = 'Pallets team'
-release, version = get_version('MarkupSafe')
+project = "MarkupSafe"
+copyright = "2010 Pallets Team"
+author = "Pallets Team"
+release, version = get_version("MarkupSafe")
 
 # General --------------------------------------------------------------
 
-master_doc = 'index'
-
-extensions = [
-    'sphinx.ext.autodoc',
-    'sphinx.ext.intersphinx',
-]
-
-intersphinx_mapping = {
-    'python': ('https://docs.python.org/3/', None),
-}
+master_doc = "index"
+extensions = ["sphinx.ext.autodoc", "sphinx.ext.intersphinx", "pallets_sphinx_themes"]
+intersphinx_mapping = {"python": ("https://docs.python.org/3/", None)}
 
 # HTML -----------------------------------------------------------------
 
-html_theme = 'flask'
+html_theme = "flask"
+html_theme_options = {"index_sidebar_logo": False}
 html_context = {
-    'project_links': [
-        ProjectLink(
-            'Donate to Pallets',
-            'https://psfmember.org/civicrm/contribute/transact?reset=1&id=20'),
-        ProjectLink(
-            'MarkupSafe Website', 'https://palletsprojects.com/p/markupsafe/'),
-        ProjectLink('PyPI Releases', 'https://pypi.org/project/MarkupSafe/'),
-        ProjectLink('Source Code', 'https://github.com/pallets/markupsafe/'),
-        ProjectLink(
-            'Issue Tracker', 'https://github.com/pallets/MarkupSafe/issues/'),
-    ],
-}
-html_sidebars = {
-    'index': [
-        'project.html',
-        'searchbox.html',
-    ],
-    '**': [
-        'localtoc.html',
-        'relations.html',
-        'searchbox.html',
+    "project_links": [
+        ProjectLink("Donate to Pallets", "https://palletsprojects.com/donate"),
+        ProjectLink("Website", "https://palletsprojects.com/p/MarkupSafe/"),
+        ProjectLink("PyPI releases", "https://pypi.org/project/MarkupSafe/"),
+        ProjectLink("Source Code", "https://github.com/pallets/markupsafe/"),
+        ProjectLink("Issue Tracker", "https://github.com/pallets/markupsafe/issues/"),
     ]
 }
+html_sidebars = {
+    "index": ["project.html", "localtoc.html", "searchbox.html"],
+    "**": ["localtoc.html", "relations.html", "searchbox.html"],
+}
+singlehtml_sidebars = {"index": ["project.html", "localtoc.html"]}
+html_title = "MarkupSafe Documentation ({})".format(version)
 html_show_sourcelink = False
 
 # LaTeX ----------------------------------------------------------------
 
 latex_documents = [
-    (
-        master_doc, 'MarkupSafe.tex', 'MarkupSafe Documentation',
-        'Pallets team', 'manual'
-    ),
+    (master_doc, "MarkupSafe-{}.tex".format(version), html_title, author, "manual")
 ]
-latex_use_modindex = False
-latex_elements = {
-    'papersize': 'a4paper',
-    'pointsize': '12pt',
-}
-latex_use_parts = True
-
-# linkcheck ------------------------------------------------------------
-
-linkcheck_anchors = False
diff --git a/docs/make.bat b/docs/make.bat
index 7639bf3..7893348 100644
--- a/docs/make.bat
+++ b/docs/make.bat
@@ -9,7 +9,6 @@
 )
 set SOURCEDIR=.
 set BUILDDIR=_build
-set SPHINXPROJ=MarkupSafe
 
 if "%1" == "" goto help
 
diff --git a/docs/requirements.txt b/docs/requirements.txt
new file mode 100644
index 0000000..295f450
--- /dev/null
+++ b/docs/requirements.txt
@@ -0,0 +1,2 @@
+Sphinx~=1.8.0
+Pallets-Sphinx-Themes~=1.1.0
diff --git a/tox.ini b/tox.ini
index 628547a..efd0163 100644
--- a/tox.ini
+++ b/tox.ini
@@ -11,12 +11,8 @@
 commands = pytest --cov={envsitepackagesdir}/markupsafe --cov-config=tox.ini --cov-report='' --cov-append {posargs}
 
 [testenv:docs-html]
-deps =
-    sphinx
-    pallets-sphinx-themes
-    sphinxcontrib-log-cabinet
-commands =
-    sphinx-build -M html docs {envtmpdir}
+deps = -r docs/requirements.txt
+commands = sphinx-build -W -b html -d {envtmpdir}/doctrees docs {envtmpdir}/html
 
 [testenv:coverage-report]
 deps = coverage