Path: LFS/8.0
Working Copy Root Path: /home/vagrant/LFS/8.0
URL: svn://svn.linuxfromscratch.org/LFS/tags/8.0
Repository Root: svn://svn.linuxfromscratch.org/LFS
Repository UUID: 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689
Revision: 11199
Node Kind: directory
Schedule: normal
Last Changed Author: bdubbs
Last Changed Rev: 11197
Last Changed Date: 2017-02-25 21:53:58 +0000 (Sat, 25 Feb 2017)

Index: LFS/8.0/INSTALL
===================================================================
--- LFS/8.0/INSTALL	(revision 11199)
+++ LFS/8.0/INSTALL	(working copy)
@@ -2,7 +2,7 @@
 
 After downloading the SVN source, there are some things that need to be set up 
 on your computer if you want to convert the XML source into something easier to 
-read (e.g. HTML, TXT, or PDF).  If you are interested in this, then keep 
+read (e.g. HTML, EPUB, TXT, or PDF).  If you are interested in this, then keep 
 reading.  If you are only interested in editing the XML source for re- 
 submission to the lfs-book or lfs-dev mailing lists, then you do not need this 
 document.  Instead, you need to read the LFS Editor's Manual.  See the LFS 
@@ -29,6 +29,14 @@
 
 ------------------------------------------------------------------------------- 
 
+If you want to convert the XML to EPUB, install the above items, and then install
+the following:
+
+* zip
+  - http://www.linuxfromscratch.org/blfs/view/svn/general/zip.html
+
+------------------------------------------------------------------------------- 
+
 If you want to convert the XML to TXT, install the above items, and then install
 the following:
 
@@ -45,3 +53,4 @@
 
 * FOP and JAI
   - http://www.linuxfromscratch.org/blfs/view/svn/pst/fop.html
+
Index: LFS/8.0/Makefile
===================================================================
--- LFS/8.0/Makefile	(revision 11199)
+++ LFS/8.0/Makefile	(working copy)
@@ -26,11 +26,13 @@
   BASEDIR         ?= ~/lfs-book
   PDF_OUTPUT      ?= LFS-BOOK.pdf
   NOCHUNKS_OUTPUT ?= LFS-BOOK.html
+  EPUB_OUTPUT     ?= LFS-BOOK.epub
   DUMPDIR         ?= ~/lfs-commands
 else
   BASEDIR         ?= ~/lfs-systemd
   PDF_OUTPUT      ?= LFS-SYSD-BOOK.pdf
   NOCHUNKS_OUTPUT ?= LFS-SYSD-BOOK.html
+  EPUB_OUTPUT     ?= LFS-SYSD-BOOK.epub
   DUMPDIR         ?= ~/lfs-sysd-commands
 endif
 
@@ -110,6 +112,27 @@
 
 	@echo "Output at $(BASEDIR)/$(NOCHUNKS_OUTPUT)"
 
+epub: validate
+	@echo "Generating HTML/XML for EPUB..."
+	$(Q)if [ ! -e $(BASEDIR) ]; then \
+		mkdir -p $(BASEDIR); \
+	fi;
+	$(Q)mkdir -p $(RENDERTMP)/lfs-epub
+	$(Q)xsltproc --nonet \
+		--output $(RENDERTMP)/lfs-epub/ \
+		stylesheets/lfs-epub.xsl \
+		$(RENDERTMP)/lfs-full.xml
+
+	@echo "Running Tidy..."
+	$(Q)tidy -config tidy.conf $(BASEDIR)/$(EPUB_OUTPUT) || true
+
+	@echo "Generating EPUB file..."
+	$(Q)cd $(RENDERTMP)          && echo "application/epub+zip" >        lfs-epub-mimetype
+	$(Q)cd $(RENDERTMP)          && zip -0Xq   $(BASEDIR)/$(EPUB_OUTPUT) lfs-epub-mimetype
+	$(Q)cd $(RENDERTMP)/lfs-epub && zip -9XqrD $(BASEDIR)/$(EPUB_OUTPUT) *
+
+	@echo "Output at $(BASEDIR)/$(EPUB_OUTPUT)"
+
 tmpdir:
 	@echo "Creating and cleaning $(RENDERTMP)"
 	$(Q)mkdir -p $(RENDERTMP)
Index: LFS/8.0/README
===================================================================
--- LFS/8.0/README	(revision 11199)
+++ LFS/8.0/README	(working copy)
@@ -1,7 +1,7 @@
 LFS Book README
 
 This document is meant to instruct the user on how to convert the book's XML 
-source to other formats (e.g. HTML, PDF, PS and TXT).  First, if you have not 
+source to other formats (e.g. HTML, TXT, PDF, and EPUB). First, if you have not 
 already done so, please read the INSTALL file for instructions on how to install
 the required software.  If you have already completed the steps outlined in the
 INSTALL file, then continue reading for examples how to convert these files into
@@ -32,3 +32,6 @@
 make BASEDIR=/path/to/output/location pdf
 
 
+XML to EPUB:
+------------
+make BASEDIR=/path/to/output/location epub
Index: LFS/8.0/stylesheets/lfs-epub.xsl
===================================================================
--- LFS/8.0/stylesheets/lfs-epub.xsl	(revision 0)
+++ LFS/8.0/stylesheets/lfs-epub.xsl	(working copy)
@@ -0,0 +1,18 @@
+<?xml version='1.0' encoding='ISO-8859-1'?>
+
+<!--
+$LastChangedBy: $
+$Date: $
+-->
+
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                xmlns="http://www.w3.org/1999/xhtml"
+                version="1.0">
+
+    <!-- LFS top-level epub templates. -->
+  <xsl:import href="lfs-xsl/epub.xsl"/>
+
+    <!-- The LFS book type to be processed (lfs, blfs, clfs, or hlfs) -->
+  <xsl:param name="book-type">lfs</xsl:param>
+
+</xsl:stylesheet>

Property changes on: LFS/8.0/stylesheets/lfs-epub.xsl
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/xml
\ No newline at end of property
Index: LFS/8.0/stylesheets/lfs-xsl/epub.xsl
===================================================================
--- LFS/8.0/stylesheets/lfs-xsl/epub.xsl	(revision 0)
+++ LFS/8.0/stylesheets/lfs-xsl/epub.xsl	(working copy)
@@ -0,0 +1,26 @@
+<?xml version='1.0' encoding='ISO-8859-1'?>
+
+<!--
+$LastChangedBy: $
+$Date: $
+-->
+
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                xmlns:fo="http://www.w3.org/1999/XSL/Format"
+                version="1.0">
+
+  <!-- Stylesheet for output used to generate EPUB 
+       Sets global params and include customization stylesheets. -->
+
+  <!-- Upstream EPUB templates. -->
+  <xsl:import href="docbook-xsl-1.78.1/epub/docbook.xsl"/>
+
+  <!-- Including our others customized templates. -->
+  <xsl:include href="common.xsl"/>
+  <xsl:include href="xhtml/lfs-index.xsl"/>
+  <xsl:include href="xhtml/lfs-mixed.xsl"/>
+  <xsl:include href="xhtml/lfs-sections.xsl"/>
+  <xsl:include href="xhtml/lfs-toc.xsl"/>
+  <xsl:include href="xhtml/lfs-xref.xsl"/>
+
+</xsl:stylesheet>

Property changes on: LFS/8.0/stylesheets/lfs-xsl/epub.xsl
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/xml
\ No newline at end of property

