Skip to content

Commit 1683f9f

Browse files
committed
updated epub exmaple
1 parent e8417e0 commit 1683f9f

15 files changed

Lines changed: 46 additions & 23 deletions

File tree

de.vogella.docbook.first/buildepub.xml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<property name="output.dir" value="output" />
1717
<property name="docbook.xsl.dir" value="docbook-xsl-1.76.1" />
1818

19-
<property name="epub.stylesheet" value="${docbook.xsl.dir}/epub/docbook.xsl" />
19+
<property name="epub.stylesheet" value="mystylesheets/mymobidocbook.xsl" />
2020

2121
<property name="{destfilename}" value="book" />
2222

@@ -25,7 +25,7 @@
2525
<pathelement location="lib/saxon.jar" />
2626
</path>
2727

28-
<property name="epubcheck.jar" value="lib/epubcheck-1.2.jar" />
28+
<property name="epubcheck.jar" value="lib/epubcheck/epubcheck-1.2.jar" />
2929
<!--
3030
- target: usage
3131
-->
@@ -74,7 +74,8 @@
7474
-->
7575
<target name="build-epub" depends="clean, depends" description="Generates EPUB files from DocBook XML">
7676

77-
<xslt style="${epub.stylesheet}" extension=".html" basedir="${input.dir}" destdir="${output.dir}/tmp">
77+
<xslt style="${epub.stylesheet}" extension=".html"
78+
basedir="${input.dir}" destdir="${output.dir}/tmp">
7879
<include name="**/*book.xml" />
7980
<param name="epub.stylesheet" expression="style.css" />
8081
<!-- The following parameter do not work currently
@@ -113,12 +114,13 @@
113114
<delete dir="./OEBPS" />
114115
<delete dir="./META-INF" />
115116

116-
<!-- epub check does currently not work as it does not find its dependent libraries
117-
<epub.check epub="${destfilename}" />
117+
<!-- Make sure the epubcheck lib has a subfolder lib with saxon.jar and jing.jar in it
118118
-->
119+
<epub.check epub="book" />
120+
119121
</target>
120122

121-
<!-- epub check does currently not work -->
123+
<!-- epub check macro definition -->
122124
<macrodef name="epub.check" description="Check an epub">
123125
<attribute name="epub" description="Name of the EPUB" />
124126
<sequential>

de.vogella.docbook.first/input/book.xml

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,26 @@
99
<firstname>Lars</firstname>
1010
<surname>Vogel</surname>
1111
</author>
12+
<volumenum>1234</volumenum>
1213
</bookinfo>
1314

1415
<chapter>
1516
<title>This is the first chapter</title>
1617
<section>
1718
<title> First section in the chapter</title>
18-
<para>Random text.
19+
<para> Test</para>
20+
<section>
21+
<title> First sub section </title>
22+
<para> Subsection1</para>
23+
</section>
24+
<section>
25+
<title> second sub section </title>
26+
<para> Subsection2</para>
27+
</section>
28+
</section>
29+
<section>
30+
<title> Second section in the chapter</title>
31+
<para>Other random text
1932
</para>
2033
<para>
2134
<mediaobject>
@@ -29,11 +42,6 @@
2942
</mediaobject>
3043
</para>
3144
</section>
32-
<section>
33-
<title> Second section in the chapter</title>
34-
<para>Other random text
35-
</para>
36-
</section>
3745

3846
</chapter>
3947

-270 KB
Binary file not shown.

de.vogella.docbook.first/docbook-xsl-mystylesheets/myhtmldocbook.xsl renamed to de.vogella.docbook.first/mystylesheets/myhtmldocbook.xsl

