ryan-roemer / sphinx-bootstrap-theme

Sphinx Bootstrap Theme
http://ryan-roemer.github.io/sphinx-bootstrap-theme/README.html
MIT License
585 stars 213 forks source link

pair of double quotes in theme.conf being read literally #115

Closed EricFromCanada closed 9 years ago

EricFromCanada commented 9 years ago

The default theme.conf contains the line bootswatch_theme = "". When building a project with Sphinx 1.3a0 under Python 2.7.5, this works fine, but with Sphinx 1.3b2 under Python 3.4.2, this fails to generate a correct <link> tag: <link rel="stylesheet" href="_static/bootswatch-3.2.0/""/bootstrap.min.css" type="text/css" />

Somehow the pair of quotes is no longer being read as a "False" value, causing layout.html to act as though a bootswatch theme was specified. The fix is easy enough: in the default theme.conf, just remove the quotes.

ryan-roemer commented 9 years ago

@EricFromCanada / @peteut -- I just updated to Sphinx==1.3b2dev-20141130 and I actually don't see the issue with this diff for demo:

diff --git a/demo/source/conf.py b/demo/source/conf.py
index 490c9d0..1dd54fe 100644
--- a/demo/source/conf.py
+++ b/demo/source/conf.py
@@ -159,7 +159,7 @@ html_theme_options = {
     # * superhero
     # * united
     # * yeti (v3 only)
-    'bootswatch_theme': "flatly",
+    #'bootswatch_theme': "flatly",

     # Choose Bootstrap version.
     # Values: "3" (default) or "2" (in quotes)

Can you help me with a repro so I can see it?

peteut commented 9 years ago

Installled Sphinx tip, but after make clean && make html the issue is still there. Probably make clean is not sufficient?

pip list | grep Sphinx 
Warning: cannot find svn location for Sphinx==1.3b2dev-20141201
Sphinx (1.3b2dev-20141201)
diff --git a/demo/source/conf.py b/demo/source/conf.py
index 490c9d0..f652f14 100644
--- a/demo/source/conf.py
+++ b/demo/source/conf.py
@@ -159,7 +159,7 @@ html_theme_options = {
     # * superhero
     # * united
     # * yeti (v3 only)
-    'bootswatch_theme': "flatly",
+    #'bootswatch_theme': "flatly",

     # Choose Bootstrap version.
     # Values: "3" (default) or "2" (in quotes)
ryan-roemer commented 9 years ago

@peteut -- I get this for all of my <link>s in the homepage rendered HTML:

    <link rel="stylesheet" href="_static/basic.css" type="text/css" />
    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
    <link rel="stylesheet" href="_static/bootstrap-3.2.0/css/bootstrap.min.css" type="text/css" />
    <link rel="stylesheet" href="_static/bootstrap-3.2.0/css/bootstrap-theme.min.css" type="text/css" />
    <link rel="stylesheet" href="_static/bootstrap-sphinx.css" type="text/css" />

What do you get?

peteut commented 9 years ago

I get this

<link type="text/css" href="_static/basic.css" rel="stylesheet">
<link type="text/css" href="_static/pygments.css" rel="stylesheet">
<link type="text/css" bootstrap.min.css"="" "="" href="_static/bootswatch-3.2.0/" rel="stylesheet">
<link type="text/css" href="_static/bootstrap-sphinx.css" rel="stylesheet">
ryan-roemer commented 9 years ago

@EricFromCanada / @peteut -- Can I get your full pip freeze output? I must be doing something wrong here...

peteut commented 9 years ago

Here is my pip freeze:

Cython==0.21.1
Jinja2==2.7.3
MarkupSafe==0.23
Pygments==2.0.1
Sphinx==1.2.3
aiozmq==0.5.3
asyncio==3.4.1
-e git+https://github.com/peteut/construct.git@eb838b72ef218a29229aa6b63e16bfdaba134125#egg=construct-origin/HEAD
cov-core==1.15.0
coverage==3.7.1
cyordereddict==0.2.1
docutils==0.12
ensure==0.2.2
flake8==2.2.5
fn==0.4.3
ipython==2.3.1
iso8601==0.1.10
mccabe==0.2.1
-e git+git@github.com:peteut/migen.git@769dcacf740042a6b7d30897b59672d0fa711808#egg=migen-arriaiidev
nose2==0.5.0
-e git://github.com/peteut/nose2-cprof@ac9173b2fccde88518f44bfe5c35dc572616f909#egg=nose2_cprof-master
numpy==1.9.1
ohconvert==1.1
pep8==1.5.7
pkginfo==1.2b1
py==1.4.26
pyflakes==0.8.1
pyzmq==14.4.1
scipy==0.14.0
six==1.8.0
sphinx-bootstrap-theme==0.4.3
tox==1.8.1
virtualenv==1.11.6
EricFromCanada commented 9 years ago

The theme.conf needs to have bootswatch_theme = "" and not be overridden in conf.py, and use make clean html to generate a fresh build, which reproduced the issue in the demo for me. Maybe it's an issue in Jinja2?

$ python --version
Python 3.4.2
$ pip freeze
Babel==1.3
Jinja2==2.7.3
MarkupSafe==0.23
-e hg+https://bitbucket.org/birkenfeld/pygments-main@a7ce21fe5e0738934b6a2363884ba896a9a5e823#egg=Pygments-dev
-e hg+https://bitbucket.org/birkenfeld/sphinx@2418c906a8728dc4051d4231b9d752f02d86022a#egg=Sphinx-dev
breathe==3.2.0
docutils==0.12
nose==1.3.4
pytz==2014.9
restview==2.1.2dev
six==1.8.0
snowballstemmer==1.2.0
sphinxcontrib-lassodomain==0.3
ryan-roemer commented 9 years ago

@EricFromCanada / @peteut -- I've got:

Babel==1.3
Fabric==1.6.0
Jinja2==2.7.3
MarkupSafe==0.23
Pygments==2.0.1
## FIXME: could not find svn URL in dependency_links for this package:
Sphinx==1.3b2dev-20141130
docutils==0.12
ecdsa==0.10
paramiko==1.12.2
pycrypto==2.6.1
pytz==2014.10
six==1.8.0
snowballstemmer==1.2.0
wsgiref==0.1.2

So same version of Jinja2, but I'm using Python 2.7.5. I'll make a new virtualenv with Python 3.4.2 today and try that for a repro. Thanks!

ryan-roemer commented 9 years ago

Yep finally confirmed in Py3. I'm working on a solution (per your open PR). Thanks!

ryan-roemer commented 9 years ago

Fixed in #119

ryan-roemer commented 9 years ago

Fix released in https://pypi.python.org/pypi/sphinx-bootstrap-theme/0.4.4