]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
Docs: use the base layout when mako_layout=='epub'
authorhiaselhans <simon@booya.at>
Sat, 6 Sep 2014 11:32:58 +0000 (13:32 +0200)
committerMike Bayer <mike_mp@zzzcomputing.com>
Sun, 7 Sep 2014 21:39:42 +0000 (17:39 -0400)
  - https://readthedocs.org/projects/sqlalchemy/downloads/epub/latest/ renders with the full template which is unreadable on e-readers
  - in the makefile the template-variable mako_layout is set for target: epub which makes mako use only the base layout.
  - this is the more elegant solution as proposed to #133

doc/build/Makefile
doc/build/templates/layout.mako

index 328fa513fd88df924352f6eae587ab8e8051ca01..80d9796d417498f52d2d5bb99bf8618e51f58a9c 100644 (file)
@@ -100,7 +100,7 @@ devhelp:
        @echo "# devhelp"
 
 epub:
-       $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
+       $(SPHINXBUILD) -b epub -A mako_layout=epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
        @echo
        @echo "Build finished. The epub file is in $(BUILDDIR)/epub."
 
index db4da839923c8caf9b90c0352aeebb79095a3bf6..99ce9d753a1c4be6a528cd970928060a2a21ffb9 100644 (file)
 
 <%inherit file="${context['base']}"/>
 
+<%
+    if mako_layout == 'epub':
+        next.body()
+        return
+%>
+
+
 <%
 withsidebar = bool(toc) and current_page_name != 'index'
 %>