File renamed without changes.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?xml version='1.0'?>
2+
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
3+
<xsl:import href="../docbook-xsl-1.76.1/epub/docbook.xsl"/>
4+
<xsl:template match="orderedlist/listitem/para
5+
[count(preceding-sibling::*) = 0 and count(following-sibling::*) =
6+
0]">
7+
<xsl:apply-templates/>
8+
</xsl:template>
9+
<xsl:template match="itemizedlist/listitem/para
10+
[count(preceding-sibling::*) = 0 and count(following-sibling::*) =
11+
0]">
12+
<xsl:apply-templates/>
13+
</xsl:template>
14+
</xsl:stylesheet>
104 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
104 Bytes
Binary file not shown.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
22
<!DOCTYPE html
33
PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
4-
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Docbook Book Example</title><meta name="generator" content="DocBook XSL Stylesheets V1.76.1"/></head><body><h1>Docbook Book Example</h1><div class="toc"><p><strong>Table of Contents</strong></p><dl><dt><span class="chapter"><a href="ch01.html">1. This is the first chapter</a></span></dt><dd><dl><dt><span class="section"><a href="ch01.html#d0e15"> First section in the chapter</a></span></dt><dt><span class="section"><a href="ch01s02.html"> Second section in the chapter</a></span></dt></dl></dd><dt><span class="chapter"><a href="ch02.html">2. This is the second chapter</a></span></dt><dd><dl><dt><span class="section"><a href="ch02.html#d0e37"> My Title</a></span></dt><dt><span class="section"><a href="ch02s02.html"> Other title</a></span></dt></dl></dd></dl></div></body></html>
4+
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Docbook Book Example</title><meta name="generator" content="DocBook XSL Stylesheets V1.76.1"/></head><body><h1>Docbook Book Example</h1><div class="toc"><p><strong>Table of Contents</strong></p><dl><dt><span class="chapter"><a href="ch01.html">1. This is the first chapter</a></span></dt><dd><dl><dt><span class="section"><a href="ch01.html#d0e17"> First section in the chapter</a></span></dt><dd><dl><dt><span class="section"><a href="ch01.html#d0e22"> First sub section </a></span></dt><dt><span class="section"><a href="ch01.html#d0e27"> second sub section </a></span></dt></dl></dd><dt><span class="section"><a href="ch01s02.html"> Second section in the chapter</a></span></dt></dl></dd><dt><span class="chapter"><a href="ch02.html">2. This is the second chapter</a></span></dt><dd><dl><dt><span class="section"><a href="ch02.html#d0e49"> My Title</a></span></dt><dt><span class="section"><a href="ch02s02.html"> Other title</a></span></dt></dl></dd></dl></div></body></html>
Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
22
<!DOCTYPE html
33
PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
4-
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Chapter 1. This is the first chapter</title><meta name="generator" content="DocBook XSL Stylesheets V1.76.1"/></head><body><div class="chapter" title="Chapter 1. This is the first chapter"><div class="titlepage"><div><div><h1 class="title"><a id="d0e12"/>Chapter 1. This is the first chapter</h1></div></div></div><div class="section" title="First section in the chapter"><div class="titlepage"><div><div><h1 class="title"><a id="d0e15"/> First section in the chapter</h1></div></div></div><p>Random text.
5-
</p><p>
6-
</p><div class="mediaobject"><img src="images/vogella_current_logo.png" alt=""/></div><p>
7-
</p></div></div></body></html>
4+
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Chapter 1. This is the first chapter</title><meta name="generator" content="DocBook XSL Stylesheets V1.76.1"/></head><body><div class="chapter" title="Chapter 1. This is the first chapter"><div class="titlepage"><div><div><h1 class="title"><a id="d0e14"/>Chapter 1. This is the first chapter</h1></div></div></div><div class="section" title="First section in the chapter"><div class="titlepage"><div><div><h1 class="title"><a id="d0e17"/> First section in the chapter</h1></div></div></div><p> Test</p><div class="section" title="First sub section"><div class="titlepage"><div><div><h2 class="title"><a id="d0e22"/> First sub section </h2></div></div></div><p> Subsection1</p></div><div class="section" title="second sub section"><div class="titlepage"><div><div><h2 class="title"><a id="d0e27"/> second sub section </h2></div></div></div><p> Subsection2</p></div></div></div></body></html>

0 commit comments

Comments
 (0)