Skip to content
This repository was archived by the owner on May 24, 2018. It is now read-only.

Commit 3e11925

Browse files
committed
Fix epub generation
- Need to run generated epub through Calibre's `ebook-convert` tool to create a cross-platform version of the epub. Added a dependency in the `Makefile` to ensure that we have the utility before attempting to build the epub, and the `epub` target now passes the Sphinx-generated through `ebook-convert`.
1 parent 23c0958 commit 3e11925

File tree

2 files changed

+37
-6
lines changed

2 files changed

+37
-6
lines changed

README.md

Lines changed: 28 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
### Welcome to the *Zend Framework 2* documentation
1+
# Welcome to the *Zend Framework 2* documentation
22

33
## RELEASE INFORMATION
44

55
This documentation is based on *Zend Framework 2* (master branch)
66

77

8-
### VIEW THE DOCUMENTATION ONLINE
8+
## VIEW THE DOCUMENTATION ONLINE
99

1010
We used the [readthedocs.org](http://readthedocs.org/) project to render online the development version of the
1111
documentation of Zend Framework 2.
@@ -16,21 +16,44 @@ You can read the development online documentation in
1616
You can read the last stable documentation in
1717
[http://packages.zendframework.com/docs/latest/manual/en/](http://packages.zendframework.com/docs/latest/manual/en/).
1818

19+
## BUILDING DOCUMENTATION
1920

20-
### CONTRIBUTING
21+
Building the documentation requires [Sphinx](http://sphinx-doc.org/).
22+
23+
Descend into the `docs/` directory, and run `make` with one of the following
24+
targets:
25+
26+
- `epub` - build epub (ebook) documentation (requires
27+
[Calibre](http://calibre-ebook.com/) to build cross-platform epub versions)
28+
- `help` - build Windows help files
29+
- `html` - build HTML documentation
30+
- `info` - build Unix info pages
31+
- `latexpdf` - build PDF documentation (requires a working `latex` toolchain)
32+
- `man` - build Unix manpages
33+
- `text` - build ANSI text manual files
34+
35+
Examples:
36+
37+
```sh
38+
make html
39+
```
40+
41+
You can cleanup by running `make clean`.
42+
43+
## CONTRIBUTING
2144

2245
If you wish to contribute to the documentation of Zend Framework 2, please read the
2346
CONTRIBUTING.md file.
2447

2548
If you don't know where to begin, or where you can best help, please review the
2649
TODO.md file.
2750

28-
### LICENSE
51+
## LICENSE
2952

3053
The files in this archive are released under the Zend Framework license.
3154
You can find a copy of this license in LICENSE.txt.
3255

33-
### ACKNOWLEDGEMENTS
56+
## ACKNOWLEDGEMENTS
3457

3558
The Zend Framework team would like to thank all the [contributors](https://github.com/zendframework/zf2-documentation/contributors) to the Zend
3659
Framework Documentation project, our corporate sponsor, and you, the Zend Framework user.

docs/Makefile

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ PAPER =
88
BUILDDIR = _build
99
LANG = en
1010

11+
CALIBRE ?= ebook-convert
12+
1113
# Internal variables.
1214
PAPEROPT_a4 = -D latex_paper_size=a4
1315
PAPEROPT_letter = -D latex_paper_size=letter
@@ -117,8 +119,14 @@ devhelp: pre-build
117119
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/ZendFramework2"
118120
@echo "# devhelp"
119121

120-
epub: pre-build
122+
CALIBRE_EXISTS:
123+
@which $(CALIBRE) > /dev/null
124+
125+
epub: pre-build CALIBRE_EXISTS
121126
$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
127+
-mv $(BUILDDIR)/epub/ZendFramework2.epub $(BUILDDIR)/epub/ZendFramework2.src.epub
128+
$(CALIBRE) $(BUILDDIR)/epub/ZendFramework2.src.epub $(BUILDDIR)/epub/ZendFramework2.epub
129+
-rm $(BUILDDIR)/epub/ZendFramework2.src.epub
122130
@echo
123131
@echo "Build finished. The epub file is in $(BUILDDIR)/epub."
124132

0 commit comments

Comments
 (0)