From a8ef876f6c30273da55c727c315f16f01ffc3abc Mon Sep 17 00:00:00 2001 From: hiaselhans Date: Sat, 6 Sep 2014 13:32:58 +0200 Subject: Docs: use the base layout when mako_layout=='epub' - 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 | 2 +- doc/build/templates/layout.mako | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'doc/build') diff --git a/doc/build/Makefile b/doc/build/Makefile index 328fa513f..80d9796d4 100644 --- a/doc/build/Makefile +++ b/doc/build/Makefile @@ -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." diff --git a/doc/build/templates/layout.mako b/doc/build/templates/layout.mako index db4da8399..99ce9d753 100644 --- a/doc/build/templates/layout.mako +++ b/doc/build/templates/layout.mako @@ -31,6 +31,13 @@ <%inherit file="${context['base']}"/> +<% + if mako_layout == 'epub': + next.body() + return +%> + + <% withsidebar = bool(toc) and current_page_name != 'index' %> -- cgit v1.2.1