-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Epub: TemplateAssertionError: no test named 'index' (2.8) #5707
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I have the same problem building the epub. In the meantime you can comment |
The This is done in the HTMLTranslator class, which of course isn't used by the epub builder. For some reason though, the epub builder tries to use the new symfony.com theme. I'll look for a way to extract the code from the HTMLTranslator to a more generic class, not very confident if it's possible though (as the current code already is kind of a hack). |
Any news regarding that one? I'm still not able to create an epub file. Error message: I have updated all needed extensions. |
Same issue here with v 3.0 docs. Current proposed solution: Like @AndoniZubimendi said, we can comment It's something dirty, but it's the only way I could successfully make an epub without digging in the whys —I have NO experience with Sphinx, sorry. diff --git i/conf.py w/conf.py
index e7c6b9d..8d838e2 100644
--- i/conf.py
+++ w/conf.py
@@ -39,7 +39,7 @@ extensions = [
]
# Add any paths that contain templates here, relative to this directory.
-templates_path = ['_theme/_templates']
+#templates_path = ['_theme/_templates']
# The suffix of source filenames.
source_suffix = '.rst' Platform:
Steps: bash
bash-4.3$ bash --version
GNU bash, version 4.3.42(1)-release (x86_64-apple-darwin14.5.0)
// ...
bash-4.3$ mkvirtualenv foo
bash-4.3$ lsvirtualenv
// (some virtualenvs, foo is now part of it)
bash-4.3$ workon foo
(foo)bash-4.3$ python -V
Python 2.7.10
(foo)bash-4.3$ pip list
pip (7.1.2)
setuptools (18.2)
wheel (0.24.0)
(foo)bash-4.3$ pip install sphinx~=1.3 git+https://github.com/fabpot/sphinx-php.git
Collecting git+https://github.com/fabpot/sphinx-php.git
Cloning https://github.com/fabpot/sphinx-php.git to /var/folders/yd/nd6ys6x17qlgrnbs91l0jgmw0000gn/T/pip-T5_PRN-build
Collecting sphinx~=1.3
Using cached Sphinx-1.3.3-py2.py3-none-any.whl
Collecting babel!=2.0,>=1.3 (from sphinx~=1.3)
Using cached Babel-2.2.0-py2.py3-none-any.whl
Collecting snowballstemmer>=1.1 (from sphinx~=1.3)
Using cached snowballstemmer-1.2.1-py2.py3-none-any.whl
Collecting sphinx-rtd-theme<2.0,>=0.1 (from sphinx~=1.3)
Using cached sphinx_rtd_theme-0.1.9-py2-none-any.whl
Collecting six>=1.4 (from sphinx~=1.3)
Using cached six-1.10.0-py2.py3-none-any.whl
Collecting Pygments>=2.0 (from sphinx~=1.3)
Downloading Pygments-2.0.2-py2-none-any.whl (672kB)
100% |████████████████████████████████| 675kB 650kB/s
Collecting docutils>=0.11 (from sphinx~=1.3)
Downloading docutils-0.12.tar.gz (1.6MB)
100% |████████████████████████████████| 1.6MB 290kB/s
Collecting Jinja2>=2.3 (from sphinx~=1.3)
Downloading Jinja2-2.8-py2.py3-none-any.whl (263kB)
100% |████████████████████████████████| 266kB 1.6MB/s
Collecting alabaster<0.8,>=0.7 (from sphinx~=1.3)
Using cached alabaster-0.7.7-py2.py3-none-any.whl
Collecting pytz>=0a (from babel!=2.0,>=1.3->sphinx~=1.3)
Using cached pytz-2015.7-py2.py3-none-any.whl
Collecting MarkupSafe (from Jinja2>=2.3->sphinx~=1.3)
Downloading MarkupSafe-0.23.tar.gz
Building wheels for collected packages: docutils, MarkupSafe
Running setup.py bdist_wheel for docutils
Stored in directory: /Users/renoirb/Library/Caches/pip/wheels/d5/32/4f/1347e8ac67071e8150a5dc69354a51a04ac065d0b48334f608
Running setup.py bdist_wheel for MarkupSafe
Stored in directory: /Users/renoirb/Library/Caches/pip/wheels/94/a7/79/f79a998b64c1281cb99fa9bbd33cfc9b8b5775f438218d17a7
Successfully built docutils MarkupSafe
Installing collected packages: pytz, babel, snowballstemmer, sphinx-rtd-theme, six, Pygments, docutils, MarkupSafe, Jinja2, alabaster, sphinx, sphinx-php
Running setup.py install for sphinx-php
Successfully installed Jinja2-2.8 MarkupSafe-0.23 Pygments-2.0.2 alabaster-0.7.7 babel-2.2.0 docutils-0.12 pytz-2015.7 six-1.10.0 snowballstemmer-1.2.1 sphinx-1.3.3 sphinx-php-1.0 sphinx-rtd-theme-0.1.9
make epub with output sphinx-build -b epub -d _build/doctrees . _build/epub
Running Sphinx v1.3.3
A Translator for the html builder is changed.
loading pickled environment... done
building [mo]: targets for 0 po files that are out of date
building [epub]: targets for 467 source files that are out of date
updating environment: [config changed] 467 added, 0 changed, 0 removed
reading sources... [100%] reference/twig_reference
looking for now-outdated files... none found
pickling environment... done
checking consistency... done
preparing documents... done
writing output... [ 0%] best_practices/business-logic
Exception occurred:
File "/Users/renoirb/workspaces/sandbox/symfony-docs/symfony-docs/_theme/_templates/layout.html", line 6, in <module>
{% set isIndex = pagename is index %}
TemplateAssertionError: no test named 'index'
The full traceback has been saved in /var/folders/yd/SOMETHING_RANDOM/T/sphinx-err-SOMETHING_RANDOM.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: *** [epub] Error 1 When I
|
After some more debugging, it seems that Either we find a way to adjust epub build options to work with Sphinx default, OR... Find a way to do the same with Sphinx’s I have no idea how to make Sphinx do this. |
I abandoned. Sorry about that. |
Unfortunately I am not much of help here too. Since we have the integration with platform.sh I no longer build the documentation locally and didn't invest much time to find a solution for this. |
Ok, it's not that important. I just wanted a cool way to have the docs on my kindle but I can live without it ^^ |
I know it's not so nice. In the past I used the PDF documents on Kindle readers too. It's not the best option but it is acceptable. Maybe that works for you too. |
I could manage to generate the ePub file, adding a line to the I have a few issues with the generated ePub file (but I could understand the reasons, and will have a look at it). I will open a PR if I manage to solve the remaining problems and if you think it can be useful. |
I'm closing this because we don't provide support for generating docs in ePub format. But you can keep discussing about this in #7347 if you want. Thanks! |
I get error below while trying to generate epub file:
Any hints regarding that?
The text was updated successfully, but these errors were encountered: