You can subscribe to this list here.
| 2007 |
Jan
|
Feb
(5) |
Mar
(107) |
Apr
(77) |
May
(137) |
Jun
(103) |
Jul
(2) |
Aug
(10) |
Sep
(47) |
Oct
(63) |
Nov
(88) |
Dec
(101) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2008 |
Jan
(43) |
Feb
(49) |
Mar
(68) |
Apr
(147) |
May
(44) |
Jun
(11) |
Jul
(29) |
Aug
(1) |
Sep
(28) |
Oct
(51) |
Nov
(22) |
Dec
(29) |
| 2009 |
Jan
(24) |
Feb
(56) |
Mar
(11) |
Apr
(45) |
May
(8) |
Jun
(7) |
Jul
(2) |
Aug
(16) |
Sep
(16) |
Oct
(19) |
Nov
(14) |
Dec
(40) |
| 2010 |
Jan
(24) |
Feb
(3) |
Mar
(18) |
Apr
(5) |
May
(9) |
Jun
(5) |
Jul
|
Aug
(5) |
Sep
(13) |
Oct
(1) |
Nov
(2) |
Dec
(5) |
| 2011 |
Jan
(12) |
Feb
(13) |
Mar
(20) |
Apr
(2) |
May
(24) |
Jun
(17) |
Jul
(8) |
Aug
(10) |
Sep
(19) |
Oct
|
Nov
(5) |
Dec
(5) |
| 2012 |
Jan
(4) |
Feb
|
Mar
(2) |
Apr
(2) |
May
(3) |
Jun
(1) |
Jul
(4) |
Aug
(10) |
Sep
(9) |
Oct
(7) |
Nov
(8) |
Dec
(4) |
| 2013 |
Jan
(5) |
Feb
|
Mar
|
Apr
(2) |
May
|
Jun
|
Jul
(13) |
Aug
(12) |
Sep
(10) |
Oct
|
Nov
(8) |
Dec
(4) |
| 2014 |
Jan
(10) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(4) |
Sep
(3) |
Oct
|
Nov
(2) |
Dec
(1) |
| 2015 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(2) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: <ce...@us...> - 2015-05-11 14:29:21
|
Revision: 2810
http://sourceforge.net/p/daisymfc/code/2810
Author: cegli
Date: 2015-05-11 14:29:18 +0000 (Mon, 11 May 2015)
Log Message:
-----------
Expose bit rate and stereo in the audio encoding taskscript
Modified Paths:
--------------
trunk/dmfc/doc/scripts/DTBAudioEncoder.html
trunk/dmfc/scripts/modify_improve/dtb/DTBAudioEncoder.taskScript
Modified: trunk/dmfc/doc/scripts/DTBAudioEncoder.html
===================================================================
--- trunk/dmfc/doc/scripts/DTBAudioEncoder.html 2015-05-11 14:27:35 UTC (rev 2809)
+++ trunk/dmfc/doc/scripts/DTBAudioEncoder.html 2015-05-11 14:29:18 UTC (rev 2810)
@@ -33,6 +33,11 @@
<dt>Bitrate</dt>
<dd><strong>Optional.</strong> Select the bitrate of the encoded files. Default is 32.</dd>
+ <dt>Stereo</dt>
+ <dd><strong>Optional.</strong> Select wether the files should be encoded in stereo or in mono. Default is mono.</dd>
+
+ <dt>Sampling Rate</dt>
+ <dd><strong>Optional.</strong> Select the sampling rate of the encoded files. Default is 22050.</dd>
</dl>
<h2 id="transformers">Appendix: List of Transformers used</h2>
@@ -42,4 +47,4 @@
</ol>
</body>
-</html>
\ No newline at end of file
+</html>
Modified: trunk/dmfc/scripts/modify_improve/dtb/DTBAudioEncoder.taskScript
===================================================================
--- trunk/dmfc/scripts/modify_improve/dtb/DTBAudioEncoder.taskScript 2015-05-11 14:27:35 UTC (rev 2809)
+++ trunk/dmfc/scripts/modify_improve/dtb/DTBAudioEncoder.taskScript 2015-05-11 14:29:18 UTC (rev 2810)
@@ -28,25 +28,61 @@
<enum>
<item nicename="32" value="32" />
<item nicename="48" value="48" />
+ <item nicename="56" value="56" />
<item nicename="64" value="64" />
+ <item nicename="80" value="80" />
+ <item nicename="96" value="96" />
+ <item nicename="112" value="112" />
<item nicename="128" value="128" />
</enum>
</datatype>
</parameter>
+ <parameter name="stereo" value="mono" required="false">
+ <nicename>Stereo</nicename>
+ <description>The stereo mode of the encoded files</description>
+ <datatype>
+ <enum>
+ <item nicename="Mono" value="mono" />
+ <item nicename="Stereo" value="stereo" />
+ </enum>
+ </datatype>
+ </parameter>
+
+ <parameter name="freq" value="22050" required="false">
+ <nicename>Sampling rate</nicename>
+ <description>The sample rate of the encoded files</description>
+ <datatype>
+ <enum>
+ <item nicename="11025" value="11025" />
+ <item nicename="22050" value="22050" />
+ <item nicename="44100" value="44100" />
+ <item nicename="48000" value="48000" />
+ </enum>
+ </datatype>
+ </parameter>
+
<task name="se_tpb_dtbAudioEncoder" interactive="false">
- <parameter>
- <name>manifest</name>
- <value>${input}</value>
- </parameter>
- <parameter>
- <name>outDir</name>
- <value>${output}</value>
- </parameter>
- <parameter>
- <name>bitrate</name>
- <value>${bitrate}</value>
- </parameter>
+ <parameter>
+ <name>manifest</name>
+ <value>${input}</value>
+ </parameter>
+ <parameter>
+ <name>outDir</name>
+ <value>${output}</value>
+ </parameter>
+ <parameter>
+ <name>bitrate</name>
+ <value>${bitrate}</value>
+ </parameter>
+ <parameter>
+ <name>stereo</name>
+ <value>${stereo}</value>
+ </parameter>
+ <parameter>
+ <name>freq</name>
+ <value>${freq}</value>
+ </parameter>
</task>
</taskScript>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ce...@us...> - 2015-05-11 14:27:37
|
Revision: 2809
http://sourceforge.net/p/daisymfc/code/2809
Author: cegli
Date: 2015-05-11 14:27:35 +0000 (Mon, 11 May 2015)
Log Message:
-----------
Allow more values for the bitrate
Modified Paths:
--------------
trunk/dmfc/transformers/se_tpb_dtbAudioEncoder/transformer.tdf
Modified: trunk/dmfc/transformers/se_tpb_dtbAudioEncoder/transformer.tdf
===================================================================
--- trunk/dmfc/transformers/se_tpb_dtbAudioEncoder/transformer.tdf 2014-12-03 12:54:43 UTC (rev 2808)
+++ trunk/dmfc/transformers/se_tpb_dtbAudioEncoder/transformer.tdf 2015-05-11 14:27:35 UTC (rev 2809)
@@ -29,7 +29,11 @@
<enum>
<value>32</value>
<value>48</value>
+ <value>56</value>
<value>64</value>
+ <value>80</value>
+ <value>96</value>
+ <value>112</value>
<value>128</value>
</enum>
<default>32</default>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <joe...@us...> - 2014-12-03 12:54:46
|
Revision: 2808
http://sourceforge.net/p/daisymfc/code/2808
Author: joeha480
Date: 2014-12-03 12:54:43 +0000 (Wed, 03 Dec 2014)
Log Message:
-----------
Throws an exception if Dotify returns a non-zero exit value
Modified Paths:
--------------
trunk/dmfc/transformers/org_pef_dtbook2pef/DTBook2PEF.java
Modified: trunk/dmfc/transformers/org_pef_dtbook2pef/DTBook2PEF.java
===================================================================
--- trunk/dmfc/transformers/org_pef_dtbook2pef/DTBook2PEF.java 2014-11-04 12:36:41 UTC (rev 2807)
+++ trunk/dmfc/transformers/org_pef_dtbook2pef/DTBook2PEF.java 2014-12-03 12:54:43 UTC (rev 2808)
@@ -103,6 +103,9 @@
} catch (IOException e) {
}
process.waitFor();
+ if (process.exitValue()!=0) {
+ throw new TransformerRunException("Dotify returned a non-zero exit value: " + process.exitValue());
+ }
} catch (IOException e) {
throw new TransformerRunException("Failed to start process.", e);
} catch (InterruptedException e) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <joe...@us...> - 2014-11-04 12:36:50
|
Revision: 2807
http://sourceforge.net/p/daisymfc/code/2807
Author: joeha480
Date: 2014-11-04 12:36:41 +0000 (Tue, 04 Nov 2014)
Log Message:
-----------
Preparing for a coming version of Dotify (work in progress)
Modified Paths:
--------------
trunk/dmfc/transformers/org_pef_dtbook2pef/DTBook2PEF.java
Added Paths:
-----------
trunk/dmfc/test/org_pef_dtbook2pef/
trunk/dmfc/test/org_pef_dtbook2pef/DTBook2PEFTest.java
trunk/dmfc/test/org_pef_dtbook2pef/version
trunk/dmfc/test/org_pef_dtbook2pef/version2
trunk/dmfc/test/org_pef_dtbook2pef/version3
Added: trunk/dmfc/test/org_pef_dtbook2pef/DTBook2PEFTest.java
===================================================================
--- trunk/dmfc/test/org_pef_dtbook2pef/DTBook2PEFTest.java (rev 0)
+++ trunk/dmfc/test/org_pef_dtbook2pef/DTBook2PEFTest.java 2014-11-04 12:36:41 UTC (rev 2807)
@@ -0,0 +1,52 @@
+package org_pef_dtbook2pef;
+
+import static org.junit.Assert.assertEquals;
+
+import java.io.File;
+import java.util.List;
+
+import org.junit.Test;
+
+public class DTBook2PEFTest {
+
+ public DTBook2PEFTest() {
+ // TODO Auto-generated constructor stub
+ }
+
+ @Test
+ public void testDotifyVersion_01() {
+ List<String> version = DTBook2PEF.getDotifyVersion(new File("test/org_pef_dtbook2pef/version"));
+ assertEquals("2", version.get(0));
+ assertEquals("4", version.get(1));
+ assertEquals("0", version.get(2));
+ assertEquals(3, version.size());
+ }
+
+ @Test
+ public void testDotifyVersion_02() {
+ List<String> version = DTBook2PEF.getDotifyVersion(new File("test/org_pef_dtbook2pef/version2"));
+ assertEquals("2", version.get(0));
+ assertEquals("4", version.get(1));
+ assertEquals("1", version.get(2));
+ assertEquals(3, version.size());
+ }
+
+ @Test
+ public void testDotifyVersion_03() {
+ List<String> version = DTBook2PEF.getDotifyVersion(new File("test/org_pef_dtbook2pef/version3"));
+ assertEquals("2", version.get(0));
+ assertEquals("4", version.get(1));
+ assertEquals("1", version.get(2));
+ assertEquals(3, version.size());
+ }
+
+ @Test
+ public void testDotifyVersion_noFile() {
+ List<String> version = DTBook2PEF.getDotifyVersion(new File("test/org_pef_dtbook2pef/version23"));
+ assertEquals("2", version.get(0));
+ assertEquals("0", version.get(1));
+ assertEquals("0", version.get(2));
+ assertEquals(3, version.size());
+ }
+
+}
Added: trunk/dmfc/test/org_pef_dtbook2pef/version
===================================================================
--- trunk/dmfc/test/org_pef_dtbook2pef/version (rev 0)
+++ trunk/dmfc/test/org_pef_dtbook2pef/version 2014-11-04 12:36:41 UTC (rev 2807)
@@ -0,0 +1 @@
+2.4-SNAPSHOT
\ No newline at end of file
Added: trunk/dmfc/test/org_pef_dtbook2pef/version2
===================================================================
--- trunk/dmfc/test/org_pef_dtbook2pef/version2 (rev 0)
+++ trunk/dmfc/test/org_pef_dtbook2pef/version2 2014-11-04 12:36:41 UTC (rev 2807)
@@ -0,0 +1 @@
+2.4.1-SNAPSHOT
\ No newline at end of file
Added: trunk/dmfc/test/org_pef_dtbook2pef/version3
===================================================================
--- trunk/dmfc/test/org_pef_dtbook2pef/version3 (rev 0)
+++ trunk/dmfc/test/org_pef_dtbook2pef/version3 2014-11-04 12:36:41 UTC (rev 2807)
@@ -0,0 +1 @@
+2.4.1
\ No newline at end of file
Modified: trunk/dmfc/transformers/org_pef_dtbook2pef/DTBook2PEF.java
===================================================================
--- trunk/dmfc/transformers/org_pef_dtbook2pef/DTBook2PEF.java 2014-11-04 08:13:53 UTC (rev 2806)
+++ trunk/dmfc/transformers/org_pef_dtbook2pef/DTBook2PEF.java 2014-11-04 12:36:41 UTC (rev 2807)
@@ -2,10 +2,13 @@
import java.io.BufferedReader;
import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
+import java.util.List;
import java.util.Map;
import org.daisy.pipeline.core.InputListener;
@@ -46,7 +49,8 @@
dotifyCliPath = System.getProperty("pipeline.dotify.cli.path");
}
- if (dotifyCliPath == null || !new File(dotifyCliPath).exists()) {
+ File cliPath = new File(dotifyCliPath);
+ if (dotifyCliPath == null || !cliPath.exists()) {
throw new TransformerRunException("Cannot locate Dotify executable at '" + dotifyCliPath + "'. Check your configuration. For more information, see the transformer documentation.");
}
@@ -59,14 +63,21 @@
command.add("-jar");
}
command.add(dotifyCliPath);
- command.add(input.getAbsolutePath());
- command.add(output.getAbsolutePath());
- command.add(setup);
- command.add(locale.toString());
- for (String arg : parameters.keySet()) {
- if (parameters.get(arg) != null) {
- command.add("-" + arg + "=" + parameters.get(arg));
+
+ List<String> version = getDotifyVersion(new File(cliPath.getParentFile(), "version"));
+
+ if ("2".equals(version.get(0))) {
+ command.add(input.getAbsolutePath());
+ command.add(output.getAbsolutePath());
+ command.add(setup);
+ command.add(locale.toString());
+ for (String arg : parameters.keySet()) {
+ if (parameters.get(arg) != null) {
+ command.add("-" + arg + "=" + parameters.get(arg));
+ }
}
+ } else {
+ throw new TransformerRunException("Unsupported major version: " + version.get(0));
}
sendMessage("About to run: " + command.toString());
@@ -103,12 +114,12 @@
}
public static boolean isSupported() {
- double v = getVersion();
+ double v = getJavaVersion();
// System.out.println("Version: " + v);
return v >= 1.6;
}
- static double getVersion() {
+ static double getJavaVersion() {
String[] version = System.getProperty("java.version").split("\\.");
return Double.parseDouble(version[0] + (version.length >= 2 ? "." + version[1] : ""));
}
@@ -117,4 +128,55 @@
isSupported();
}
+ static List<String> getDotifyVersion(File v) {
+ List<String> segments = new ArrayList<String>();
+ if (v.exists()) {
+ FileInputStream is = null;
+ try {
+ is = new FileInputStream(v);
+ int i;
+ StringBuilder sb = new StringBuilder();
+ while ((i = is.read()) > -1) {
+ if (i >= (int) '0' && i <= (int) '9') {
+ sb.append((char) i);
+ } else {
+ if (sb.length() > 0) {
+ segments.add(sb.toString());
+ }
+ sb = new StringBuilder();
+ if (i != (int) '.') {
+ break;
+ }
+ }
+ }
+ if (sb.length() > 0) {
+ segments.add(sb.toString());
+ }
+ } catch (FileNotFoundException e) {
+ e.printStackTrace();
+ } catch (IOException e) {
+ e.printStackTrace();
+ } finally {
+ if (is != null) {
+ try {
+ is.close();
+ } catch (IOException e) {
+ }
+ }
+ }
+ }
+ // add defaults
+ switch (segments.size()) {
+ case 0:
+ segments.add("2");
+ //$FALL-THROUGH$
+ case 1:
+ segments.add("0");
+ //$FALL-THROUGH$
+ case 2:
+ segments.add("0");
+ }
+ return segments;
+ }
+
}
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <joe...@us...> - 2014-11-04 08:13:55
|
Revision: 2806
http://sourceforge.net/p/daisymfc/code/2806
Author: joeha480
Date: 2014-11-04 08:13:53 +0000 (Tue, 04 Nov 2014)
Log Message:
-----------
Fixed so that Dotify cli path is used and also prepared for a coming version of Dotify (work in progress)
Modified Paths:
--------------
trunk/dmfc/transformers/org_pef_dtbook2pef/DTBook2PEF.java
Modified: trunk/dmfc/transformers/org_pef_dtbook2pef/DTBook2PEF.java
===================================================================
--- trunk/dmfc/transformers/org_pef_dtbook2pef/DTBook2PEF.java 2014-09-12 11:54:02 UTC (rev 2805)
+++ trunk/dmfc/transformers/org_pef_dtbook2pef/DTBook2PEF.java 2014-11-04 08:13:53 UTC (rev 2806)
@@ -5,7 +5,6 @@
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
-import java.net.URISyntaxException;
import java.util.ArrayList;
import java.util.Map;
@@ -44,7 +43,6 @@
String dotifyCliPath = parameters.remove("dotifyCliPath");
if (dotifyCliPath == null || "".equals(dotifyCliPath)) {
- System.out.println("HERE");
dotifyCliPath = System.getProperty("pipeline.dotify.cli.path");
}
@@ -52,18 +50,15 @@
throw new TransformerRunException("Cannot locate Dotify executable at '" + dotifyCliPath + "'. Check your configuration. For more information, see the transformer documentation.");
}
- String separator = System.getProperty("file.separator");
- String path = System.getProperty("java.home") + separator + "bin" + separator + "java";
ArrayList<String> command = new ArrayList<String>();
- command.add(path);
- command.add("-jar");
+ if (dotifyCliPath.endsWith(".jar")) {
+ String separator = System.getProperty("file.separator");
+ String path = System.getProperty("java.home") + separator + "bin" + separator + "java";
- try {
- command.add(new File(getClass().getResource("dotify-dist/dotify-cli.jar").toURI()).getAbsolutePath());
- } catch (URISyntaxException e1) {
- throw new TransformerRunException("", e1);
+ command.add(path);
+ command.add("-jar");
}
-
+ command.add(dotifyCliPath);
command.add(input.getAbsolutePath());
command.add(output.getAbsolutePath());
command.add(setup);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ce...@us...> - 2014-09-12 11:54:11
|
Revision: 2805
http://sourceforge.net/p/daisymfc/code/2805
Author: cegli
Date: 2014-09-12 11:54:02 +0000 (Fri, 12 Sep 2014)
Log Message:
-----------
Avoid a NPE when dealing with <a> that do not have neither a href nor
a idref, i.e. are just used as anchors to be able to refer to for
internal links.
Modified Paths:
--------------
trunk/dmfc/transformers/us_rfbd_textOnlyDtbCreator/TextOnlyDtbCreator.java
Modified: trunk/dmfc/transformers/us_rfbd_textOnlyDtbCreator/TextOnlyDtbCreator.java
===================================================================
--- trunk/dmfc/transformers/us_rfbd_textOnlyDtbCreator/TextOnlyDtbCreator.java 2014-09-12 06:35:34 UTC (rev 2804)
+++ trunk/dmfc/transformers/us_rfbd_textOnlyDtbCreator/TextOnlyDtbCreator.java 2014-09-12 11:54:02 UTC (rev 2805)
@@ -966,7 +966,7 @@
}
// Internal links: Add to the list of SMIL links for resolution later
- else {
+ else if (targetAtt != null) {
// We store these in lists keyed under the target string
// (we use lists because a target can have multiple links to it)
List<SmilStructure> ssList;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <joe...@us...> - 2014-09-12 06:35:36
|
Revision: 2804
http://sourceforge.net/p/daisymfc/code/2804
Author: joeha480
Date: 2014-09-12 06:35:34 +0000 (Fri, 12 Sep 2014)
Log Message:
-----------
Updated documentation
Modified Paths:
--------------
trunk/dmfc/doc/enduser/cmd-user-guide.html
Added Paths:
-----------
trunk/dmfc/doc/enduser/installing-dotify.html
Modified: trunk/dmfc/doc/enduser/cmd-user-guide.html
===================================================================
--- trunk/dmfc/doc/enduser/cmd-user-guide.html 2014-09-12 06:30:58 UTC (rev 2803)
+++ trunk/dmfc/doc/enduser/cmd-user-guide.html 2014-09-12 06:35:34 UTC (rev 2804)
@@ -42,6 +42,7 @@
<dt>pipeline.tempDir</dt><dd>Directory to store temporary files in. This directory must be set, and write access to it must be enabled.</dd>
<dt>pipeline.lame.path</dt><dd>Path to the <a href="http://lame.sourceforge.net">LAME</a> executable (Must be set if you intend to run a script that includes MP3 encoding). Further information is available in the <a href="installing-lame.html">LAME installation instructions</a>.</dd>
<dt>pipeline.imageMagick.converter.path</dt><dd>Path to the <a href="http://www.imagemagick.org/">ImageMagick</a> convert executable (Must be set if you intend to run the WordML to DTBook script). Further information is available in the <a href="installing-imagemagick.html">ImageMagick installation instructions</a>.</dd>
+ <dt>pipeline.dotify.cli.path</dt><dd>Path to the <a href="http://code.google.com/p/dotify/">Dotify</a> CLI executable (Must be set if you intend to run the DTBook to PEF script). Further information is available in the <a href="installing-dotify.html">Dotify installation instructions</a>.</dd>
</dl>
<h2 id="execute">Executing Daisy Pipeline</h2>
Added: trunk/dmfc/doc/enduser/installing-dotify.html
===================================================================
--- trunk/dmfc/doc/enduser/installing-dotify.html (rev 0)
+++ trunk/dmfc/doc/enduser/installing-dotify.html 2014-09-12 06:35:34 UTC (rev 2804)
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <title>Installing Dotify for use within the Daisy Pipeline</title>
+ <link rel="stylesheet" type="text/css" href="../pipeline.css" />
+ </head>
+ <body>
+ <h1>Installing Dotify for use within the Daisy Pipeline</h1>
+ <div id="toc" class="toc">
+ <ul>
+ <li>
+ <a href="#install">Installing Dotify</a>
+ </li>
+ <li><a href="#configure">Configuring the Dotify CLI path in the DAISY Pipeline</a></li>
+ </ul>
+ </div>
+
+ <h2 id="install">Installing Dotify</h2>
+
+ <p>Download and install the latest release available on the <a href="http://code.google.com/p/dotify">Dotify website</a></p>
+
+ <h2 id="configure">Configuring the Dotify CLI path in the DAISY Pipeline</h2>
+ <ul>
+ <li>If you are using the Pipeline GUI, go to <code>Windows > Preferences > Paths</code> and make sure that the "dotify-cli.jar" path entry points to the Dotify dotify-cli.jar executable (e.g. <code>C:\Program File\Dotify\dotify-cli.jar</code>)</li>
+ <li>If you are using the Pipeline CommandLine version or have embedded the Pipeline as a component in another system, do the following:
+ <ul>
+ <li>Locate the <code>pipeline.user.properties</code> file by navigating to the Pipeline installation path (e.g. C:\Program Files\Daisy Pipeline\) and find pipeline.user.properties within that directory.</li>
+ <li>Open pipeline.user.properties in an XML or text editor, and make sure that the entry with the key <code>pipeline.dotify.cli.path</code> points to the dotify-cli.jar file.<br />
+ <p>For example, if you installed Dotify to <code>C:\Program File\Dotify\</code>, the resulting element in pipeline.user.properties should read:</p>
+ <pre><code>
+ <entry key="pipeline.dotify.cli.path">C:\Program File\Dotify\dotify-cli.jar</entry>
+ </code></pre>
+ </li>
+ </ul>
+ </li>
+ </ul>
+ </body>
+</html>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <joe...@us...> - 2014-09-12 06:31:02
|
Revision: 2803
http://sourceforge.net/p/daisymfc/code/2803
Author: joeha480
Date: 2014-09-12 06:30:58 +0000 (Fri, 12 Sep 2014)
Log Message:
-----------
Removed embedded Dotify (it should now be installed separately on your system, if you want to use it)
Modified Paths:
--------------
trunk/dmfc/.classpath
trunk/dmfc/META-INF/MANIFEST.MF
trunk/dmfc/build-core.xml
trunk/dmfc/build-deb.xml
trunk/dmfc/build.properties
trunk/dmfc/doc/scripts/DTBookToPEF.html
trunk/dmfc/doc/transformers/org_pef_dtbook2pef.html
trunk/dmfc/src/pipeline.user.properties
trunk/dmfc/transformers/org_pef_dtbook2pef/DTBook2PEF.java
trunk/dmfc/transformers/org_pef_dtbook2pef/transformer.tdf
Added Paths:
-----------
trunk/dmfc/scripts2/
Modified: trunk/dmfc/.classpath
===================================================================
--- trunk/dmfc/.classpath 2014-08-27 10:18:08 UTC (rev 2802)
+++ trunk/dmfc/.classpath 2014-09-12 06:30:58 UTC (rev 2803)
@@ -36,8 +36,6 @@
<classpathentry kind="lib" path="lib/brailleUtils-catalog.jar"/>
<classpathentry kind="lib" path="lib/brailleUtils-core.jar"/>
<classpathentry kind="lib" path="lib/texhyphj.jar"/>
- <classpathentry kind="lib" path="lib/dotify.jar"/>
- <classpathentry kind="lib" path="lib/dotify-translator.jar"/>
<classpathentry kind="lib" path="lib/isorelax.jar"/>
<classpathentry kind="lib" path="lib/jing.jar"/>
<classpathentry kind="lib" path="lib/xml-apis.jar"/>
Modified: trunk/dmfc/META-INF/MANIFEST.MF
===================================================================
--- trunk/dmfc/META-INF/MANIFEST.MF 2014-08-27 10:18:08 UTC (rev 2802)
+++ trunk/dmfc/META-INF/MANIFEST.MF 2014-09-12 06:30:58 UTC (rev 2803)
@@ -15,9 +15,7 @@
lib/chardet.jar,
lib/commons-cli-1.1.jar,
lib/commons-pool-1.4.jar,
- lib/dotify.jar,
- lib/dotify-translator.jar
- lib/epubcheck-3.0.jar,
+ lib/epubcheck-3.0.jar,
lib/icu4j-3_8.jar,
lib/jl1.0.jar,
lib/log4j-1.2.15.jar,
Modified: trunk/dmfc/build-core.xml
===================================================================
--- trunk/dmfc/build-core.xml 2014-08-27 10:18:08 UTC (rev 2802)
+++ trunk/dmfc/build-core.xml 2014-09-12 06:30:58 UTC (rev 2803)
@@ -60,8 +60,6 @@
<include name="zedval.jar"/>
<include name="brailleUtils-core.jar"/>
<include name="brailleUtils-catalog.jar"/>
- <include name="dotify.jar"/>
- <include name="dotify-translator.jar"/>
<include name="texhyphj.jar"/>
</patternset>
Modified: trunk/dmfc/build-deb.xml
===================================================================
--- trunk/dmfc/build-deb.xml 2014-08-27 10:18:08 UTC (rev 2802)
+++ trunk/dmfc/build-deb.xml 2014-09-12 06:30:58 UTC (rev 2803)
@@ -69,8 +69,6 @@
<include name="zedval.jar"/>
<include name="brailleUtils-core.jar"/>
<include name="brailleUtils-catalog.jar"/>
- <include name="dotify.jar"/>
- <include name="dotify-translator.jar"/>
<include name="texhyphj.jar"/>
</data>
<!-- Transformers -->
Modified: trunk/dmfc/build.properties
===================================================================
--- trunk/dmfc/build.properties 2014-08-27 10:18:08 UTC (rev 2802)
+++ trunk/dmfc/build.properties 2014-09-12 06:30:58 UTC (rev 2803)
@@ -38,9 +38,7 @@
lib/brailleUtils-catalog.jar,\
lib/brailleUtils-core.jar,\
lib/louisFat.jar,\
- lib/texhyphj.jar,\
- lib/dotify-translator.jar,\
- lib/dotify.jar
+ lib/texhyphj.jar
bin.excludes = doc/.cvsignore,\
doc/dev_old/,\
scripts/_dev/,\
Modified: trunk/dmfc/doc/scripts/DTBookToPEF.html
===================================================================
--- trunk/dmfc/doc/scripts/DTBookToPEF.html 2014-08-27 10:18:08 UTC (rev 2802)
+++ trunk/dmfc/doc/scripts/DTBookToPEF.html 2014-09-12 06:30:58 UTC (rev 2803)
@@ -80,8 +80,6 @@
<li><a
href="../transformers/int_daisy_validator.html">int_daisy_validator</a></li>
<li><a
- href="../transformers/se_tpb_hyphenator.html">se_tpb_hyphenator</a></li>
- <li><a
href="../transformers/org_pef_dtbook2pef.html">org_pef_dtbook2pef</a></li>
<li><a
href="../transformers/pipeline_system_deleter.html">pipeline_system_deleter</a></li>
Modified: trunk/dmfc/doc/transformers/org_pef_dtbook2pef.html
===================================================================
--- trunk/dmfc/doc/transformers/org_pef_dtbook2pef.html 2014-08-27 10:18:08 UTC (rev 2802)
+++ trunk/dmfc/doc/transformers/org_pef_dtbook2pef.html 2014-09-12 06:30:58 UTC (rev 2803)
@@ -42,11 +42,7 @@
<p>The main purpose of this transformer is to convert DTBook into PEF 2008-1.
However, other input formats as well as other output formats are possible to
-implement within the boundaries of the transformer. In the general case, the
-transformer can convert structural XML into text-oriented display formats, i.e.
-formats that have a fixed width in characters per row. Focus has been on
-braille, specifically braille books, therefore pages, sections and volumes have
-been considered for the programming interfaces. The recommended way to obtain
+within the boundaries of the transformer. The recommended way to obtain
braille formats other than PEF (such as american ascii braille) is to feed the
output from this transformer as input to the <a
href="org_pef_pef2text.html">pef2text</a> transformer.</p>
@@ -54,8 +50,7 @@
<h2 id="inputReqs">Input Requirements</h2>
-<p>A DTBook document. The input document is assumed to have soft hyphen
-characters (U+00AD) at all desired hyphenation points.</p>
+<p>A DTBook document.</p>
<p>A particular conversion setup may have further requirements.</p>
<!-- contract definition: detailed requirements on input nature -->
@@ -112,7 +107,7 @@
</dl>
<h3 id="extConfig">Extended configurability</h3>
-
+<p>To use this transformer, the path to Dotify must be set using the pipeline user properties. Set the "pipeline.dotify.cli.path" to the path to Dotify's dotify-cli.jar.</p>
<p>For extended configurability, see javadoc documentation or <a
href="../../transformers/org_pef_dtbook2pef/package.html">package.html</a></p>
<!-- details on additional config files, system variables etc -->
Modified: trunk/dmfc/src/pipeline.user.properties
===================================================================
--- trunk/dmfc/src/pipeline.user.properties 2014-08-27 10:18:08 UTC (rev 2802)
+++ trunk/dmfc/src/pipeline.user.properties 2014-09-12 06:30:58 UTC (rev 2803)
@@ -16,6 +16,9 @@
<!-- Path to ImageMagick converter installation -->
<entry key="pipeline.imageMagick.converter.path"></entry>
+
+ <!-- Path to Dotify installation -->
+ <entry key="pipeline.dotify.cli.path"></entry>
<!-- Path to sox (Sound eXchange - used on Mac OS X only) -->
<entry key="pipeline.sox.path">/opt/local/bin/sox</entry>
Modified: trunk/dmfc/transformers/org_pef_dtbook2pef/DTBook2PEF.java
===================================================================
--- trunk/dmfc/transformers/org_pef_dtbook2pef/DTBook2PEF.java 2014-08-27 10:18:08 UTC (rev 2802)
+++ trunk/dmfc/transformers/org_pef_dtbook2pef/DTBook2PEF.java 2014-09-12 06:30:58 UTC (rev 2803)
@@ -1,38 +1,28 @@
package org_pef_dtbook2pef;
+import java.io.BufferedReader;
import java.io.File;
import java.io.IOException;
-import java.util.HashMap;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.net.URISyntaxException;
+import java.util.ArrayList;
import java.util.Map;
-import org.daisy.dotify.Dotify;
-import org.daisy.dotify.system.InternalTaskException;
-import org.daisy.dotify.system.TaskSystemFactory;
-import org.daisy.dotify.text.FilterLocale;
import org.daisy.pipeline.core.InputListener;
+import org.daisy.pipeline.core.event.MessageEvent;
import org.daisy.pipeline.core.transformer.Transformer;
import org.daisy.pipeline.exception.TransformerRunException;
/**
- * <p>The transformer loads a TaskSystem implementation and runs the steps
- * in it. The original intent was to convert DTBook into braille (PEF),
- * but other uses are possible.</p>
+ * <p>
+ * The transformer runs Dotify with the supplied parameters.
+ * </p>
*
- * <p>Before running the setup, a few globally useful parameters,
- * such as todays date, are added.</p>
+ * @author Joel Håkansson
*
- * <p>The result from each step can be kept using the writeTempFiles
- * parameter in the tdf.</p>
- *
- * <p>Additional conversions can be implemented by modifying the {@link TaskSystemFactory}</p>
- *
- * @author Joel Håkansson, TPB
- * @version 2010-02-08
- * @since 2008-01-21
- *
*/
public class DTBook2PEF extends Transformer {
- private HashMap<String, String> map;
/**
* Default constructor.
@@ -43,37 +33,93 @@
super(inListener, isInteractive);
}
- /**
- * <p>This is the transformer entry point that
- * loads and runs the specified setup.</p>
- *
- * <p>Before running the setup, a few globally useful parameters,
- * such as todays date, are added.</p>
- *
- * <p>The result from each step can be kept using the writeTempFiles
- * parameter in the tdf.</p>
- */
@Override
protected boolean execute(Map<String, String> parameters) throws TransformerRunException {
progress(0);
// get parameters
- File input = new File(parameters.get("input"));
- File output = new File(parameters.get("output"));
- String setup = parameters.get("setup");
- FilterLocale locale = FilterLocale.parse(parameters.get("locale"));
+ File input = new File(parameters.remove("input"));
+ File output = new File(parameters.remove("output"));
+ String setup = parameters.remove("setup");
+ String locale = parameters.remove("locale");
+ String dotifyCliPath = parameters.remove("dotifyCliPath");
- map = new HashMap<String, String>();
- map.putAll(parameters);
+ if (dotifyCliPath == null || "".equals(dotifyCliPath)) {
+ System.out.println("HERE");
+ dotifyCliPath = System.getProperty("pipeline.dotify.cli.path");
+ }
+
+ if (dotifyCliPath == null || !new File(dotifyCliPath).exists()) {
+ throw new TransformerRunException("Cannot locate Dotify executable at '" + dotifyCliPath + "'. Check your configuration. For more information, see the transformer documentation.");
+ }
+
+ String separator = System.getProperty("file.separator");
+ String path = System.getProperty("java.home") + separator + "bin" + separator + "java";
+ ArrayList<String> command = new ArrayList<String>();
+ command.add(path);
+ command.add("-jar");
+
try {
- Dotify.run(input, output, setup, locale, map);
- } catch (InternalTaskException e) {
- throw new TransformerRunException("InternalTaskException", e);
+ command.add(new File(getClass().getResource("dotify-dist/dotify-cli.jar").toURI()).getAbsolutePath());
+ } catch (URISyntaxException e1) {
+ throw new TransformerRunException("", e1);
+ }
+
+ command.add(input.getAbsolutePath());
+ command.add(output.getAbsolutePath());
+ command.add(setup);
+ command.add(locale.toString());
+ for (String arg : parameters.keySet()) {
+ if (parameters.get(arg) != null) {
+ command.add("-" + arg + "=" + parameters.get(arg));
+ }
+ }
+
+ sendMessage("About to run: " + command.toString());
+
+ ProcessBuilder processBuilder = new ProcessBuilder(command);
+ processBuilder.redirectErrorStream(true);
+ try {
+ Process process = processBuilder.start();
+ // hook up child process output to parent
+ InputStream lsOut = process.getInputStream();
+ BufferedReader in = new BufferedReader(new InputStreamReader(lsOut));
+ // read the child process' output
+ String line;
+ try {
+ while ((line = in.readLine()) != null) {
+ sendMessage(line);
+ }
+ } catch (IOException e) {
+ sendMessage("Failed to read from console." + e.getMessage(), MessageEvent.Type.ERROR);
+ }
+ try {
+ in.close();
+ } catch (IOException e) {
+ }
+ process.waitFor();
} catch (IOException e) {
- throw new TransformerRunException("IOException", e);
+ throw new TransformerRunException("Failed to start process.", e);
+ } catch (InterruptedException e) {
+ throw new TransformerRunException("Could not wait for process.", e);
}
progress(1);
return true;
}
+ public static boolean isSupported() {
+ double v = getVersion();
+ // System.out.println("Version: " + v);
+ return v >= 1.6;
+ }
+
+ static double getVersion() {
+ String[] version = System.getProperty("java.version").split("\\.");
+ return Double.parseDouble(version[0] + (version.length >= 2 ? "." + version[1] : ""));
+ }
+
+ public static void main(String[] args) {
+ isSupported();
+ }
+
}
\ No newline at end of file
Modified: trunk/dmfc/transformers/org_pef_dtbook2pef/transformer.tdf
===================================================================
--- trunk/dmfc/transformers/org_pef_dtbook2pef/transformer.tdf 2014-08-27 10:18:08 UTC (rev 2802)
+++ trunk/dmfc/transformers/org_pef_dtbook2pef/transformer.tdf 2014-09-12 06:30:58 UTC (rev 2803)
@@ -138,6 +138,13 @@
</enum>
<default>true</default>
</parameter>
+
+ <parameter type="string" required="false">
+ <name>dotifyCliPath</name>
+ <description>Path to executable. Leave blank to use default.</description>
+ <example>C:\Program\Dotify\dotify-cli.jar</example>
+ <default></default>
+ </parameter>
</parameters>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <joe...@us...> - 2014-08-27 10:18:10
|
Revision: 2802
http://sourceforge.net/p/daisymfc/code/2802
Author: joeha480
Date: 2014-08-27 10:18:08 +0000 (Wed, 27 Aug 2014)
Log Message:
-----------
Updates from trunk
Modified Paths:
--------------
branches/deploy.mtm.se/lib/dotify-translator.jar
branches/deploy.mtm.se/lib/dotify.jar
Property Changed:
----------------
branches/deploy.mtm.se/
Index: branches/deploy.mtm.se
===================================================================
--- branches/deploy.mtm.se 2014-08-27 10:13:30 UTC (rev 2801)
+++ branches/deploy.mtm.se 2014-08-27 10:18:08 UTC (rev 2802)
Property changes on: branches/deploy.mtm.se
___________________________________________________________________
Modified: svn:mergeinfo
## -1,3 +1,3 ##
/branches/tpb-braille2:2698-2727
/branches/tpb-dotify/dmfc:2593-2666
-/trunk/dmfc:2734-2799
+/trunk/dmfc:2734-2801
\ No newline at end of property
Modified: branches/deploy.mtm.se/lib/dotify-translator.jar
===================================================================
(Binary files differ)
Modified: branches/deploy.mtm.se/lib/dotify.jar
===================================================================
(Binary files differ)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <joe...@us...> - 2014-08-27 10:13:32
|
Revision: 2801
http://sourceforge.net/p/daisymfc/code/2801
Author: joeha480
Date: 2014-08-27 10:13:30 +0000 (Wed, 27 Aug 2014)
Log Message:
-----------
Updated Dotify build
Modified Paths:
--------------
trunk/dmfc/lib/dotify-translator.jar
trunk/dmfc/lib/dotify.jar
Modified: trunk/dmfc/lib/dotify-translator.jar
===================================================================
(Binary files differ)
Modified: trunk/dmfc/lib/dotify.jar
===================================================================
(Binary files differ)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <joe...@us...> - 2014-08-22 12:04:15
|
Revision: 2800
http://sourceforge.net/p/daisymfc/code/2800
Author: joeha480
Date: 2014-08-22 12:04:13 +0000 (Fri, 22 Aug 2014)
Log Message:
-----------
Updates from trunk
Modified Paths:
--------------
branches/deploy.mtm.se/lib/dotify-translator.jar
branches/deploy.mtm.se/lib/dotify.jar
Property Changed:
----------------
branches/deploy.mtm.se/
Index: branches/deploy.mtm.se
===================================================================
--- branches/deploy.mtm.se 2014-08-22 12:00:53 UTC (rev 2799)
+++ branches/deploy.mtm.se 2014-08-22 12:04:13 UTC (rev 2800)
Property changes on: branches/deploy.mtm.se
___________________________________________________________________
Modified: svn:mergeinfo
## -1,3 +1,3 ##
/branches/tpb-braille2:2698-2727
/branches/tpb-dotify/dmfc:2593-2666
-/trunk/dmfc:2734-2797
+/trunk/dmfc:2734-2799
\ No newline at end of property
Modified: branches/deploy.mtm.se/lib/dotify-translator.jar
===================================================================
(Binary files differ)
Modified: branches/deploy.mtm.se/lib/dotify.jar
===================================================================
(Binary files differ)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <joe...@us...> - 2014-08-22 12:00:54
|
Revision: 2799
http://sourceforge.net/p/daisymfc/code/2799
Author: joeha480
Date: 2014-08-22 12:00:53 +0000 (Fri, 22 Aug 2014)
Log Message:
-----------
Updated Dotify build
Modified Paths:
--------------
trunk/dmfc/lib/dotify-translator.jar
trunk/dmfc/lib/dotify.jar
Modified: trunk/dmfc/lib/dotify-translator.jar
===================================================================
(Binary files differ)
Modified: trunk/dmfc/lib/dotify.jar
===================================================================
(Binary files differ)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <joe...@us...> - 2014-01-20 12:47:20
|
Revision: 2798
http://sourceforge.net/p/daisymfc/code/2798
Author: joeha480
Date: 2014-01-20 12:47:15 +0000 (Mon, 20 Jan 2014)
Log Message:
-----------
Updates from trunk
Modified Paths:
--------------
branches/deploy.mtm.se/lib/dotify-translator.jar
Property Changed:
----------------
branches/deploy.mtm.se/
Index: branches/deploy.mtm.se
===================================================================
--- branches/deploy.mtm.se 2014-01-20 12:44:58 UTC (rev 2797)
+++ branches/deploy.mtm.se 2014-01-20 12:47:15 UTC (rev 2798)
Property changes on: branches/deploy.mtm.se
___________________________________________________________________
Modified: svn:mergeinfo
## -1,3 +1,3 ##
/branches/tpb-braille2:2698-2727
/branches/tpb-dotify/dmfc:2593-2666
-/trunk/dmfc:2734-2795
+/trunk/dmfc:2734-2797
\ No newline at end of property
Modified: branches/deploy.mtm.se/lib/dotify-translator.jar
===================================================================
(Binary files differ)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <joe...@us...> - 2014-01-20 12:45:02
|
Revision: 2797
http://sourceforge.net/p/daisymfc/code/2797
Author: joeha480
Date: 2014-01-20 12:44:58 +0000 (Mon, 20 Jan 2014)
Log Message:
-----------
updated dotify-translator build
Modified Paths:
--------------
trunk/dmfc/lib/dotify-translator.jar
Modified: trunk/dmfc/lib/dotify-translator.jar
===================================================================
(Binary files differ)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <joe...@us...> - 2014-01-20 12:32:53
|
Revision: 2796
http://sourceforge.net/p/daisymfc/code/2796
Author: joeha480
Date: 2014-01-20 12:32:49 +0000 (Mon, 20 Jan 2014)
Log Message:
-----------
Updates from trunk
Modified Paths:
--------------
branches/deploy.mtm.se/transformers/org_pef_dtbook2pef/transformer.tdf
Property Changed:
----------------
branches/deploy.mtm.se/
Index: branches/deploy.mtm.se
===================================================================
--- branches/deploy.mtm.se 2014-01-20 12:31:00 UTC (rev 2795)
+++ branches/deploy.mtm.se 2014-01-20 12:32:49 UTC (rev 2796)
Property changes on: branches/deploy.mtm.se
___________________________________________________________________
Modified: svn:mergeinfo
## -1,3 +1,3 ##
/branches/tpb-braille2:2698-2727
/branches/tpb-dotify/dmfc:2593-2666
-/trunk/dmfc:2734-2793
+/trunk/dmfc:2734-2795
\ No newline at end of property
Modified: branches/deploy.mtm.se/transformers/org_pef_dtbook2pef/transformer.tdf
===================================================================
--- branches/deploy.mtm.se/transformers/org_pef_dtbook2pef/transformer.tdf 2014-01-20 12:31:00 UTC (rev 2795)
+++ branches/deploy.mtm.se/transformers/org_pef_dtbook2pef/transformer.tdf 2014-01-20 12:32:49 UTC (rev 2796)
@@ -127,6 +127,17 @@
<example>50</example>
<default></default>
</parameter>
+
+ <parameter required="false" type="enum">
+ <name>hyphenate</name>
+ <description>Hyphenate output.</description>
+ <example>true</example>
+ <enum>
+ <value>true</value>
+ <value>false</value>
+ </enum>
+ <default>true</default>
+ </parameter>
</parameters>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <joe...@us...> - 2014-01-20 12:31:03
|
Revision: 2795
http://sourceforge.net/p/daisymfc/code/2795
Author: joeha480
Date: 2014-01-20 12:31:00 +0000 (Mon, 20 Jan 2014)
Log Message:
-----------
Added hyphenate option to org_pef_dtbook2pef transformer
Modified Paths:
--------------
trunk/dmfc/transformers/org_pef_dtbook2pef/transformer.tdf
Modified: trunk/dmfc/transformers/org_pef_dtbook2pef/transformer.tdf
===================================================================
--- trunk/dmfc/transformers/org_pef_dtbook2pef/transformer.tdf 2014-01-20 12:23:52 UTC (rev 2794)
+++ trunk/dmfc/transformers/org_pef_dtbook2pef/transformer.tdf 2014-01-20 12:31:00 UTC (rev 2795)
@@ -127,6 +127,17 @@
<example>50</example>
<default></default>
</parameter>
+
+ <parameter required="false" type="enum">
+ <name>hyphenate</name>
+ <description>Hyphenate output.</description>
+ <example>true</example>
+ <enum>
+ <value>true</value>
+ <value>false</value>
+ </enum>
+ <default>true</default>
+ </parameter>
</parameters>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <joe...@us...> - 2014-01-20 12:23:55
|
Revision: 2794
http://sourceforge.net/p/daisymfc/code/2794
Author: joeha480
Date: 2014-01-20 12:23:52 +0000 (Mon, 20 Jan 2014)
Log Message:
-----------
Updates from trunk
Modified Paths:
--------------
branches/deploy.mtm.se/lib/dotify.jar
branches/deploy.mtm.se/transformers/se_tpb_dtbook2latex/dtbook2latex_common.xsl
Property Changed:
----------------
branches/deploy.mtm.se/
Index: branches/deploy.mtm.se
===================================================================
--- branches/deploy.mtm.se 2014-01-20 12:20:40 UTC (rev 2793)
+++ branches/deploy.mtm.se 2014-01-20 12:23:52 UTC (rev 2794)
Property changes on: branches/deploy.mtm.se
___________________________________________________________________
Modified: svn:mergeinfo
## -1,3 +1,3 ##
/branches/tpb-braille2:2698-2727
/branches/tpb-dotify/dmfc:2593-2666
-/trunk/dmfc:2734-2790
+/trunk/dmfc:2734-2793
\ No newline at end of property
Modified: branches/deploy.mtm.se/lib/dotify.jar
===================================================================
(Binary files differ)
Modified: branches/deploy.mtm.se/transformers/se_tpb_dtbook2latex/dtbook2latex_common.xsl
===================================================================
--- branches/deploy.mtm.se/transformers/se_tpb_dtbook2latex/dtbook2latex_common.xsl 2014-01-20 12:20:40 UTC (rev 2793)
+++ branches/deploy.mtm.se/transformers/se_tpb_dtbook2latex/dtbook2latex_common.xsl 2014-01-20 12:23:52 UTC (rev 2794)
@@ -233,11 +233,23 @@
<xsl:text>\setheaderspaces{*}{*}{0.4} </xsl:text>
<xsl:text>\checkandfixthelayout </xsl:text>
- <!-- The trim marks should be outside the actual page so that
- you will not see any lines even if you do not cut the
- paper absolutely precisely (see section 18.3. Trim marks
- in the memoir manual) -->
- <xsl:text>\trimLmarks </xsl:text>
+ <!-- The trim marks should be outside the actual page so that you will not
+ see any lines even if you do not cut the paper absolutely precisely
+ (see section 18.3. Trim marks in the memoir manual) -->
+ <!-- The default for trimLmarks in newer versions of memoir (v3.6j) is too
+ cluttered and in particular too close the the actual page. Define a
+ new 'light' version of trimLmarks which drops the trim marks in the
+ middle -->
+ <xsl:text>\newcommand*{\trimLmarksLight}{% </xsl:text>
+ <xsl:text> \let\tmarktl\Ltrimpictl </xsl:text>
+ <xsl:text> \let\tmarktr\Ltrimpictr </xsl:text>
+ <xsl:text> \let\tmarkbl\Ltrimpicbl </xsl:text>
+ <xsl:text> \let\tmarkbr\Ltrimpicbr </xsl:text>
+ <xsl:text> \let\tmarktm\relax </xsl:text>
+ <xsl:text> \let\tmarkml\relax </xsl:text>
+ <xsl:text> \let\tmarkmr\relax </xsl:text>
+ <xsl:text> \let\tmarkbm\relax} </xsl:text>
+ <xsl:text>\trimLmarksLight </xsl:text>
<xsl:text>\usepackage{graphicx} </xsl:text>
<!-- Make sure images never get larger than the textwidth and the textheight -->
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <joe...@us...> - 2014-01-20 12:20:43
|
Revision: 2793
http://sourceforge.net/p/daisymfc/code/2793
Author: joeha480
Date: 2014-01-20 12:20:40 +0000 (Mon, 20 Jan 2014)
Log Message:
-----------
Updated dotify build
Modified Paths:
--------------
trunk/dmfc/lib/dotify.jar
Modified: trunk/dmfc/lib/dotify.jar
===================================================================
(Binary files differ)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ce...@us...> - 2014-01-16 14:02:35
|
Revision: 2792
http://sourceforge.net/p/daisymfc/code/2792
Author: cegli
Date: 2014-01-16 14:02:31 +0000 (Thu, 16 Jan 2014)
Log Message:
-----------
The trim marks are too close to the page in new versions of memoir
The default for trimLmarks in newer versions of memoir (v3.6j) is too
close the the actual page. Define and use a new 'light' version of
trimLmarks which drops the trim marks in the middle.
Modified Paths:
--------------
trunk/dmfc/transformers/se_tpb_dtbook2latex/dtbook2latex_common.xsl
Modified: trunk/dmfc/transformers/se_tpb_dtbook2latex/dtbook2latex_common.xsl
===================================================================
--- trunk/dmfc/transformers/se_tpb_dtbook2latex/dtbook2latex_common.xsl 2014-01-14 08:09:44 UTC (rev 2791)
+++ trunk/dmfc/transformers/se_tpb_dtbook2latex/dtbook2latex_common.xsl 2014-01-16 14:02:31 UTC (rev 2792)
@@ -233,11 +233,23 @@
<xsl:text>\setheaderspaces{*}{*}{0.4} </xsl:text>
<xsl:text>\checkandfixthelayout </xsl:text>
- <!-- The trim marks should be outside the actual page so that
- you will not see any lines even if you do not cut the
- paper absolutely precisely (see section 18.3. Trim marks
- in the memoir manual) -->
- <xsl:text>\trimLmarks </xsl:text>
+ <!-- The trim marks should be outside the actual page so that you will not
+ see any lines even if you do not cut the paper absolutely precisely
+ (see section 18.3. Trim marks in the memoir manual) -->
+ <!-- The default for trimLmarks in newer versions of memoir (v3.6j) is too
+ cluttered and in particular too close the the actual page. Define a
+ new 'light' version of trimLmarks which drops the trim marks in the
+ middle -->
+ <xsl:text>\newcommand*{\trimLmarksLight}{% </xsl:text>
+ <xsl:text> \let\tmarktl\Ltrimpictl </xsl:text>
+ <xsl:text> \let\tmarktr\Ltrimpictr </xsl:text>
+ <xsl:text> \let\tmarkbl\Ltrimpicbl </xsl:text>
+ <xsl:text> \let\tmarkbr\Ltrimpicbr </xsl:text>
+ <xsl:text> \let\tmarktm\relax </xsl:text>
+ <xsl:text> \let\tmarkml\relax </xsl:text>
+ <xsl:text> \let\tmarkmr\relax </xsl:text>
+ <xsl:text> \let\tmarkbm\relax} </xsl:text>
+ <xsl:text>\trimLmarksLight </xsl:text>
<xsl:text>\usepackage{graphicx} </xsl:text>
<!-- Make sure images never get larger than the textwidth and the textheight -->
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <joe...@us...> - 2014-01-14 08:09:48
|
Revision: 2791
http://sourceforge.net/p/daisymfc/code/2791
Author: joeha480
Date: 2014-01-14 08:09:44 +0000 (Tue, 14 Jan 2014)
Log Message:
-----------
Updates from trunk
Modified Paths:
--------------
branches/deploy.mtm.se/launchers/pipeline.sh
branches/deploy.mtm.se/lib/brailleUtils-catalog.jar
branches/deploy.mtm.se/lib/brailleUtils-core.jar
branches/deploy.mtm.se/lib/dotify-translator.jar
branches/deploy.mtm.se/lib/dotify.jar
branches/deploy.mtm.se/scripts/create_distribute/pef/DTBookToPEF.taskScript
branches/deploy.mtm.se/transformers/org_pef_dtbook2pef/transformer.tdf
branches/deploy.mtm.se/transformers/se_tpb_dtbook2latex/dtbook2latex_common.xsl
branches/deploy.mtm.se/transformers/se_tpb_dtbook2latex/dtbook2latex_sbs.xsl
Added Paths:
-----------
branches/deploy.mtm.se/build-deb.xml
branches/deploy.mtm.se/debian/
branches/deploy.mtm.se/transformers/se_tpb_dtbook2latex/README
branches/deploy.mtm.se/transformers/se_tpb_dtbook2latex/table-utils.xsl
Property Changed:
----------------
branches/deploy.mtm.se/
Index: branches/deploy.mtm.se
===================================================================
--- branches/deploy.mtm.se 2014-01-14 07:58:47 UTC (rev 2790)
+++ branches/deploy.mtm.se 2014-01-14 08:09:44 UTC (rev 2791)
Property changes on: branches/deploy.mtm.se
___________________________________________________________________
Modified: svn:mergeinfo
## -1,3 +1,3 ##
/branches/tpb-braille2:2698-2727
/branches/tpb-dotify/dmfc:2593-2666
-/trunk/dmfc:2734-2755
+/trunk/dmfc:2734-2790
\ No newline at end of property
Copied: branches/deploy.mtm.se/build-deb.xml (from rev 2790, trunk/dmfc/build-deb.xml)
===================================================================
--- branches/deploy.mtm.se/build-deb.xml (rev 0)
+++ branches/deploy.mtm.se/build-deb.xml 2014-01-14 08:09:44 UTC (rev 2791)
@@ -0,0 +1,137 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<project name="Pipeline debian package" default="package">
+ <description>Buildfile for a Debian package for the Daisy Pipeline</description>
+
+ <import file="${basedir}/build-core.xml"/>
+
+ <property name="deb.name" value="daisy-pipeline"/>
+ <property name="deb.version" value="${ISO-TODAY}-2"/>
+ <property name="deb.install.root" value="/usr"/>
+ <property name="deb.install.lib" value="${deb.install.root}/lib/${deb.name}"/>
+ <property name="deb.install.doc" value="${deb.install.root}/share/doc/${deb.name}"/>
+
+ <target name="package" depends="buildCoreJar,buildUtil,createDistributionDir">
+ <taskdef name="deb" classname="org.vafer.jdeb.ant.DebAntTask"/>
+
+ <mkdir dir="${build.dir}/debian/control"/>
+
+ <copy todir="${build.dir}/debian/control">
+ <fileset dir="${base.dir}/debian"/>
+ <filterset begintoken="[[" endtoken="]]">
+ <filter token="version" value="${deb.version}"/>
+ <filter token="name" value="${deb.name}"/>
+ </filterset>
+ </copy>
+
+ <deb destfile="${build.dir}/${deb.name}_${deb.version}_all.deb" control="${build.dir}/debian/control">
+ <!-- Pipeline core -->
+ <data src="${distribution.dir}" type="directory">
+ <mapper type="perm" prefix="${deb.install.lib}"/>
+ <include name="pipeline.jar"/>
+ </data>
+ <!-- Util library -->
+ <data src="${distribution.dir}" type="directory">
+ <mapper type="perm" prefix="${deb.install.lib}/lib"/>
+ <include name="org.daisy.util.jar"/>
+ </data>
+ <!-- Required JARs -->
+ <data src="${base.dir}/lib" type="directory">
+ <mapper type="perm" prefix="${deb.install.lib}/lib"/>
+ <include name="batik-css.jar"/>
+ <include name="batik-util.jar"/>
+ <include name="chardet.jar"/>
+ <include name="commons-cli-1.1.jar"/>
+ <include name="commons-pool-1.4.jar"/>
+ <include name="epubcheck-3.0.jar"/>
+ <include name="icu4j-3_8.jar"/>
+ <!-- <include name="icu4j-charsets.jar"/> -->
+ <include name="jaudiotagger.jar"/>
+ <include name="jl1.0.jar"/>
+ <include name="junit-4.7.jar"/>
+ <include name="log4j-1.2.15.jar"/>
+ <include name="jing.jar"/>
+ <include name="xml-apis.jar"/>
+ <include name="sac.jar"/>
+ <include name="saxon.jar"/>
+ <include name="saxon8.jar"/>
+ <include name="saxon8-dom.jar"/>
+ <include name="serializer.jar"/>
+ <include name="slf4j-api-1.5.6.jar"/>
+ <include name="slf4j-log4j12-1.5.6.jar"/>
+ <include name="stax-api-1.0.1.jar"/>
+ <include name="tagsoup-1.2.jar"/>
+ <include name="tritonus_remaining-0.3.6.jar"/>
+ <include name="tritonus_share-0.3.6.jar"/>
+ <include name="wstx-lgpl-3.2.8.jar"/>
+ <include name="xalan.jar"/>
+ <include name="xercesImpl.jar"/>
+ <include name="zedval.jar"/>
+ <include name="brailleUtils-core.jar"/>
+ <include name="brailleUtils-catalog.jar"/>
+ <include name="dotify.jar"/>
+ <include name="dotify-translator.jar"/>
+ <include name="texhyphj.jar"/>
+ </data>
+ <!-- Transformers -->
+ <data src="${base.dir}/transformers" type="directory">
+ <mapper type="perm" prefix="${deb.install.lib}/transformers"/>
+ <include name="**/*.*"/>
+ <exclude name="se_tpb_aligner/**/*.*"/>
+ <exclude name="int_daisy_filesetEncryptor/**/*.*"/>
+ <exclude name="uk_rnib_odf2dtbook/**/*.*"/>
+ <exclude name="se_tpb_speechgenerator/**/*.*"/>
+ <exclude name="int_daisy_xukCreator/**/*.*"/>
+ <exclude name="**/*.java"/>
+ <exclude name="*.jar"/>
+ <!-- exclude some stuff which only works on windows or mac -->
+ <exclude name="ca_cnib_rtf2dtbook/rtf2xml-win/**/*.*"/>
+ <exclude name="se_tpb_speechgen2/external/win/**/*.*"/>
+ <exclude name="se_tpb_speechgen2/lib/*.*"/>
+ <exclude name="se_tpb_speechgen2/external/MacOS/*.*"/>
+ <!-- exclude vcs control files -->
+ <exclude name="**/.cvsignore"/>
+ </data>
+ <!-- Property files -->
+ <data src="${base.dir}/bin" type="directory">
+ <mapper type="perm" prefix="${deb.install.lib}"/>
+ <include name="pipeline.properties"/>
+ <include name="pipeline.user.properties"/>
+ </data>
+ <!-- Pipeline RMI files -->
+ <data src="${base.dir}/rmi" type="directory">
+ <mapper type="perm" prefix="${deb.install.lib}/rmi"/>
+ <include name="**/*.*"/>
+ </data>
+ <!-- Launcher shell scripts -->
+ <data src="${base.dir}/launchers" type="directory">
+ <mapper type="perm" filemode="755" prefix="${deb.install.lib}"/>
+ <include name="pipeline.sh"/>
+ </data>
+ <!-- Link to the launcher -->
+ <link name="/usr/bin/daisy-pipeline" target="${deb.install.lib}/pipeline.sh"/>
+ <!-- Scripts -->
+ <data src="${base.dir}/scripts" type="directory">
+ <mapper type="perm" prefix="${deb.install.lib}/scripts"/>
+ <include name="**/*.*"/>
+ <exclude name="_dev/**/*.*"/>
+ </data>
+ <!-- Documentation -->
+ <data src="${base.dir}/doc" type="directory">
+ <mapper type="perm" prefix="${deb.install.lib}/doc"/>
+ <include name="developer/**/*.*"/>
+ <include name="enduser/**/*.*"/>
+ <include name="scripts/**/*.*"/>
+ <include name="transformers/**/*.*"/>
+ <include name="*.html"/>
+ <include name="*.css"/>
+ </data>
+ <link name="${deb.install.doc}/index.html" target="${deb.install.lib}/doc/index-all.html"/>
+ <!-- Licenses -->
+ <data src="${base.dir}/licenses" type="directory">
+ <mapper type="perm" prefix="${deb.install.doc}/licenses"/>
+ <include name="**/*.*"/>
+ </data>
+ </deb>
+ </target>
+</project>
Modified: branches/deploy.mtm.se/launchers/pipeline.sh
===================================================================
--- branches/deploy.mtm.se/launchers/pipeline.sh 2014-01-14 07:58:47 UTC (rev 2790)
+++ branches/deploy.mtm.se/launchers/pipeline.sh 2014-01-14 08:09:44 UTC (rev 2791)
@@ -41,7 +41,14 @@
# Set classpath
-DIR=`dirname $0`
+if [[ "$(uname)" == 'Linux' ]]; then
+ # resolve the path to this script in the face of symlinks
+ DIR="$(dirname "$(readlink -f "$0")")"
+else
+ # other platforms might not support readlink -f
+ DIR=`dirname $0`
+fi
+
CP=$DIR/pipeline.jar:$DIR
# Execute Daisy Pipeline
Modified: branches/deploy.mtm.se/lib/brailleUtils-catalog.jar
===================================================================
(Binary files differ)
Modified: branches/deploy.mtm.se/lib/brailleUtils-core.jar
===================================================================
(Binary files differ)
Modified: branches/deploy.mtm.se/lib/dotify-translator.jar
===================================================================
(Binary files differ)
Modified: branches/deploy.mtm.se/lib/dotify.jar
===================================================================
(Binary files differ)
Modified: branches/deploy.mtm.se/scripts/create_distribute/pef/DTBookToPEF.taskScript
===================================================================
--- branches/deploy.mtm.se/scripts/create_distribute/pef/DTBookToPEF.taskScript 2014-01-14 07:58:47 UTC (rev 2790)
+++ branches/deploy.mtm.se/scripts/create_distribute/pef/DTBookToPEF.taskScript 2014-01-14 08:09:44 UTC (rev 2791)
@@ -43,6 +43,7 @@
<datatype>
<enum>
<item nicename="32 characters wide" value="A4-w32" />
+ <item nicename="32 characters wide (double line spacing)" value="A4-w32-dls" />
<item nicename="42 characters wide" value="FA44-w42" />
<item nicename="50 characters wide" value="w50" />
</enum>
Modified: branches/deploy.mtm.se/transformers/org_pef_dtbook2pef/transformer.tdf
===================================================================
--- branches/deploy.mtm.se/transformers/org_pef_dtbook2pef/transformer.tdf 2014-01-14 07:58:47 UTC (rev 2790)
+++ branches/deploy.mtm.se/transformers/org_pef_dtbook2pef/transformer.tdf 2014-01-14 08:09:44 UTC (rev 2791)
@@ -52,6 +52,7 @@
<example>A4-w32</example>
<enum>
<value>A4-w32</value>
+ <value>A4-w32-dls</value>
<value>FA44-w42</value>
<value>w50</value>
</enum>
Copied: branches/deploy.mtm.se/transformers/se_tpb_dtbook2latex/README (from rev 2790, trunk/dmfc/transformers/se_tpb_dtbook2latex/README)
===================================================================
--- branches/deploy.mtm.se/transformers/se_tpb_dtbook2latex/README (rev 0)
+++ branches/deploy.mtm.se/transformers/se_tpb_dtbook2latex/README 2014-01-14 08:09:44 UTC (rev 2791)
@@ -0,0 +1,149 @@
+
+* Goals
+The idea of large print is to make the content accessible for people
+with a visual impairment. This in general means that there is a
+simple structure to the layout, everything is flushed left and a
+special font is used.
+
+* Implementation
+** Code
+In LaTeX code is typically rendered using the listings package. The
+package pretty prints the code based on the language. However as we
+are dealing with DTBook chances are that it is not known which
+programming language we are dealing with. Instead we probably have
+nested strong and em that reflect the original rendering in the book.
+All we want is a faithful representation of the original. For that
+most likely the alltt package is best.
+
+An additional challenge is that it is not quite clear when to render a
+code fragment as an inline or as a block. The structuring guidelines
+say that code can be both but the schema indicates that it can only be
+inside a p anyway.
+
+For now we use the same implementation as for dtb:samp, so for inline
+code use xml:space='default'.
+
+** Annotation
+Annotations are generally used for things that are printed in the
+margin of the print book. In a large print book it is not desirable
+to use the margin as this makes the layout less clear and with the
+large font there isn't much room in the margin anyway.
+
+So it seems more adequate to treat annotations as another form of
+footnotes or maybe even sidebar that could be placed at the bottom of
+the page or float somewhere near the annoref.
+
+** bdo
+Is not supported at the moment. There is a question on StackExchange
+that seems to indicate that there are possibilities to support this
+(http://tex.stackexchange.com/questions/38421/right-to-left-text-in-latex-reversed-numbers-and-parentheses),
+so I'd accept patches.
+
+** Bridgehead
+In the context of LaTeX a bridgehead inside a level{N} can basically
+be treated like a h{N+1}.
+
+** Dfn
+In theory we could treat the dfn tag as an indication that this word
+should go in some index and have LaTeX generate this index for us.
+However in the interest of having a faithful rendering of the
+original we do not do this. Indexes are created differently (see
+http://www.daisy.org/z3986/structure/SG-DAISY3/part2-major.html#index).
+
+** Samp
+The [[http://www.daisy.org/z3986/structure/SG-DAISY3/part2-block.html#sample][structuring guidelines]] are a bit hazy about the use of ~samp~. Are
+you supposed to embed inline markup like newlines and bold inside samp
+or is the spacing preserved? The current implementation uses the
+~xml:space~ attribute to decide whether the spacing is to be preserved.
+The DTBook schema sets the default of ~xml:space~ to 'preserve', so if
+you omit it it defaults to 'preserve'. If you want to manually lay out
+the content then use ~xml:space='default'~ as follows:
+
+#+BEGIN_EXAMPLE
+<samp xml:space='default'>
+First Name:________________________ Middle Initial:_______<br/>
+Last Name:___________________________<br/>
+Address:_______________________________________________________<br/>
+City:______________________ State:_______ Zip:________________<br/>
+Social Security Number:____________________________<br/>
+Bank Name:____________________________________<br/>
+</samp>
+#+END_EXAMPLE
+
+or alternatively
+
+#+BEGIN_EXAMPLE
+<samp>
+First Name:________________________ Middle Initial:_______
+Last Name:___________________________
+Address:_______________________________________________________
+City:______________________ State:_______ Zip:________________
+Social Security Number:____________________________
+Bank Name:____________________________________
+</samp>
+#+END_EXAMPLE
+
+** Sidebar
+Sidebars are implemented using tcolorbox which has the nice property
+that it can float and at the same time break across pages. You'll have
+to use a very new version of it though.
+
+** Prodnote
+Prodnotes come in two flavours: inline and block.
+
+The block variant seems in many ways like a side bar and is therefore
+rendered in a similar way with a box around it. To distinguish it from
+a sidebar it has a slightly different, gray background. This in itself
+might be a sin from the visual impairment point of view, but we need a
+way to visualy distinguish them from sidebar. Maybe we could just add
+a title to them saying something like "Producers Note", but this seems
+to heavy weight and would require a way to customize the title.
+
+The LaTeX environment tcolorbox provides all the facilities to do
+this. For inline prodnotes it is not really an ideal solution however,
+as it typesets the prodnote in its own paragraph and makes it
+non-breakable. A solution for inline prodnotes could be to treat them
+like footnotes, but it doesn't seem very desirable to typeset block
+and inline prodnotes differently. So for now inline prodnotes are set
+in a separate paragraph like their block context brother. However they
+are not floating, i.e. interrupt the current paragraph immediately.
+
+** Caption
+In the context of large print we assume that no automatic text should
+be generated for captions, i.e. we do not want the usual LaTeX style
+of "Table 4:...". Instead we want just the content of the caption. For
+that we use the \legend macro from the memoir class. Since all the
+text is left justified and we would like to stay away from italics
+there is no visual clue that something is a caption. It looks just
+like a normal paragraph.
+
+** Images
+Images are scaled proportionaly to the chossen font size. Let's assume
+the chosen font size is 20pt and the "normal" font size would be 12pt,
+so we calculate a scaling factor of 20/12. We then multiply this with
+a magic number (3) to get the scaling factor. The adjustbox package is
+used to make sure no image is wider than the width of the text and
+higher than the height of the text.
+
+* Limitations
+It is generally not so easy to lay out something on a fixed page where
+you can have any input and want to use a large font. So there are
+probably many cases where the content will go off the page. This
+usually occurs where you have advanced content inside tables, large
+tables. If you want you can go in and fix the LaTeX code, on the other
+hand if you have some automated work flow where you just run your
+DTBook through you might have to life with these deficiencies or move
+to a format that is not bound by the limitations of a physical medium
+such as paper. In other words move to something like DTB or EPUB.
+
+* History
+This code was originally developed by Linus Ericson as a prototype.
+Christian Egli took it and enhanced it for use in production at SBS.
+For a long time only a subset of DTBook was in production at SBS and
+hence only a subset of the converter was really battle tested. By now
+it should support all of DTBook fairly well
+
+
+# Local Variables:
+# mode: org
+# End:
Modified: branches/deploy.mtm.se/transformers/se_tpb_dtbook2latex/dtbook2latex_common.xsl
===================================================================
--- branches/deploy.mtm.se/transformers/se_tpb_dtbook2latex/dtbook2latex_common.xsl 2014-01-14 07:58:47 UTC (rev 2790)
+++ branches/deploy.mtm.se/transformers/se_tpb_dtbook2latex/dtbook2latex_common.xsl 2014-01-14 08:09:44 UTC (rev 2791)
@@ -4,10 +4,13 @@
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:dtb="http://www.daisy.org/z3986/2005/dtbook/"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ xmlns:math="http://www.w3.org/1998/Math/MathML"
xmlns:my="http://my-functions"
extension-element-prefixes="my"
exclude-result-prefixes="dtb my">
+ <xsl:include href="table-utils.xsl"/>
+
<xsl:output method="text" encoding="utf-8" indent="no"/>
<xsl:strip-space elements="*"/>
<xsl:preserve-space elements="dtb:line dtb:address dtb:div dtb:title dtb:author dtb:note dtb:byline dtb:dateline
@@ -72,7 +75,9 @@
<xsl:variable name="number_of_volumes" select="count(//*['volume-split-point'=tokenize(@class, '\s+')])+1"/>
- <xsl:variable name="includegraphics-command" >
+ <xsl:function name="my:includegraphics-command" as="xs:string">
+ <xsl:param name="src" as="xs:string"/>
+ <xsl:param name="with_caption" as="xs:boolean"/>
<xsl:variable name="magic-number" select="3"/>
<xsl:variable name="scale-factor">
<xsl:sequence select="if ($fontsize='14pt') then round-half-to-even(14 div 12, 1) else
@@ -80,7 +85,61 @@
if ($fontsize='20pt') then round-half-to-even(20 div 12, 1) else
if ($fontsize='25pt') then round-half-to-even(25 div 12, 1) else 1"/>
</xsl:variable>
- <xsl:sequence select="concat('\includegraphics[scale=',$scale-factor*$magic-number,']{')"/>
+ <!-- FIXME: The following code calculates the available height for an image. If there is
+ a caption we assume that it will take up one line. This assumption can of course
+ fail, but we basically have no way of knowing how many lines a caption will take
+ from xslt (aside from crude guesses). -->
+ <xsl:variable name="height" select="if ($with_caption) then '\textheightMinusCaption' else '\textheight'"/>
+ <xsl:sequence select="concat('\maxsizebox{\textwidth}{',$height,'}{\includegraphics[scale=',$scale-factor*$magic-number,']{',$src,'}} ')"/>
+ </xsl:function>
+
+ <!-- Captions in plain LaTeX aren't very robust, i.e. a caption
+ should not contain environments such as lists, enumerations,
+ etc. In DTBook you can put all sorts of stuff inside captions.
+ If we really want to support this we'll have to put the float
+ and the caption (as a plain para) inside a minipage. -->
+ <xsl:function name="my:cleanCaptions" as="xs:string">
+ <xsl:param name="context" as="node()"/>
+ <xsl:value-of select="string($context)"/>
+ </xsl:function>
+
+ <!-- =========================== -->
+ <!-- Queries for block vs inline -->
+ <!-- =========================== -->
+
+ <xsl:function name="my:is-block-element" as="xs:boolean">
+ <xsl:param name="node" as="node()"/>
+ <xsl:apply-templates select="$node" mode="is-block-element"/>
+ </xsl:function>
+
+ <xsl:template match="node()" as="xs:boolean" mode="is-block-element" priority="10">
+ <xsl:sequence select="false()"/>
+ </xsl:template>
+
+ <xsl:template match="dtb:*|math:*" as="xs:boolean" mode="is-block-element" priority="11">
+ <xsl:sequence select="false()"/>
+ </xsl:template>
+
+ <xsl:template match="dtb:samp|dtb:cite" as="xs:boolean" mode="is-block-element" priority="12">
+ <xsl:sequence select="if (parent::*[self::dtb:p|self::dtb:li|self::dtb:td|self::dtb:th]) then false() else true()"/>
+ </xsl:template>
+
+ <xsl:template match="dtb:h1|dtb:h2|dtb:h3|dtb:h4|dtb:h5|dtb:h6|dtb:p|dtb:list|dtb:li|dtb:author|dtb:byline|dtb:line|dtb:imggroup|dtb:blockquote" as="xs:boolean" mode="is-block-element" priority="12">
+ <xsl:sequence select="true()"/>
+ </xsl:template>
+
+ <xsl:function name="my:has-preceding-non-empty-textnode-within-block" as="xs:boolean">
+ <xsl:param name="context"/>
+ <xsl:sequence select="some $t in ($context/preceding::text() intersect $context/ancestor-or-self::*[my:is-block-element(.)][1]//text()) satisfies normalize-space($t) != ''"/>
+ </xsl:function>
+
+ <xsl:variable name="level_to_section_map">
+ <entry key="level1">\chapter</entry>
+ <entry key="level2">\section</entry>
+ <entry key="level3">\subsection</entry>
+ <entry key="level4">\subsubsection</entry>
+ <entry key="level5">\paragraph</entry>
+ <entry key="level6">\subparagraph</entry>
</xsl:variable>
<!-- Localization -->
@@ -143,6 +202,8 @@
<xsl:if test="//dtb:table">
<!-- tables with variable width columns balanced -->
<xsl:text>\usepackage{tabulary} </xsl:text>
+ <!-- we need the xcolor package to be able to define colors such as black!60 -->
+ <xsl:text>\usepackage{xcolor} </xsl:text>
<xsl:text>\usepackage{colortbl} </xsl:text>
<xsl:text>\arrayrulecolor{black!60} </xsl:text>
<xsl:text>\setlength{\arrayrulewidth}{0.5mm} </xsl:text>
@@ -179,6 +240,8 @@
<xsl:text>\trimLmarks </xsl:text>
<xsl:text>\usepackage{graphicx} </xsl:text>
+ <!-- Make sure images never get larger than the textwidth and the textheight -->
+ <xsl:text>\usepackage{adjustbox} </xsl:text>
<xsl:call-template name="findLanguage"/>
<!-- The Babel package defines what they call shorthands. These are usefull
if you handcraft your LaTeX. But they are not wanted in the case where
@@ -218,12 +281,21 @@
</xsl:if>
</xsl:if>
- <xsl:if test="//dtb:sidebar">
+ <xsl:if test="//dtb:samp[@xml:space='preserve']">
+ <xsl:text>\usepackage{alltt} </xsl:text>
+ </xsl:if>
+
+ <xsl:if test="//dtb:sidebar|//dtb:prodnote">
<xsl:text>\usepackage{tcolorbox} </xsl:text>
<xsl:text>\tcbuselibrary{breakable} </xsl:text>
- <xsl:text>\tcbset{colframe=black!60,colback=white,arc=0mm,float} </xsl:text>
+ <xsl:text>\tcbset{colframe=black!60,colback=white,arc=0mm,float,parbox=false,enlarge top by=5mm} </xsl:text>
</xsl:if>
+ <xsl:if test="//dtb:linenum|//dtb:span[@class='linenum']">
+ <!-- Make sure the linenums are always on the left -->
+ <xsl:text>\sideparmargin{left} </xsl:text>
+ </xsl:if>
+
<xsl:text>\usepackage{hyperref} </xsl:text>
<xsl:value-of select="concat('\hypersetup{pdftitle={', my:quoteSpecialChars(//dtb:meta[@name='dc:title' or @name='dc:Title']/@content), '}, pdfauthor={', my:quoteSpecialChars(//dtb:meta[@name='dc:creator' or @name='dc:Creator']/@content), '}} ')"/>
<xsl:text>\usepackage{float} </xsl:text>
@@ -251,6 +323,10 @@
<xsl:text>\setsubsecheadstyle{\large\bfseries\raggedright} </xsl:text>
<xsl:text>\setsubsubsecheadstyle{\bfseries\raggedright} </xsl:text>
+ <!-- calculate the textheight minus the caption -->
+ <xsl:text>\newlength{\textheightMinusCaption} </xsl:text>
+ <xsl:text>\setlength{\textheightMinusCaption}{\textheight - \baselineskip} </xsl:text>
+
<xsl:if test="$pageStyle='plain'">
<!-- do not number the sections -->
<xsl:text>\setsecnumdepth{book} </xsl:text>
@@ -330,7 +406,12 @@
<!-- Make sure wrapped poetry lines are not indented -->
<xsl:text>\setlength{\vindent}{0em} </xsl:text>
-
+
+ <!-- Poem titles should be left aligned (instead of centered) -->
+ <xsl:if test="//dtb:poem/dtb:title">
+ <xsl:text>\renewcommand*{\PoemTitlefont}{\normalfont\large} </xsl:text>
+ </xsl:if>
+
<!-- New environment for nested pl-type lists -->
<xsl:text>\newenvironment{indentedlist}% </xsl:text>
<xsl:text> {\begin{list}{}{% </xsl:text>
@@ -398,14 +479,7 @@
<xsl:if test="$max_toc_depth > 0">
<xsl:text>\maxtocdepth{</xsl:text>
- <xsl:choose>
- <xsl:when test="$max_toc_depth=1"><xsl:text>chapter</xsl:text></xsl:when>
- <xsl:when test="$max_toc_depth=2"><xsl:text>section</xsl:text></xsl:when>
- <xsl:when test="$max_toc_depth=3"><xsl:text>subsection</xsl:text></xsl:when>
- <xsl:when test="$max_toc_depth=4"><xsl:text>subsubsection</xsl:text></xsl:when>
- <xsl:when test="$max_toc_depth=5"><xsl:text>paragraph</xsl:text></xsl:when>
- <xsl:when test="$max_toc_depth>5"><xsl:text>subparagraph</xsl:text></xsl:when>
- </xsl:choose>
+ <xsl:value-of select="substring($level_to_section_map/entry[@key=concat('level',$max_toc_depth)],2)"/>
<xsl:text>} </xsl:text>
</xsl:if>
</xsl:template>
@@ -516,12 +590,11 @@
</xsl:template>
<xsl:template match="dtb:head">
- <xsl:apply-templates/>
+ <xsl:apply-templates/>
</xsl:template>
- <xsl:template match="dtb:meta">
- <xsl:apply-templates/>
- </xsl:template>
+ <!-- Ignore meta data and links -->
+ <xsl:template match="dtb:meta|dtb:link"/>
<xsl:template match="dtb:book">
<xsl:text>\begin{document} </xsl:text>
@@ -529,7 +602,7 @@
<xsl:text>\raggedright </xsl:text>
</xsl:if>
<xsl:apply-templates/>
- <xsl:if test="//dtb:noteref and $endnotes = 'document'">
+ <xsl:if test="//(dtb:noteref|dtb:annoref) and $endnotes = 'document'">
<xsl:text>\printpagenotes </xsl:text>
</xsl:if>
<xsl:text>\end{document} </xsl:text>
@@ -575,7 +648,7 @@
<xsl:text>\chapter*{\ } </xsl:text>
</xsl:if>
<xsl:apply-templates/>
- <xsl:if test=".//dtb:noteref and $endnotes = 'chapter'">
+ <xsl:if test=".//(dtb:noteref|dtb:annoref) and $endnotes = 'chapter'">
<xsl:text>\printpagenotes* </xsl:text>
</xsl:if>
<xsl:if test="following::*[1][self::dtb:p]">
@@ -651,68 +724,47 @@
</xsl:template>
<xsl:template match="dtb:address">
- <xsl:apply-templates/>
+ <xsl:apply-templates/>
+ <xsl:text> </xsl:text>
</xsl:template>
-
- <xsl:template match="dtb:h1">
- <xsl:text>\chapter[</xsl:text>
- <xsl:value-of select="normalize-space(my:quoteSpecialChars(string()))"/>
- <xsl:text>]{</xsl:text>
- <xsl:apply-templates/>
- <xsl:text>} </xsl:text>
+
+ <xsl:template match="dtb:address/dtb:line">
+ <xsl:apply-templates/>
+ <xsl:if test="following-sibling::*"><xsl:text>\\</xsl:text></xsl:if>
+ <xsl:text> </xsl:text>
</xsl:template>
- <xsl:template match="dtb:h2">
- <xsl:text>\section[</xsl:text>
- <xsl:value-of select="normalize-space(my:quoteSpecialChars(string()))"/>
- <xsl:text>]{</xsl:text>
- <xsl:apply-templates/>
- <xsl:text>} </xsl:text>
+ <xsl:template match="dtb:h1|dtb:h2|dtb:h3|dtb:h4|dtb:h5|dtb:h6">
+ <xsl:variable name="level" select="local-name(ancestor::dtb:*[matches(local-name(),'^level[1-6]$')][1])"/>
+ <xsl:value-of select="$level_to_section_map/entry[@key=$level]"/>
+ <xsl:text>[</xsl:text>
+ <xsl:value-of select="normalize-space(my:quoteSpecialChars(string()))"/>
+ <xsl:text>]{</xsl:text>
+ <xsl:apply-templates/>
+ <xsl:text>} </xsl:text>
+ <xsl:apply-templates select="my:first-pagenum-anchor-before-headline(.)" mode="inside-headline"/>
</xsl:template>
- <xsl:template match="dtb:h3">
- <xsl:text>\subsection[</xsl:text>
- <xsl:value-of select="normalize-space(my:quoteSpecialChars(string()))"/>
- <xsl:text>]{</xsl:text>
- <xsl:apply-templates/>
- <xsl:text>} </xsl:text>
+ <xsl:template match="dtb:bridgehead">
+ <!-- a bridgehead inside level{N} is displayed like a h{N+1} (without the toc entry) -->
+ <xsl:variable name="level"
+ select="concat('level',number(substring-after(local-name(ancestor::dtb:*[matches(local-name(),'^level[1-6]$')][1]),'level'))+1)"/>
+ <!-- FIXME: This will fail if we are inside a level6. I guess we should define a LaTeX
+ command \subsubparagraph*, give it some styling and add it to level_to_section_map
+ -->
+ <xsl:value-of select="$level_to_section_map/entry[@key=$level]"/>
+ <xsl:text>*{</xsl:text>
+ <xsl:apply-templates/>
+ <xsl:text>} </xsl:text>
</xsl:template>
- <xsl:template match="dtb:h4">
- <xsl:text>\subsubsection[</xsl:text>
- <xsl:value-of select="normalize-space(my:quoteSpecialChars(string()))"/>
- <xsl:text>]{</xsl:text>
- <xsl:apply-templates/>
- <xsl:text>} </xsl:text>
- </xsl:template>
-
- <xsl:template match="dtb:h5">
- <xsl:text>\paragraph[</xsl:text>
- <xsl:value-of select="normalize-space(my:quoteSpecialChars(string()))"/>
- <xsl:text>]{</xsl:text>
- <xsl:apply-templates/>
- <xsl:text>} </xsl:text>
- </xsl:template>
-
- <xsl:template match="dtb:h6">
- <xsl:text>\subparagraph[</xsl:text>
- <xsl:value-of select="normalize-space(my:quoteSpecialChars(string()))"/>
- <xsl:text>]{</xsl:text>
- <xsl:apply-templates/>
- <xsl:text>} </xsl:text>
- </xsl:template>
-
- <xsl:template match="dtb:bridgehead">
- <xsl:apply-templates/>
- </xsl:template>
-
<xsl:template match="dtb:list[not(@type)]">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="dtb:lic">
<xsl:apply-templates/>
- <xsl:if test="following-sibling::dtb:lic or normalize-space(following-sibling::text())!=''">
+ <xsl:if test="not(preceding-sibling::dtb:lic) and (following-sibling::dtb:lic or normalize-space(following-sibling::text())!='')">
<xsl:text>\dotfill </xsl:text>
</xsl:if>
</xsl:template>
@@ -727,10 +779,14 @@
<xsl:apply-templates/>
</xsl:template>
- <xsl:template match="dtb:noteref">
+ <xsl:template match="dtb:noteref|dtb:annoref">
<xsl:variable name="refText">
- <xsl:apply-templates select="//dtb:note[@id=translate(current()/@idref,'#','')]" mode="footnotes"/>
+ <xsl:apply-templates select="//(dtb:note|dtb:annotation)[@id=translate(current()/@idref,'#','')]" mode="footnotes"/>
</xsl:variable>
+ <xsl:if test="self::dtb:annoref">
+ <!-- for annorefs we want to keep the content -->
+ <xsl:apply-templates/>
+ </xsl:if>
<xsl:choose>
<xsl:when test="$endnotes = 'none'">
<xsl:text>\footnotemark</xsl:text>
@@ -748,33 +804,26 @@
</xsl:template>
<xsl:template match="dtb:img">
- <xsl:text>\begin{figure}[htb] </xsl:text>
- <xsl:value-of select="$includegraphics-command"/>
- <xsl:value-of select="@src"/>
- <xsl:text>} </xsl:text>
+ <xsl:variable name="captions" select="//dtb:caption[@id=tokenize(translate(current()/@imgref,'#',''), '\s+')]|following-sibling::*[1][self::dtb:caption]"/>
+ <xsl:text>\begin{figure}[htbp!] </xsl:text>
+ <xsl:value-of select="my:includegraphics-command(@src, exists($captions))"/>
<!-- a caption is associated with an image through an imgref attribute or a bit less formal
simply by following it immediately -->
- <xsl:apply-templates
- select="//dtb:caption[@id=tokenize(translate(current()/@imgref,'#',''), '\s+')]|following-sibling::*[1][self::dtb:caption]" mode="referenced-caption" />
+ <xsl:apply-templates select="$captions" mode="referenced-caption" />
<xsl:text>\end{figure} </xsl:text>
</xsl:template>
<xsl:template match="dtb:h1/dtb:img|dtb:h2/dtb:img|dtb:h3/dtb:img|dtb:h4/dtb:img|dtb:h5/dtb:img|dtb:h6/dtb:img">
- <xsl:value-of select="$includegraphics-command"/>
- <xsl:value-of select="@src"/>
- <xsl:text>}</xsl:text>
+ <xsl:value-of select="my:includegraphics-command(@src, false())"/>
</xsl:template>
<xsl:template match="dtb:table//dtb:img|dtb:sidebar//dtb:img" priority="10">
+ <xsl:variable name="captions" select="//dtb:caption[@id=tokenize(translate(current()/@imgref,'#',''), '\s+')]|following-sibling::*[1][self::dtb:caption]"/>
<!-- images inside tables and sidebars do not float -->
- <xsl:value-of select="$includegraphics-command"/>
- <xsl:value-of select="@src"/>
- <xsl:text>} </xsl:text>
+ <xsl:value-of select="my:includegraphics-command(@src, exists($captions))"/>
<!-- a caption is associated with an image through an imgref attribute or a bit less formal
simply by following it immediately -->
- <xsl:apply-templates
- select="//dtb:caption[@id=tokenize(translate(current()/@imgref,'#',''), '\s+')]|following-sibling::*[1][self::dtb:caption]" mode="referenced-caption">
- <xsl:with-param name="from-within-table" select="true()"/>
+ <xsl:apply-templates select="$captions" mode="referenced-caption">
</xsl:apply-templates>
</xsl:template>
@@ -783,14 +832,9 @@
</xsl:template>
<xsl:template match="dtb:caption" mode="referenced-caption">
- <xsl:param name="from-within-table" select="false()"/>
- <xsl:if test="not($from-within-table)">
- <xsl:text>\caption{</xsl:text>
- </xsl:if>
- <xsl:apply-templates/>
- <xsl:if test="not($from-within-table)">
- <xsl:text>} </xsl:text>
- </xsl:if>
+ <xsl:variable name="caption" select="my:cleanCaptions(.)"/>
+ <xsl:value-of select="concat('\legend{',$caption,'} ')"/>
+ <xsl:value-of select="concat('\addcontentsline{lof}{figure}{',$caption,'} ')"/>
</xsl:template>
<!-- What's the point of a div? Usually you want some visual clue
@@ -845,10 +889,6 @@
<xsl:apply-templates/>
</xsl:template>
- <xsl:template match="dtb:annotation">
- <xsl:apply-templates/>
- </xsl:template>
-
<xsl:template match="dtb:author">
<xsl:apply-templates/>
</xsl:template>
@@ -875,34 +915,42 @@
<xsl:text> </xsl:text>
</xsl:template>
- <xsl:template match="dtb:dateline">
- <xsl:apply-templates/>
+ <xsl:template match="dtb:dateline">
+ <xsl:apply-templates/>
+ <xsl:text> </xsl:text>
</xsl:template>
- <xsl:template match="dtb:epigraph">
- <xsl:apply-templates/>
+ <xsl:template match="dtb:epigraph">
+ <xsl:apply-templates/>
</xsl:template>
- <xsl:template match="dtb:note">
+ <xsl:template match="dtb:note|dtb:annotation">
<!--<xsl:apply-templates/>-->
</xsl:template>
- <xsl:template match="dtb:note" mode="footnotes">
+ <xsl:template match="dtb:note|dtb:annotation" mode="footnotes">
<xsl:apply-templates/>
</xsl:template>
- <xsl:template match="dtb:note/dtb:p">
+ <xsl:template match="dtb:note/dtb:p|dtb:annotation/dtb:p">
<xsl:apply-templates/>
<xsl:if test="position() != last()"><xsl:text> </xsl:text></xsl:if>
</xsl:template>
<xsl:template match="dtb:sidebar">
- <xsl:text>\begin{tcolorbox}[breakable,floatplacement=htbp] </xsl:text>
+ <xsl:text>\begin{tcolorbox}[breakable,floatplacement=htp!] </xsl:text>
<xsl:text>\raggedright </xsl:text>
<xsl:apply-templates/>
<xsl:text>\end{tcolorbox} </xsl:text>
</xsl:template>
+ <!-- <xsl:template match="dtb:sidebar[@class='no-float']"> -->
+ <!-- <xsl:text>\begin{tcolorbox}[breakable,nofloat] </xsl:text> -->
+ <!-- <xsl:text>\raggedright </xsl:text> -->
+ <!-- <xsl:apply-templates/> -->
+ <!-- <xsl:text>\end{tcolorbox} </xsl:text> -->
+ <!-- </xsl:template> -->
+
<xsl:template match="dtb:sidebar//dtb:sidebar">
<!-- a nested sidebar should obviously not float and cannot be
breakable due to limitations of tcolorbox -->
@@ -922,14 +970,7 @@
<xsl:variable name="level">
<xsl:value-of select="count(ancestor::dtb:level)"/>
</xsl:variable>
- <xsl:choose>
- <xsl:when test="$level=1"><xsl:text>\chapter</xsl:text></xsl:when>
- <xsl:when test="$level=2"><xsl:text>\section</xsl:text></xsl:when>
- <xsl:when test="$level=3"><xsl:text>\subsection</xsl:text></xsl:when>
- <xsl:when test="$level=4"><xsl:text>\subsubsection</xsl:text></xsl:when>
- <xsl:when test="$level=5"><xsl:text>\paragraph</xsl:text></xsl:when>
- <xsl:when test="$level>5"><xsl:text>\subparagraph</xsl:text></xsl:when>
- </xsl:choose>
+ <xsl:value-of select="$level_to_section_map/entry[@key=concat('level',$level)]"/>
<xsl:text>[</xsl:text>
<xsl:value-of select="text()"/>
<xsl:text>]{</xsl:text>
@@ -997,25 +1038,56 @@
</xsl:template>
<xsl:template match="dtb:table">
+ <xsl:variable name="normalized-table">
+ <xsl:apply-templates mode="normalize-table" select="."/>
+ </xsl:variable>
<xsl:text>\begin{table}[H] </xsl:text>
<xsl:text>\begin{tabulary}{\textwidth}{|</xsl:text>
<xsl:variable name="numcols">
- <xsl:value-of select="max(for $row in descendant::dtb:tr return count($row/(dtb:td|dtb:th)))"/>
+ <xsl:value-of select="max(for $row in $normalized-table//dtb:tr return count($row/(dtb:td|dtb:th)))"/>
</xsl:variable>
<!-- make all columns left justified and let tabulary deal with spacing of the table -->
<xsl:value-of select="string-join((for $col in 1 to $numcols return 'L'),'|')"/>
<xsl:text>|} \hline </xsl:text>
<!-- Make sure the table is in the right order and also handle tables without tbody -->
- <xsl:apply-templates select="dtb:thead, dtb:tbody, dtb:tfoot, dtb:tr"/>
+ <xsl:apply-templates select="$normalized-table/dtb:table/dtb:thead, $normalized-table/dtb:table/dtb:tbody, $normalized-table/dtb:table/dtb:tfoot, $normalized-table/dtb:table/dtb:tr"/>
<xsl:text>\end{tabulary} </xsl:text>
<xsl:apply-templates select="dtb:caption"/>
<xsl:text>\end{table} </xsl:text>
</xsl:template>
+ <xsl:template match="dtb:table" mode="normalize-table">
+ <xsl:variable name="dtb:tr" as="element()*">
+ <xsl:call-template name="dtb:insert-covered-table-cells">
+ <xsl:with-param name="table_cells" select="dtb:tr/(dtb:td|dtb:th)"/>
+ <xsl:with-param name="insert_if_colspan" select="false()" tunnel="yes"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:copy>
+ <xsl:apply-templates mode="#current" select="(dtb:thead, $dtb:tr, dtb:tbody, dtb:tfoot)"/>
+ </xsl:copy>
+ </xsl:template>
+
+ <xsl:template match="dtb:thead|dtb:tbody|dtb:tfoot" mode="normalize-table">
+ <xsl:variable name="dtb:tr" as="element()*">
+ <xsl:call-template name="dtb:insert-covered-table-cells">
+ <xsl:with-param name="table_cells" select="dtb:tr/(dtb:td|dtb:th)"/>
+ <xsl:with-param name="insert_if_colspan" select="false()" tunnel="yes"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:copy>
+ <xsl:apply-templates mode="#current" select="$dtb:tr"/>
+ </xsl:copy>
+ </xsl:template>
+
+ <xsl:template match="dtb:tr" mode="normalize-table">
+ <xsl:sequence select="."/>
+ </xsl:template>
+
<xsl:template match="dtb:table/dtb:caption">
- <xsl:text>\caption{</xsl:text>
- <xsl:apply-templates/>
- <xsl:text>} </xsl:text>
+ <xsl:variable name="caption" select="my:cleanCaptions(.)"/>
+ <xsl:value-of select="concat('\legend{',$caption,'} ')"/>
+ <xsl:value-of select="concat('\addcontentsline{lot}{table}{',$caption,'} ')"/>
</xsl:template>
<xsl:template match="dtb:tbody">
@@ -1032,7 +1104,11 @@
<xsl:template match="dtb:tr">
<xsl:apply-templates/>
- <xsl:text>\\ \hline </xsl:text>
+ <xsl:text>\\ </xsl:text>
+ <xsl:if test="not(following-sibling::dtb:tr[1]//(dtb:td|dtb:th)[@covered-table-cell='yes'])">
+ <xsl:text>\hline</xsl:text>
+ </xsl:if>
+ <xsl:text> </xsl:text>
</xsl:template>
<xsl:template match="dtb:th">
@@ -1045,20 +1121,34 @@
</xsl:template>
<xsl:template match="dtb:td">
- <xsl:if test="preceding-sibling::dtb:td">
- <xsl:text> & </xsl:text>
- </xsl:if>
- <xsl:apply-templates/>
+ <xsl:if test="preceding-sibling::dtb:td">
+ <xsl:text> & </xsl:text>
+ </xsl:if>
+ <xsl:apply-templates/>
</xsl:template>
- <xsl:template match="dtb:colgroup">
- <xsl:apply-templates/>
+ <xsl:template match="dtb:td[@colspan > 1]">
+ <xsl:if test="preceding-sibling::dtb:td">
+ <xsl:text> & </xsl:text>
+ </xsl:if>
+ <xsl:text>\multicolumn{</xsl:text><xsl:value-of select="@colspan"/><xsl:text>}{l|}{</xsl:text>
+ <xsl:apply-templates/>
+ <xsl:text>}</xsl:text>
</xsl:template>
- <xsl:template match="dtb:col">
- <xsl:apply-templates/>
+ <xsl:template match="dtb:th[@colspan > 1]">
+ <xsl:if test="preceding-sibling::dtb:th">
+ <xsl:text> & </xsl:text>
+ </xsl:if>
+ <xsl:text>\multicolumn{</xsl:text><xsl:value-of select="@colspan"/><xsl:text>}{l|}{\textbf{</xsl:text>
+ <xsl:apply-templates/>
+ <xsl:text>}}</xsl:text>
</xsl:template>
+ <xsl:template match="dtb:colgroup|dtb:col">
+ <!-- ignore -->
+ </xsl:template>
+
<xsl:template match="dtb:poem">
<xsl:text>\begin{verse} </xsl:text>
<xsl:apply-templates/>
@@ -1072,7 +1162,9 @@
</xsl:template>
<xsl:template match="dtb:poem/dtb:title">
- <xsl:apply-templates/>
+ <xsl:text>\PoemTitle*[]{</xsl:text>
+ <xsl:apply-templates/>
+ <xsl:text>} </xsl:text>
</xsl:template>
<xsl:template match="dtb:cite/dtb:title">
@@ -1083,28 +1175,27 @@
<xsl:apply-templates/>
</xsl:template>
- <xsl:template match="dtb:code">
- <xsl:text>\texttt{</xsl:text>
+ <xsl:template match="dtb:q">
+ <xsl:text>\textsl{</xsl:text>
<xsl:apply-templates/>
<xsl:text>}</xsl:text>
</xsl:template>
- <xsl:template match="dtb:kbd">
- <xsl:text>\texttt{</xsl:text>
- <xsl:apply-templates/>
- <xsl:text>}</xsl:text>
+ <xsl:template match="dtb:samp|dtb:code|dtb:kbd">
+ <xsl:text>\texttt{</xsl:text>
+ <xsl:apply-templates/>
+ <xsl:text>}</xsl:text>
</xsl:template>
- <xsl:template match="dtb:q">
- <xsl:text>\textsl{</xsl:text>
- <xsl:apply-templates/>
- <xsl:text>}</xsl:text>
+ <xsl:template match="dtb:samp[@xml:space='preserve']|dtb:code[@xml:space='preserve']">
+ <xsl:text>\begin{alltt}</xsl:text>
+ <xsl:apply-templates/>
+ <xsl:text>\end{alltt}</xsl:text>
</xsl:template>
- <xsl:template match="dtb:samp">
- <xsl:text>\texttt{</xsl:text>
- <xsl:apply-templates/>
- <xsl:text>}</xsl:text>
+ <xsl:template match="dtb:samp[@xml:space='preserve']//text()|dtb:code[@xml:space='preserve']//text()">
+ <!-- escape backslash and curly braces -->
+ <xsl:value-of select="replace(replace(., '\\', '\\textbackslash '), '(\{|\})', '\\$1')"/>
</xsl:template>
<xsl:template match="dtb:linegroup">
@@ -1127,15 +1218,26 @@
<xsl:variable name="num">
<xsl:apply-templates/>
</xsl:variable>
- <xsl:value-of select="concat('\sidepar[',$num,']{',$num,'} ')"/>
+ <xsl:value-of select="concat('\sidepar[',$num,']{',$num,'}')"/>
</xsl:template>
+ <xsl:template match="dtb:line//text()[(preceding-sibling::*|preceding-sibling::text())[1]/self::dtb:linenum]">
+ <!-- trim whitespace after the linenum element -->
+ <xsl:value-of select="my:quoteSpecialChars(replace(string(current()), '^\s+(.*)$', '$1'))"/>
+ </xsl:template>
+
<xsl:template match="dtb:prodnote">
<xsl:text>\begin{tcolorbox}[colback=black!10,floatplacement=h!]</xsl:text>
<xsl:text> \raggedright </xsl:text>
<xsl:apply-templates/>
<xsl:text>\end{tcolorbox} </xsl:text>
+ </xsl:template>
+ <xsl:template match="dtb:p/dtb:prodnote">
+ <!-- inline prodnote -->
+ <xsl:text>\begin{tcolorbox}[colback=black!10,nofloat,after={}]</xsl:text>
+ <xsl:apply-templates/>
+ <xsl:text>\end{tcolorbox} </xsl:text>
</xsl:template>
<xsl:template match="dtb:rearmatter">
@@ -1144,9 +1246,50 @@
</xsl:template>
<xsl:template match="dtb:a">
- <xsl:apply-templates/>
+ <xsl:apply-templates/>
</xsl:template>
+ <!-- cross references that contain only original page numbers -->
+ <!-- We drop the original page number and replace it with a page reference -->
+ <xsl:template match="dtb:a[@class='pageref' and starts-with(@href, '#')]">
+ <xsl:value-of select="concat('\pageref{',substring(@href,2),'}')"/>
+ </xsl:template>
+
+ <xsl:template match="dtb:a[@id != '']">
+ <!-- create a label so we can later add a reference to it -->
+ <xsl:value-of select="concat('\label{',@id,'} ')"/>
+ <xsl:apply-templates/>
+ </xsl:template>
+
+ <xsl:function name="my:is-pagenum-anchor" as="xs:boolean">
+ <xsl:param name="anchor" as="element()"/>
+ <xsl:sequence
+ select="exists($anchor/preceding-sibling::*[1][self::dtb:pagenum])"/>
+ </xsl:function>
+
+ <xsl:function name="my:first-pagenum-anchor-before-headline" as="element()?">
+ <xsl:param name="headline" as="element()"/>
+ <xsl:sequence
+ select="$headline/preceding-sibling::*[1][self::dtb:a and my:is-pagenum-anchor(.)]"/>
+ </xsl:function>
+
+ <xsl:function name="my:is-first-pagenum-anchor-before-headline" as="xs:boolean">
+ <xsl:param name="anchor" as="element()"/>
+ <xsl:sequence
+ select="exists($anchor[my:is-pagenum-anchor(.)]/following-sibling::*[1][matches(name(),'h[1-6]')])"/>
+ </xsl:function>
+
+ <xsl:template match="dtb:a[@id != '']" mode="inside-headline">
+ <!-- create a label so we can later add a reference to it -->
+ <xsl:value-of select="concat('\label{',@id,'} ')"/>
+ <xsl:apply-templates/>
+ </xsl:template>
+
+ <xsl:template match="dtb:a[@id != '' and my:is-first-pagenum-anchor-before-headline(.)]" priority="10">
+ <!-- ingore anchors before a headline otherwise the label will be
+ refering to the wrong page -->
+ </xsl:template>
+
<xsl:template match="dtb:em">
<xsl:choose>
<xsl:when test="$replace_em_with_quote = 'true'">
@@ -1215,14 +1358,6 @@
<xsl:apply-templates/>
</xsl:template>
- <xsl:template match="dtb:a[@href]">
- <xsl:apply-templates/>
- </xsl:template>
-
- <xsl:template match="dtb:annoref">
- <xsl:apply-templates/>
- </xsl:template>
-
<!-- remove excessive space and insert non-breaking spaces inside abbrevs -->
<xsl:template match="dtb:abbr//text()">
<xsl:value-of select="my:quoteSpecialChars(replace(normalize-space(string(current())), ' ', ' '))"/>
Modified: branches/deploy.mtm.se/transformers/se_tpb_dtbook2latex/dtbook2latex_sbs.xsl
===================================================================
--- branches/deploy.mtm.se/transformers/se_tpb_dtbook2latex/dtbook2latex_sbs.xsl 2014-01-14 07:58:47 UTC (rev 2790)
+++ branches/deploy.mtm.se/transformers/se_tpb_dtbook2latex/dtbook2latex_sbs.xsl 2014-01-14 08:09:44 UTC (rev 2791)
@@ -227,4 +227,24 @@
<xsl:text> </xsl:text>
</xsl:template>
+ <!-- The span@class='linenum' is a "proprietary extension" of SBS if you will
+ that allows to markup books where you have very long passages of numbered
+ lines, i.e. basically spanning the whole book. Linegroup and line is not
+ suited for this as you can no longer markup paragraphs, blockquotes or
+ anything else for that matter. -->
+ <xsl:template match="dtb:span[@class='linenum']">
+ <xsl:variable name="num">
+ <xsl:apply-templates/>
+ </xsl:variable>
+ <xsl:if test="my:has-preceding-non-empty-textnode-within-block(.)">
+ <xsl:text>\\ </xsl:text>
+ </xsl:if>
+ <xsl:value-of select="concat('\sidepar[',$num,']{',$num,'}')"/>
+ </xsl:template>
+
+ <xsl:template match="text()[preceding-sibling::*[1][self::dtb:span[@class='linenum']]]">
+ <!-- trim whitespace after the linenum span -->
+ <xsl:value-of select="my:quoteSpecialChars(replace(string(current()), '^\s+', ''))"/>
+ </xsl:template>
+
</xsl:stylesheet>
Copied: branches/deploy.mtm.se/transformers/se_tpb_dtbook2latex/table-utils.xsl (from rev 2790, trunk/dmfc/transformers/se_tpb_dtbook2latex/table-utils.xsl)
===================================================================
--- branches/deploy.mtm.se/transformers/se_tpb_dtbook2latex/table-utils.xsl (rev 0)
+++ branches/deploy.mtm.se/transformers/se_tpb_dtbook2latex/table-utils.xsl 2014-01-14 08:09:44 UTC (rev 2791)
@@ -0,0 +1,78 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:dtb="http://www.daisy.org/z3986/2005/dtbook/"
+ xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ exclude-result-prefixes="dtb">
+
+ <!-- Copy a sequence of rows and normalize row- and colspans, i.e.
+ insert empty cells instead for row- and colspans -->
+ <xsl:template name="dtb:insert-covered-table-cells" as="element()*">
+ <xsl:param name="table_cells" as="element()*"/>
+ <xsl:param name="covered_cells" as="element()*"/>
+ <xsl:param name="current_row" as="element()*"/>
+ <xsl:param name="row_count" as="xs:integer" select="0"/>
+ <xsl:param name="clone_cells" as="xs:boolean" select="false()" tunnel="yes"/>
+ <xsl:param name="insert_if_colspan" as="xs:boolean" select="true()" tunnel="yes"/>
+ <xsl:param name="insert_if_rowspan" as="xs:boolean" select="true()" tunnel="yes"/>
+ <xsl:variable name="cell_count" select="count($current_row)"/>
+ <xsl:choose>
+ <xsl:when test="$covered_cells[@row=($row_count+1) and @col=($cell_count+1)]">
+ <xsl:call-template name="dtb:insert-covered-table-cells">
+ <xsl:with-param name="table_cells" select="$table_cells"/>
+ <xsl:with-param name="current_row" select="($current_row, $covered_cells[@row=($row_count+1) and @col=($cell_count+1)])"/>
+ <xsl:with-param name="row_count" select="$row_count"/>
+ <xsl:with-param name="covered_cells" select="$covered_cells[not(@row=($row_count+1) and @col=($cell_count+1))]"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="$table_cells[1][count(parent::*/preceding-sibling::dtb:tr)=$row_count]">
+ <xsl:variable name="new_covered_cells" as="element()*">
+ <xsl:variable name="colspan" as="xs:integer" select="if ($table_cells[1]/@colspan) then $table_cells[1]/@colspan else 1"/>
+ <xsl:variable name="rowspan" as="xs:integer" select="if ($table_cells[1]/@rowspan) then $table_cells[1]/@rowspan else 1"/>
+ <xsl:if test="($insert_if_colspan and $colspan > 1) or ($insert_if_rowspan and $rowspan > 1)">
+ <xsl:sequence select="for $i in 1 to $rowspan return
+ for $j in 1 to $colspan return
+ if (not($i=1 and $j=1)) then
+ dtb:covered-table-cell($row_count + $i, $cell_count + $j, $table_cells[1], $clone_cells)
+ else ()"/>
+ </xsl:if>
+ </xsl:variable>
+ <xsl:call-template name="dtb:insert-covered-table-cells">
+ <xsl:with-param name="table_cells" select="$table_cells[position() > 1]"/>
+ <xsl:with-param name="current_row" select="($current_row, $table_cells[1])"/>
+ <xsl:with-param name="row_count" select="$row_count"/>
+ <xsl:with-param name="covered_cells" select="($covered_cells, $new_covered_cells)"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:if test="exists($current_row)">
+ <xsl:element name="dtb:tr">
+ <xsl:sequence select="$current_row"/>
+ </xsl:element>
+ <xsl:if test="exists($table_cells)">
+ <xsl:call-template name="dtb:insert-covered-table-cells">
+ <xsl:with-param name="table_cells" select="$table_cells"/>
+ <xsl:with-param name="current_row" select="()"/>
+ <xsl:with-param name="row_count" select="$row_count + 1"/>
+ <xsl:with-param name="covered_cells" select="$covered_cells"/>
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:if>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <xsl:function name="dtb:covered-table-cell">
+ <xsl:param name="row"/>
+ <xsl:param name="col"/>
+ <xsl:param name="original_cell"/>
+ <xsl:param name="clone_cells"/>
+ <xsl:element namespace="{namespace-uri($original_cell)}" name="{name($original_cell)}" >
+ <xsl:attribute name="row" select="$row"/>
+ <xsl:attribute name="col" select="$col"/>
+ <xsl:attribute name="covered-table-cell" select="'yes'"/>
+ <xsl:sequence select="if ($clone_cells) then $original_cell/node() else ()"/>
+ </xsl:element>
+ </xsl:function>
+
+</xsl:stylesheet>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <joe...@us...> - 2014-01-14 07:58:51
|
Revision: 2790
http://sourceforge.net/p/daisymfc/code/2790
Author: joeha480
Date: 2014-01-14 07:58:47 +0000 (Tue, 14 Jan 2014)
Log Message:
-----------
Updated dotify and braille utils builds
Added double line spacing option to DTBookToPEF script/transformer
Modified Paths:
--------------
trunk/dmfc/lib/brailleUtils-catalog.jar
trunk/dmfc/lib/brailleUtils-core.jar
trunk/dmfc/lib/dotify-translator.jar
trunk/dmfc/lib/dotify.jar
trunk/dmfc/scripts/create_distribute/pef/DTBookToPEF.taskScript
trunk/dmfc/transformers/org_pef_dtbook2pef/transformer.tdf
Modified: trunk/dmfc/lib/brailleUtils-catalog.jar
===================================================================
(Binary files differ)
Modified: trunk/dmfc/lib/brailleUtils-core.jar
===================================================================
(Binary files differ)
Modified: trunk/dmfc/lib/dotify-translator.jar
===================================================================
(Binary files differ)
Modified: trunk/dmfc/lib/dotify.jar
===================================================================
(Binary files differ)
Modified: trunk/dmfc/scripts/create_distribute/pef/DTBookToPEF.taskScript
===================================================================
--- trunk/dmfc/scripts/create_distribute/pef/DTBookToPEF.taskScript 2014-01-10 12:35:13 UTC (rev 2789)
+++ trunk/dmfc/scripts/create_distribute/pef/DTBookToPEF.taskScript 2014-01-14 07:58:47 UTC (rev 2790)
@@ -43,6 +43,7 @@
<datatype>
<enum>
<item nicename="32 characters wide" value="A4-w32" />
+ <item nicename="32 characters wide (double line spacing)" value="A4-w32-dls" />
<item nicename="42 characters wide" value="FA44-w42" />
<item nicename="50 characters wide" value="w50" />
</enum>
Modified: trunk/dmfc/transformers/org_pef_dtbook2pef/transformer.tdf
===================================================================
--- trunk/dmfc/transformers/org_pef_dtbook2pef/transformer.tdf 2014-01-10 12:35:13 UTC (rev 2789)
+++ trunk/dmfc/transformers/org_pef_dtbook2pef/transformer.tdf 2014-01-14 07:58:47 UTC (rev 2790)
@@ -52,6 +52,7 @@
<example>A4-w32</example>
<enum>
<value>A4-w32</value>
+ <value>A4-w32-dls</value>
<value>FA44-w42</value>
<value>w50</value>
</enum>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ce...@us...> - 2014-01-10 12:35:16
|
Revision: 2789
http://sourceforge.net/p/daisymfc/code/2789
Author: cegli
Date: 2014-01-10 12:35:13 +0000 (Fri, 10 Jan 2014)
Log Message:
-----------
Add support for building a debian package
The Debian package is built using the jdeb ant plugin which has to be
installed. The deb installs all the files under
/usr/lib/daisy-pipeline and creates links for the launcher under
/usr/bin and for the doc under /usr/share/doc/daisy-pipeline.
The launcher has been slightly enhanced to add support for resolving
symlinks to support above scenario.
Modified Paths:
--------------
trunk/dmfc/launchers/pipeline.sh
Added Paths:
-----------
trunk/dmfc/build-deb.xml
trunk/dmfc/debian/
trunk/dmfc/debian/control
Added: trunk/dmfc/build-deb.xml
===================================================================
--- trunk/dmfc/build-deb.xml (rev 0)
+++ trunk/dmfc/build-deb.xml 2014-01-10 12:35:13 UTC (rev 2789)
@@ -0,0 +1,137 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<project name="Pipeline debian package" default="package">
+ <description>Buildfile for a Debian package for the Daisy Pipeline</description>
+
+ <import file="${basedir}/build-core.xml"/>
+
+ <property name="deb.name" value="daisy-pipeline"/>
+ <property name="deb.version" value="${ISO-TODAY}-2"/>
+ <property name="deb.install.root" value="/usr"/>
+ <property name="deb.install.lib" value="${deb.install.root}/lib/${deb.name}"/>
+ <property name="deb.install.doc" value="${deb.install.root}/share/doc/${deb.name}"/>
+
+ <target name="package" depends="buildCoreJar,buildUtil,createDistributionDir">
+ <taskdef name="deb" classname="org.vafer.jdeb.ant.DebAntTask"/>
+
+ <mkdir dir="${build.dir}/debian/control"/>
+
+ <copy todir="${build.dir}/debian/control">
+ <fileset dir="${base.dir}/debian"/>
+ <filterset begintoken="[[" endtoken="]]">
+ <filter token="version" value="${deb.version}"/>
+ <filter token="name" value="${deb.name}"/>
+ </filterset>
+ </copy>
+
+ <deb destfile="${build.dir}/${deb.name}_${deb.version}_all.deb" control="${build.dir}/debian/control">
+ <!-- Pipeline core -->
+ <data src="${distribution.dir}" type="directory">
+ <mapper type="perm" prefix="${deb.install.lib}"/>
+ <include name="pipeline.jar"/>
+ </data>
+ <!-- Util library -->
+ <data src="${distribution.dir}" type="directory">
+ <mapper type="perm" prefix="${deb.install.lib}/lib"/>
+ <include name="org.daisy.util.jar"/>
+ </data>
+ <!-- Required JARs -->
+ <data src="${base.dir}/lib" type="directory">
+ <mapper type="perm" prefix="${deb.install.lib}/lib"/>
+ <include name="batik-css.jar"/>
+ <include name="batik-util.jar"/>
+ <include name="chardet.jar"/>
+ <include name="commons-cli-1.1.jar"/>
+ <include name="commons-pool-1.4.jar"/>
+ <include name="epubcheck-3.0.jar"/>
+ <include name="icu4j-3_8.jar"/>
+ <!-- <include name="icu4j-charsets.jar"/> -->
+ <include name="jaudiotagger.jar"/>
+ <include name="jl1.0.jar"/>
+ <include name="junit-4.7.jar"/>
+ <include name="log4j-1.2.15.jar"/>
+ <include name="jing.jar"/>
+ <include name="xml-apis.jar"/>
+ <include name="sac.jar"/>
+ <include name="saxon.jar"/>
+ <include name="saxon8.jar"/>
+ <include name="saxon8-dom.jar"/>
+ <include name="serializer.jar"/>
+ <include name="slf4j-api-1.5.6.jar"/>
+ <include name="slf4j-log4j12-1.5.6.jar"/>
+ <include name="stax-api-1.0.1.jar"/>
+ <include name="tagsoup-1.2.jar"/>
+ <include name="tritonus_remaining-0.3.6.jar"/>
+ <include name="tritonus_share-0.3.6.jar"/>
+ <include name="wstx-lgpl-3.2.8.jar"/>
+ <include name="xalan.jar"/>
+ <include name="xercesImpl.jar"/>
+ <include name="zedval.jar"/>
+ <include name="brailleUtils-core.jar"/>
+ <include name="brailleUtils-catalog.jar"/>
+ <include name="dotify.jar"/>
+ <include name="dotify-translator.jar"/>
+ <include name="texhyphj.jar"/>
+ </data>
+ <!-- Transformers -->
+ <data src="${base.dir}/transformers" type="directory">
+ <mapper type="perm" prefix="${deb.install.lib}/transformers"/>
+ <include name="**/*.*"/>
+ <exclude name="se_tpb_aligner/**/*.*"/>
+ <exclude name="int_daisy_filesetEncryptor/**/*.*"/>
+ <exclude name="uk_rnib_odf2dtbook/**/*.*"/>
+ <exclude name="se_tpb_speechgenerator/**/*.*"/>
+ <exclude name="int_daisy_xukCreator/**/*.*"/>
+ <exclude name="**/*.java"/>
+ <exclude name="*.jar"/>
+ <!-- exclude some stuff which only works on windows or mac -->
+ <exclude name="ca_cnib_rtf2dtbook/rtf2xml-win/**/*.*"/>
+ <exclude name="se_tpb_speechgen2/external/win/**/*.*"/>
+ <exclude name="se_tpb_speechgen2/lib/*.*"/>
+ <exclude name="se_tpb_speechgen2/external/MacOS/*.*"/>
+ <!-- exclude vcs control files -->
+ <exclude name="**/.cvsignore"/>
+ </data>
+ <!-- Property files -->
+ <data src="${base.dir}/bin" type="directory">
+ <mapper type="perm" prefix="${deb.install.lib}"/>
+ <include name="pipeline.properties"/>
+ <include name="pipeline.user.properties"/>
+ </data>
+ <!-- Pipeline RMI files -->
+ <data src="${base.dir}/rmi" type="directory">
+ <mapper type="perm" prefix="${deb.install.lib}/rmi"/>
+ <include name="**/*.*"/>
+ </data>
+ <!-- Launcher shell scripts -->
+ <data src="${base.dir}/launchers" type="directory">
+ <mapper type="perm" filemode="755" prefix="${deb.install.lib}"/>
+ <include name="pipeline.sh"/>
+ </data>
+ <!-- Link to the launcher -->
+ <link name="/usr/bin/daisy-pipeline" target="${deb.install.lib}/pipeline.sh"/>
+ <!-- Scripts -->
+ <data src="${base.dir}/scripts" type="directory">
+ <mapper type="perm" prefix="${deb.install.lib}/scripts"/>
+ <include name="**/*.*"/>
+ <exclude name="_dev/**/*.*"/>
+ </data>
+ <!-- Documentation -->
+ <data src="${base.dir}/doc" type="directory">
+ <mapper type="perm" prefix="${deb.install.lib}/doc"/>
+ <include name="developer/**/*.*"/>
+ <include name="enduser/**/*.*"/>
+ <include name="scripts/**/*.*"/>
+ <include name="transformers/**/*.*"/>
+ <include name="*.html"/>
+ <include name="*.css"/>
+ </data>
+ <link name="${deb.install.doc}/index.html" target="${deb.install.lib}/doc/index-all.html"/>
+ <!-- Licenses -->
+ <data src="${base.dir}/licenses" type="directory">
+ <mapper type="perm" prefix="${deb.install.doc}/licenses"/>
+ <include name="**/*.*"/>
+ </data>
+ </deb>
+ </target>
+</project>
Added: trunk/dmfc/debian/control
===================================================================
--- trunk/dmfc/debian/control (rev 0)
+++ trunk/dmfc/debian/control 2014-01-10 12:35:13 UTC (rev 2789)
@@ -0,0 +1,12 @@
+Package: [[name]]
+Version: [[version]]
+Section: misc
+Priority: optional
+Architecture: all
+Description: Cross-platform framework for DTB-related document transformations.
+ It provides a comprehensive solution for converting text documents
+ into accessible formats for people with print disabilities.
+Maintainer: DAISY Consortium <dai...@li...>
+Homepage: http://www.daisy.org/project/pipeline
+Depends: default-jdk
+Recommends: texlive-xetex, texlive-latex-extra, texlive-latex-recommended, ttf-tiresias, lmodern, ttf-mscorefonts-installer, lame, espeak, sox
Modified: trunk/dmfc/launchers/pipeline.sh
===================================================================
--- trunk/dmfc/launchers/pipeline.sh 2013-12-20 10:42:59 UTC (rev 2788)
+++ trunk/dmfc/launchers/pipeline.sh 2014-01-10 12:35:13 UTC (rev 2789)
@@ -41,7 +41,14 @@
# Set classpath
-DIR=`dirname $0`
+if [[ "$(uname)" == 'Linux' ]]; then
+ # resolve the path to this script in the face of symlinks
+ DIR="$(dirname "$(readlink -f "$0")")"
+else
+ # other platforms might not support readlink -f
+ DIR=`dirname $0`
+fi
+
CP=$DIR/pipeline.jar:$DIR
# Execute Daisy Pipeline
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ce...@us...> - 2013-12-20 10:43:03
|
Revision: 2788
http://sourceforge.net/p/daisymfc/code/2788
Author: cegli
Date: 2013-12-20 10:42:59 +0000 (Fri, 20 Dec 2013)
Log Message:
-----------
Large print: Improvements for floats
- Make captions more robust. No longer just die if there are lists
inside captions. For now the text of the list if put in the caption.
- Improved floating params for images. Allow images to float on a
dedicated page. This should have been an option a long time ago, as
in large print images tend to be big and take up the whole page.
Before because they weren't allowed on a page on their own they had
to float all the way back to the section boundary.
- Disable non-floating sidebars. If a sidebar doesn't float then it's
not a sidebar.
Modified Paths:
--------------
trunk/dmfc/transformers/se_tpb_dtbook2latex/dtbook2latex_common.xsl
Modified: trunk/dmfc/transformers/se_tpb_dtbook2latex/dtbook2latex_common.xsl
===================================================================
--- trunk/dmfc/transformers/se_tpb_dtbook2latex/dtbook2latex_common.xsl 2013-12-04 14:48:51 UTC (rev 2787)
+++ trunk/dmfc/transformers/se_tpb_dtbook2latex/dtbook2latex_common.xsl 2013-12-20 10:42:59 UTC (rev 2788)
@@ -90,9 +90,19 @@
fail, but we basically have no way of knowing how many lines a caption will take
from xslt (aside from crude guesses). -->
<xsl:variable name="height" select="if ($with_caption) then '\textheightMinusCaption' else '\textheight'"/>
- <xsl:sequence select="concat('\maxsizebox{\textwidth}{',$height,'}{\includegraphics[scale=',$scale-factor*$magic-number,']{',$src,'}}')"/>
+ <xsl:sequence select="concat('\maxsizebox{\textwidth}{',$height,'}{\includegraphics[scale=',$scale-factor*$magic-number,']{',$src,'}} ')"/>
</xsl:function>
+ <!-- Captions in plain LaTeX aren't very robust, i.e. a caption
+ should not contain environments such as lists, enumerations,
+ etc. In DTBook you can put all sorts of stuff inside captions.
+ If we really want to support this we'll have to put the float
+ and the caption (as a plain para) inside a minipage. -->
+ <xsl:function name="my:cleanCaptions" as="xs:string">
+ <xsl:param name="context" as="node()"/>
+ <xsl:value-of select="string($context)"/>
+ </xsl:function>
+
<!-- =========================== -->
<!-- Queries for block vs inline -->
<!-- =========================== -->
@@ -795,7 +805,7 @@
<xsl:template match="dtb:img">
<xsl:variable name="captions" select="//dtb:caption[@id=tokenize(translate(current()/@imgref,'#',''), '\s+')]|following-sibling::*[1][self::dtb:caption]"/>
- <xsl:text>\begin{figure}[htb] </xsl:text>
+ <xsl:text>\begin{figure}[htbp!] </xsl:text>
<xsl:value-of select="my:includegraphics-command(@src, exists($captions))"/>
<!-- a caption is associated with an image through an imgref attribute or a bit less formal
simply by following it immediately -->
@@ -822,9 +832,7 @@
</xsl:template>
<xsl:template match="dtb:caption" mode="referenced-caption">
- <xsl:variable name="caption">
- <xsl:apply-templates/>
- </xsl:variable>
+ <xsl:variable name="caption" select="my:cleanCaptions(.)"/>
<xsl:value-of select="concat('\legend{',$caption,'} ')"/>
<xsl:value-of select="concat('\addcontentsline{lof}{figure}{',$caption,'} ')"/>
</xsl:template>
@@ -936,12 +944,12 @@
<xsl:text>\end{tcolorbox} </xsl:text>
</xsl:template>
- <xsl:template match="dtb:sidebar[@class='no-float']">
- <xsl:text>\begin{tcolorbox}[breakable,nofloat] </xsl:text>
- <xsl:text>\raggedright </xsl:text>
- <xsl:apply-templates/>
- <xsl:text>\end{tcolorbox} </xsl:text>
- </xsl:template>
+ <!-- <xsl:template match="dtb:sidebar[@class='no-float']"> -->
+ <!-- <xsl:text>\begin{tcolorbox}[breakable,nofloat] </xsl:text> -->
+ <!-- <xsl:text>\raggedright </xsl:text> -->
+ <!-- <xsl:apply-templates/> -->
+ <!-- <xsl:text>\end{tcolorbox} </xsl:text> -->
+ <!-- </xsl:template> -->
<xsl:template match="dtb:sidebar//dtb:sidebar">
<!-- a nested sidebar should obviously not float and cannot be
@@ -1077,9 +1085,7 @@
</xsl:template>
<xsl:template match="dtb:table/dtb:caption">
- <xsl:variable name="caption">
- <xsl:apply-templates/>
- </xsl:variable>
+ <xsl:variable name="caption" select="my:cleanCaptions(.)"/>
<xsl:value-of select="concat('\legend{',$caption,'} ')"/>
<xsl:value-of select="concat('\addcontentsline{lot}{table}{',$caption,'} ')"/>
</xsl:template>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ce...@us...> - 2013-12-04 14:48:54
|
Revision: 2787
http://sourceforge.net/p/daisymfc/code/2787
Author: cegli
Date: 2013-12-04 14:48:51 +0000 (Wed, 04 Dec 2013)
Log Message:
-----------
Large print: Fixes to sidebars
- Add some more margin before a sidebar
- add support for a no-float class which makes the sidebar
non-floating
Modified Paths:
--------------
trunk/dmfc/transformers/se_tpb_dtbook2latex/dtbook2latex_common.xsl
Modified: trunk/dmfc/transformers/se_tpb_dtbook2latex/dtbook2latex_common.xsl
===================================================================
--- trunk/dmfc/transformers/se_tpb_dtbook2latex/dtbook2latex_common.xsl 2013-12-03 13:49:10 UTC (rev 2786)
+++ trunk/dmfc/transformers/se_tpb_dtbook2latex/dtbook2latex_common.xsl 2013-12-04 14:48:51 UTC (rev 2787)
@@ -278,7 +278,7 @@
<xsl:if test="//dtb:sidebar|//dtb:prodnote">
<xsl:text>\usepackage{tcolorbox} </xsl:text>
<xsl:text>\tcbuselibrary{breakable} </xsl:text>
- <xsl:text>\tcbset{colframe=black!60,colback=white,arc=0mm,float,parbox=false} </xsl:text>
+ <xsl:text>\tcbset{colframe=black!60,colback=white,arc=0mm,float,parbox=false,enlarge top by=5mm} </xsl:text>
</xsl:if>
<xsl:if test="//dtb:linenum|//dtb:span[@class='linenum']">
@@ -936,6 +936,13 @@
<xsl:text>\end{tcolorbox} </xsl:text>
</xsl:template>
+ <xsl:template match="dtb:sidebar[@class='no-float']">
+ <xsl:text>\begin{tcolorbox}[breakable,nofloat] </xsl:text>
+ <xsl:text>\raggedright </xsl:text>
+ <xsl:apply-templates/>
+ <xsl:text>\end{tcolorbox} </xsl:text>
+ </xsl:template>
+
<xsl:template match="dtb:sidebar//dtb:sidebar">
<!-- a nested sidebar should obviously not float and cannot be
breakable due to limitations of tcolorbox -->
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ce...@us...> - 2013-12-03 13:49:13
|
Revision: 2786
http://sourceforge.net/p/daisymfc/code/2786
Author: cegli
Date: 2013-12-03 13:49:10 +0000 (Tue, 03 Dec 2013)
Log Message:
-----------
Large Print: Explain why sidebars are implemented using tcolorbox
Modified Paths:
--------------
trunk/dmfc/transformers/se_tpb_dtbook2latex/README
Modified: trunk/dmfc/transformers/se_tpb_dtbook2latex/README
===================================================================
--- trunk/dmfc/transformers/se_tpb_dtbook2latex/README 2013-12-03 13:47:34 UTC (rev 2785)
+++ trunk/dmfc/transformers/se_tpb_dtbook2latex/README 2013-12-03 13:49:10 UTC (rev 2786)
@@ -83,6 +83,11 @@
</samp>
#+END_EXAMPLE
+** Sidebar
+Sidebars are implemented using tcolorbox which has the nice property
+that it can float and at the same time break across pages. You'll have
+to use a very new version of it though.
+
** Prodnote
Prodnotes come in two flavours: inline and block.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|