I want to use the Readability theme for my Sphinx, which is available here. However, when I tried to use this theme by modifying my conf.py
file as suggested in the instructions, it shows this error when doing make html
:
sphinx-build -b html -d build/doctrees source build/html
Running Sphinx v1.3.1
loading pickled environment... done
Theme error:
no theme named 'readability' found (missing theme.conf?)
make: *** [html] Error 1
I see that people have had problems like this before with some other themes as reported in this question. However, in my case the conf.py
file is present there.
UPDATE
I tried the theme inside a virtualenv
, with a newer sphinx
. And it shows this error when doing make html
:
sphinx-build -b html -d build/doctrees source build/html
Running Sphinx v1.3.1
loading pickled environment... done
building [mo]: targets for 0 po files that are out of date
building [html]: targets for 1 source files that are out of date
updating environment: 0 added, 0 changed, 0 removed
looking for now-outdated files... none found
preparing documents... done
writing output... [100%] index
generating indices... genindex
Exception occurred:
File "~/DEVEL/python/sphinx/sphinx2/local/lib/python2.7/site-packages/sphinx/jinja2glue.py", line 159, in get_source
raise TemplateNotFound(template)
TemplateNotFound: readability/layout.html
The full traceback has been saved in /tmp/sphinx-err-q42_PH.log, if you want to report the issue to the developers.
Please also report this if it was a user error, so that a better error message can be provided next time.
A bug report can be filed in the tracker at <https://github.com/sphinx-doc/sphinx/issues>. Thanks!
make: *** [html] Error 1
So I was able to fix this by applying a patch to sphinxtheme-readability. There is also a bug report on this.
Configuration:
My
source/conf.py
looks like this:Patch:
This is the patch I had to apply to
sphinxtheme/__init__.py
:I've also submitted a Pull Request to address this issue.
You can test this out simply by doing:
And visit: http://localhsot:8000/
Explanation: The reason you ran into this issue and where I believe the theme and it's sample configuration is a little broken is because the path is quite wrong. See:
Note the two paths that I printed in
source/conf.py
: