Skip to content
Browse files

[HHFG/epub] Build is now working.

  • Loading branch information...
1 parent 242f4ba commit 337ad3365e6b375ecb34492954a7b37da960e7b6 @shlomif committed Apr 10, 2013
Showing with 58 additions and 39 deletions.
  1. +4 −1 HHFG/text/Makefile
  2. +2 −37 HHFG/text/docbook-epub-preproc.xslt
  3. +51 −0 HHFG/text/docbook-to-docbook.xslt
  4. +1 −1 HHFG/text/epub-build.bash
View
5 HHFG/text/Makefile
@@ -106,7 +106,7 @@ EPUB_SCRIPT = $(XSL_SNAPSHOT_HOME)/epub/bin/dbtoepub
$(ENG_EPUB) : $(ENG_DB_PROCESSED) $(ENG_EPUB_XSLT)
$(JING) $<
- ruby -s $(EPUB_SCRIPT) -s $(ENG_EPUB_XSLT) -o $@ $(ENG_DB_PROCESSED)
+ ruby $(EPUB_SCRIPT) -s $(ENG_EPUB_XSLT) -o $@ $(ENG_DB_PROCESSED)
$(DOCS_FICTION_HTML_FOR_OOO): %.for-openoffice.html: %.xhtml
cat $< | perl -lne 's{(</title>)}{$${1}<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />}; print unless m{\A<\?xml}' > $@
@@ -147,3 +147,6 @@ $(EPUB_GEN_BUG_ARC): $(EPUB_GEN_BUG_FILES)
cp $(EPUB_GEN_BUG_FILES) $(EP)/
zip -r $(EPUB_GEN_BUG_ARC) $(EP)
rm -fr ./$(EP)
+
+epub_gen_bug_upload: epub_gen_bug
+ rsync -v --progress -a $(EPUB_GEN_BUG_ARC) $${__HOMEPAGE_REMOTE_PATH}/temp-db5-epub/
View
39 HHFG/text/docbook-epub-preproc.xslt
@@ -6,44 +6,9 @@
xmlns:xlink="http://www.w3.org/1999/xlink"
>
- <xsl:import href="epub/docbook.xsl" />
+ <xsl:import href="http://docbook.sourceforge.net/release/xsl-ns/current/epub/docbook.xsl" />
-<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"
- />
-
-<xsl:template match="*">
- <xsl:choose>
- <xsl:when test="local-name() = 'legalnotice'">
- <legalnotice>
- <xsl:copy-of select="@*"/>
- <xsl:call-template name="nc_legal_notice" />
- </legalnotice>
- </xsl:when>
- <xsl:otherwise>
- <xsl:element name="{local-name()}">
- <xsl:copy-of select="@*" />
- <xsl:apply-templates />
- </xsl:element>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-<xsl:template name="nc_legal_notice">
- <para>
- This document is copyrighted by Shlomi Fish
- under the
- <link xlink:href="http://creativecommons.org/licenses/by-nc-sa/3.0/">Creative
- Commons Attribution
- Noncommercial Share-Alike (Unported) License (CC-by-nc-sa) version
- 3.0</link>
- (or at your option, any greater version).
- </para>
- <para>
- Note that the original text of the story and its DocBook source is
- under "CC-by-sa", but the author relicensed the final EPUB to
- "CC-by-nc-sa" upon publishing.
- </para>
-</xsl:template>
+ <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no" />
<!-- Get rid of the revhistory element -->
<xsl:template match="d:revhistory" mode="titlepage.mode" />
View
51 HHFG/text/docbook-to-docbook.xslt
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="utf-8"?>
+<xsl:stylesheet version="1.0"
+ xmlns="http://docbook.org/ns/docbook"
+ xmlns:d="http://docbook.org/ns/docbook"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ >
+
+ <xsl:import href="epub/docbook.xsl" />
+
+<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"
+ />
+
+<xsl:template match="*">
+ <xsl:choose>
+ <xsl:when test="local-name() = 'legalnotice'">
+ <legalnotice>
+ <xsl:copy-of select="@*"/>
+ <xsl:call-template name="nc_legal_notice" />
+ </legalnotice>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:element name="{local-name()}">
+ <xsl:copy-of select="@*" />
+ <xsl:apply-templates />
+ </xsl:element>
+ </xsl:otherwise>
+ </xsl:choose>
+</xsl:template>
+
+<xsl:template name="nc_legal_notice">
+ <para>
+ This document is copyrighted by Shlomi Fish
+ under the
+ <link xlink:href="http://creativecommons.org/licenses/by-nc-sa/3.0/">Creative
+ Commons Attribution
+ Noncommercial Share-Alike (Unported) License (CC-by-nc-sa) version
+ 3.0</link>
+ (or at your option, any greater version).
+ </para>
+ <para>
+ Note that the original text of the story and its DocBook source is
+ under "CC-by-sa", but the author relicensed the final EPUB to
+ "CC-by-nc-sa" upon publishing.
+ </para>
+</xsl:template>
+
+<!-- Get rid of the revhistory element -->
+<xsl:template match="d:revhistory" mode="titlepage.mode" />
+
+</xsl:stylesheet>
View
2 HHFG/text/epub-build.bash
@@ -1,2 +1,2 @@
#!/bin/bash
-ruby -s /home/shlomif/Download/unpack/file/docbook/docbook-xsl-ns-snapshot/epub/bin/dbtoepub -s docbook-epub-preproc.xslt -o human-hacking-field-guide--english.epub human-hacking-field-guide--english.db5.xml
+ruby /home/shlomif/Download/unpack/file/docbook/docbook-xsl-ns-snapshot/epub/bin/dbtoepub -s "$(pwd)/docbook-epub-preproc.xslt" -o human-hacking-field-guide--english.epub human-hacking-field-guide--english.db5.xml

0 comments on commit 337ad33

Please sign in to comment.
Something went wrong with that request. Please try again.