Skip to content

[WIP] ePub generation fixes #7347

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
wants to merge 6 commits into from

Conversation

michaelperrin
Copy link
Contributor

@michaelperrin michaelperrin commented Jan 9, 2017

This PR enables back the generation of ePub files. It fixes #5707 and #6485.

The main problems were due to:

  • A missing reference for templates in the symfonycom extension.
  • Several syntax errors in the HTML files (missing closing tags, lack of quotes on attribute values).

Note that I didn't change the strange need of a double <body> tag (yup, that's really strange, but there must be a reason).

Generating the ePub file can be done with the following command:

make epub

I have tested the generated file in Apple iBooks, and it works fine.

I also removed the changelog from the generated file, as it was making a really big file without any added value. I can put it back if you wish.
EDIT: I put it back for now

I can also squash the commits into one.

index.rst Outdated
.. toctree::
:hidden:

changelog
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like you have to keep this (see the failing build on Travis CI).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was intentional as the generated file contains the whole changelog, which is huge and not really useful. But I'm going to remove it for now, and we can decide later if it is relevant to keep it.

* Add missing `</div>` closing tag.
* Add missing quotes for attributes.
* Add missing `</body>` closing tag.

These syntax errors were causing errors in Apple iBooks when opening generated ePub files.
@michaelperrin
Copy link
Contributor Author

@xabbuh I removed the changelog removal (!) for now.

@sepehr
Copy link

sepehr commented Jan 26, 2017

Would love to see this merged. Big thanks, @michaelperrin.

@michaelperrin
Copy link
Contributor Author

Thanks @sepehr . The generated ePub file could be better, but this PR can't do any harm anyway as it basically fixes HTML issues is the docs (missing closing tags, missing quotes for HTML attributes, etc.).

@sepehr
Copy link

sepehr commented Jan 28, 2017

Yeah, even with these fixes, there are a lot of problems with the generated epub. epubcheck throws a lot of errors. And the Google Play Books app cannot parse the epub even though it seems to be working with Apple's iBook.

@michaelperrin, Is there any chance that you have working compiled epub of Symfony 3.x docs? If so, I'd be grateful if you share it.

@michaelperrin
Copy link
Contributor Author

@sepehr I didn't know the epubcheck tool and there are indeed a huge amount of errors in the generated file! I'll have a look at it but I think it needs a lot of work to make all the changes...

@michaelperrin michaelperrin changed the title ePub generation fixes [WIP] ePub generation fixes Jan 28, 2017
Michaël Perrin added 3 commits January 28, 2017 15:40
I don’t see the reason why double `<body>` tags were needed. I am removing them for now.
Useful for ePub generation, that makes use of XHTML files.
@javiereguiluz
Copy link
Member

@michaelperrin I'm sorry we didn't merge this on time. If you could rebase it, I'd merge it quickly. I guess there will be still some issues in the generated ePub, but as you said, there are too many to fix them all. the work you did here is good enough to fix some things. Thank you.

@javiereguiluz
Copy link
Member

Let's close this one because we have problems even to generate HTML and PDF ... so we can't dedicate resources to a new format. I'm sorry.

@michaelperrin
Copy link
Contributor Author

@javiereguiluz Yep, better closing it indeed.
If needed, I can make the changes in an other PR to fix the few issues as you requested.

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

Successfully merging this pull request may close these issues.

5 participants