Unverified Commit 47834820 authored by Nicolas Hug's avatar Nicolas Hug Committed by GitHub
Browse files

Remove hardcoded dependency version for sphinx (#3660)



* Try using the pyortch theme

* directly embed script in layout.html instead

* use more mordern script
Co-authored-by: default avatarFrancisco Massa <fvsmassa@gmail.com>
parent eee42492
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# #
# You can set these variables from the command line. # You can set these variables from the command line.
SPHINXOPTS = -W # turn warnings into errors SPHINXOPTS = # -W # turn warnings into errors
SPHINXBUILD = sphinx-build SPHINXBUILD = sphinx-build
SPHINXPROJ = torchvision SPHINXPROJ = torchvision
SOURCEDIR = source SOURCEDIR = source
......
sphinx==1.7.3 sphinx
sphinxcontrib-googleanalytics
-e git+git://github.com/pytorch/pytorch_sphinx_theme.git#egg=pytorch_sphinx_theme -e git+git://github.com/pytorch/pytorch_sphinx_theme.git#egg=pytorch_sphinx_theme
{% extends "!layout.html" %} {% extends "!layout.html" %}
{%- block extrahead %}
<!-- Google Analytics -->
<script>
window.ga=window.ga||function(){(ga.q=ga.q||[]).push(arguments)};ga.l=+new Date;
ga('create', 'UA-90545585-1', 'auto');
ga('send', 'pageview');
</script>
<script async src='https://www.google-analytics.com/analytics.js'></script>
<!-- End Google Analytics -->
{{ super() }}
{% endblock %}
{% block sidebartitle %} {% block sidebartitle %}
<div class="version"> <div class="version">
<a href='https://pytorch.org/vision/versions.html'>{{ version }} &#x25BC</a> <a href='https://pytorch.org/vision/versions.html'>{{ version }} &#x25BC</a>
......
...@@ -23,23 +23,8 @@ ...@@ -23,23 +23,8 @@
import torch import torch
import torchvision import torchvision
import pytorch_sphinx_theme import pytorch_sphinx_theme
from sphinxcontrib import googleanalytics
# Wrap sphinxcontrib-googleanalytics setup() function to avoid a Sphinx warning:
# "WARNING: extension ‘sphinxcontrib.googleanalytics’ returned an unsupported
# object from its setup() function; it should return None or a metadata
# dictionary"
_googleanalytics_setup_original = googleanalytics.setup
def _googleanalytics_setup_wrapper(app):
_googleanalytics_setup_original(app)
return {"version": "0.1"}
googleanalytics.setup = _googleanalytics_setup_wrapper
# -- General configuration ------------------------------------------------ # -- General configuration ------------------------------------------------
# If your documentation needs a minimal Sphinx version, state it here. # If your documentation needs a minimal Sphinx version, state it here.
...@@ -59,16 +44,12 @@ extensions = [ ...@@ -59,16 +44,12 @@ extensions = [
'sphinx.ext.mathjax', 'sphinx.ext.mathjax',
'sphinx.ext.napoleon', 'sphinx.ext.napoleon',
'sphinx.ext.viewcode', 'sphinx.ext.viewcode',
'sphinxcontrib.googleanalytics',
] ]
napoleon_use_ivar = True napoleon_use_ivar = True
napoleon_numpy_docstring = False napoleon_numpy_docstring = False
napoleon_google_docstring = True napoleon_google_docstring = True
googleanalytics_id = 'UA-90545585-1'
googleanalytics_enabled = True
# Add any paths that contain templates here, relative to this directory. # Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates'] templates_path = ['_templates']
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment