Skip to content

How to create epub ? #6485

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

Closed
rdbeni0 opened this issue Apr 18, 2016 · 8 comments
Closed

How to create epub ? #6485

rdbeni0 opened this issue Apr 18, 2016 · 8 comments

Comments

@rdbeni0
Copy link

rdbeni0 commented Apr 18, 2016

Hi, i want to "make epub" for my Kindle eBook reader.

git clone https://github.com/symfony/symfony-docs
(...)
cd symfony-docs
make epub

and the output is:

sphinx-build -b epub -d _build/doctrees   . _build/epub
Running Sphinx v1.4.1
making output directory...

Extension error:
Could not import extension sensio.sphinx.refinclude (exception: No module named sensio.sphinx.refinclude)
Makefile:94: recipe for target 'epub' failed
make: *** [epub] Error 1

how can i install "sensio.sphinx.refinclude" ?

@javiereguiluz
Copy link
Member

You need to install https://github.com/fabpot/sphinx-php first.

@rdbeni0
Copy link
Author

rdbeni0 commented Apr 19, 2016

sudo pip install git+https://github.com/fabpot/sphinx-php.git
(...)
cd symfony-docs
make epub

and the output is:

sphinx-build -b epub -d _build/doctrees   . _build/epub
Running Sphinx v1.4.1
making output directory...
WARNING: while setting up extension sensio.sphinx.codeblock: directive 'code-block' is already registered, it will be overridden
WARNING: while setting up extension sensio.sphinx.codeblock: directive 'sourcecode' is already registered, it will be overridden
A Translator for the html builder is changed.
WARNING: The config value `api_url' has type `str', defaults to `dict.'
loading pickled environment... not yet created
building [mo]: targets for 0 po files that are out of date
building [epub]: targets for 474 source files that are out of date
updating environment: 474 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 "/home/collector1871/DL/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 /tmp/sphinx-err-fvDgnC.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!
Makefile:94: recipe for target 'epub' failed
make: *** [epub] Error 1

and what now ?
_build/epub is empty

@stof
Copy link
Member

stof commented Apr 19, 2016

you need to use Sphinx 1.3, not 1.4.

@rdbeni0
Copy link
Author

rdbeni0 commented Apr 19, 2016

ok, so i am trying :

pip uninstall sphinx-php
(...)
pip show sphinx |grep "Version:"

output is:

(...)
Version: 1.4.1

So this is bad version... hmmm meaby:

pip install 'sphinx==1.3'

output:

(...) Successfully installed sphinx-1.3 sphinx-rtd-theme-0.1.9

and now:

pip install git+https://github.com/fabpot/sphinx-php.git
(...)
cd symfony-docs
make epub

output:

sphinx-build -b epub -d _build/doctrees   . _build/epub
Running Sphinx v1.3
A Translator for the html builder is changed.
loading pickled environment... not yet created
building [mo]: targets for 0 po files that are out of date
building [epub]: targets for 474 source files that are out of date
updating environment: 474 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 /home/collector1871/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 /tmp/sphinx-err-XtudJI.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!
Makefile:94: recipe for target 'epub' failed
make: *** [epub] Error 1

:(

@stof
Copy link
Member

stof commented Apr 19, 2016

that looks weird

@rdbeni0
Copy link
Author

rdbeni0 commented Apr 19, 2016

Hm... i am reading this:
#5707
this is the same problem.

Ok, so i am going go to try in another way:
pdf optimization with this tool : http://www.willus.com/k2pdfopt/

it seems that "make epub" is broken :(

@javiereguiluz
Copy link
Member

I'm closing this as a duplicate of #5707 which is already being fixed in #7347.

@SofianeBoumedine
Copy link

I encountered this issues to generate HTML or Epub with sphinx on W10.
The same error as you.

  • in conf.py you can remove sensio extensions not essential.

extensions = ['sphinx.ext.autodoc', 'sphinx.ext.doctest', 'sphinx.ext.todo',
    'sensio.sphinx.refinclude', 'sensio.sphinx.configurationblock', 'sensio.sphinx.phpcode']
  • And in your format.rst or other file where it's stipulate sension you can comment these line.

  • Relaunch your cmd and it will generate the build

  • However if you need sensio you can use that : https://github.com/fabpot/sphinx-php

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants