Skip to content

Commit

Permalink
[mod-sbs] Make hyphenation option work
Browse files Browse the repository at this point in the history
  • Loading branch information
bertfrees committed Oct 14, 2016
1 parent 4d1eeef commit 6738c45
Show file tree
Hide file tree
Showing 5 changed files with 308 additions and 2 deletions.
2 changes: 0 additions & 2 deletions src/main/resources/css/default.scss
Original file line number Diff line number Diff line change
Expand Up @@ -242,8 +242,6 @@ brl|volume[brl|grade='#{$contraction-grade}'] {
}

dtbook {
hyphens: auto; /* FIXME: don't hard-code, depends on param
$hyphenation (see default.scss in dtbook-to-pef) */
counter-reset: footnote 0;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
<?xml version="1.0" encoding="UTF-8"?>
<pef version="2008-1" xmlns="http://www.daisy.org/ns/2008/pef" xml:lang="de">
<head>
<meta xmlns:dc="http://purl.org/dc/elements/1.1/">
<dc:format>application/x-pef+xml</dc:format>
<dc:title>PRODSERVER1</dc:title>
<dc:creator>HAFECHÄS</dc:creator>
<dc:language>de</dc:language>
<dc:publisher>Swiss Library for the Blind, Visually Impaired and Print Disabled</dc:publisher>
</meta>
</head>
<body>
<volume cols="28" rows="28" rowgap="0" duplex="true">
<section>
<page>
<row>⠀⠀⠫⠀⠎⠏⠗⠼⠺⠢⠞⠒⠀⠤⠄⠞⠕⠥⠞⠀⠧⠊⠑⠝⠞⠀⠈⠷</row>
<row>⠏⠕⠊⠝⠞⠀⠈⠷⠀⠟⠥⠊⠀⠎⠁⠊⠞⠀⠁⠞⠞⠑⠝⠙⠗⠑⠠⠄</row>
<row>⠶⠵⠀⠷⠂⠀⠗⠀⠺⠴⠞⠉⠀⠅⠂⠀⠅⠭⠞⠀⠁⠿⠀⠞⠀⠗</row>
<row>⠵⠞⠶⠄</row>
<row>⠀⠀⠫⠀⠎⠏⠗⠼⠺⠢⠞⠒⠀⠤⠄⠞⠕⠥⠞⠀⠧⠊⠑⠝⠞⠀⠈⠷</row>
<row>⠏⠕⠊⠝⠞⠀⠈⠷⠀⠟⠥⠊⠀⠎⠁⠊⠞⠀⠁⠞⠞⠑⠝⠙⠗⠑⠠⠄</row>
<row>⠶⠵⠀⠷⠂⠀⠗⠀⠺⠴⠞⠉⠀⠅⠂⠀⠅⠭⠞⠀⠁⠿⠀⠞⠀⠗</row>
<row>⠵⠞⠶⠄</row>
<row>⠀⠀⠫⠀⠎⠏⠗⠼⠺⠢⠞⠒⠀⠞⠕⠥⠞⠀⠧⠊⠉⠞⠀⠈⠷</row>
<row>⠏⠕⠊⠝⠞⠀⠈⠷⠀⠠⠟⠥⠊⠀⠎⠁⠊⠞⠀⠁⠞⠞⠉⠙⠗⠑</row>
<row>⠶⠵⠀⠷⠂⠀⠗⠀⠺⠴⠞⠉⠀⠅⠂⠀⠅⠭⠞⠀⠁⠿⠀⠞⠀⠗</row>
<row>⠵⠞⠶⠄</row>
<row/>
<row/>
<row/>
<row/>
<row/>
<row/>
<row/>
<row/>
<row/>
<row/>
<row/>
<row/>
<row/>
<row/>
<row/>
<row>⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠼⠁</row>
</page>
<page>
<row>⠀⠀⠄⠄⠄⠀⠂⠱⠀⠻⠀⠋⠛⠉⠙⠿⠀⠯⠙⠼⠞⠒</row>
<row/>
<row>⠀⠀⠤⠄⠊⠋⠀⠽⠕⠥⠀⠺⠁⠝⠞⠀⠞⠕⠀⠛⠑⠞⠀⠁</row>
<row>⠀⠀⠀⠀⠋⠁⠧⠕⠥⠗⠀⠙⠕⠝⠑</row>
<row>⠀⠀⠃⠽⠀⠎⠕⠍⠑⠀⠕⠃⠇⠊⠛⠊⠝⠛⠀⠋⠗⠊⠑⠝⠙⠂</row>
<row>⠀⠀⠁⠝⠙⠀⠺⠁⠝⠞⠀⠁⠀⠏⠗⠕⠍⠊⠎⠑⠂⠀⠎⠁⠋⠑</row>
<row>⠀⠀⠀⠀⠁⠝⠙⠀⠎⠥⠗⠑⠂</row>
<row>⠀⠀⠕⠝⠀⠺⠓⠊⠉⠓⠀⠽⠕⠥⠀⠍⠁⠽⠀⠙⠑⠏⠑⠝⠙⠂</row>
<row>⠀⠀⠙⠕⠝⠠⠞⠀⠛⠕⠀⠞⠕⠀⠓⠊⠍⠀⠺⠓⠕⠀⠁⠇⠺⠁⠽⠎</row>
<row>⠀⠀⠀⠀⠓⠁⠎</row>
<row>⠀⠀⠍⠥⠉⠓⠀⠇⠑⠊⠎⠥⠗⠑⠀⠞⠊⠍⠑⠀⠞⠕⠀⠏⠇⠁⠝⠂</row>
<row>⠀⠀⠊⠋⠀⠽⠕⠥⠀⠺⠁⠝⠞⠀⠽⠕⠥⠗⠀⠋⠁⠧⠕⠥⠗</row>
<row>⠀⠀⠀⠀⠙⠕⠝⠑⠂</row>
<row>⠀⠀⠚⠥⠎⠞⠀⠁⠎⠅⠀⠞⠓⠑⠀⠃⠥⠎⠽⠀⠍⠁⠝⠄⠠⠄</row>
<row/>
<row/>
<row/>
<row/>
<row/>
<row/>
<row/>
<row/>
<row/>
<row/>
<row/>
<row/>
<row/>
<row/>
</page>
<page>
<row>⠀⠀⠠⠄⠃⠇⠁</row>
<row/>
<row/>
<row>⠀⠀⠤⠄⠃⠇⠁⠤⠃⠇⠕⠠⠄</row>
<row/>
<row/>
<row>⠀⠀⠠⠄⠃⠇⠁</row>
<row/>
<row/>
<row>⠀⠀⠤⠄⠃⠇⠁⠤⠃⠇⠕⠠⠄</row>
<row/>
<row/>
<row/>
<row/>
<row/>
<row/>
<row/>
<row/>
<row/>
<row/>
<row/>
<row/>
<row/>
<row/>
<row/>
<row/>
<row/>
<row>⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠼⠉</row>
</page>
</section>
</volume>
</body>
</pef>
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
6 SPR#W?T: -.TOUT VIENT "[
POINT "[ QUI SAIT ATTENDRE'.
=Z [, R W)TC K, KXT A% T R
ZT=.
6 SPR#W?T: -.TOUT VIENT "[
POINT "[ QUI SAIT ATTENDRE'.
=Z [, R W)TC K, KXT A% T R
ZT=.
6 SPR#W?T: TOUT VICT "[
POINT "[ 'QUI SAIT ATTCDRE
=Z [, R W)TC K, KXT A% T R
ZT=.















#A
p ... ,5 7 FGCD% &D#T:

-.IF YOU WANT TO GET A
FAVOUR DONE
BY SOME OBLIGING FRIEND,
AND WANT A PROMISE, SAFE
AND SURE,
ON WHICH YOU MAY DEPEND,
DON'T GO TO HIM WHO ALWAYS
HAS
MUCH LEISURE TIME TO PLAN,
IF YOU WANT YOUR FAVOUR
DONE,
JUST ASK THE BUSY MAN.'.














p '.BLA


-.BLA-BLO'.


'.BLA


-.BLA-BLO'.

















#C
p



























p
p
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE dtbook [<!ENTITY ndash "&#x2013;"><!ENTITY nbsp "&#x00A0;">]><?oxygen RNGSchema="http://xmlp/schema/dtbook-2005-3-sbs.rng" type="xml"?>
<dtbook version="2005-3-sbs-full" xml:lang="de" xmlns:brl="http://www.daisy.org/z3986/2009/braille/"
xmlns="http://www.daisy.org/z3986/2005/dtbook/">
<head>
<meta name="dc:Title" content="PRODSERVER1"/>
<meta name="dc:Creator" content="HAFECHÄS"/>
<meta name="dc:Subject" content=""/>
<meta name="dc:Description" content=""/>
<meta name="dc:Publisher"
content="Swiss Library for the Blind, Visually Impaired and Print Disabled"/>
<meta name="dc:Date" content="2012-01-05"/>
<meta name="dc:Type" content="Text"/>
<meta name="dc:Format" content="ANSI/NISO Z39.86-2005"/>
<meta name="dc:Identifier" content="ch-sbs-0d63eb29-566a-4061-a8bf-b279c69699ed"/>
<meta name="dc:Source" content=""/>
<meta name="dc:Language" content="de"/>
<meta name="dc:Rights" content=""/>
<meta name="dtb:uid" content="ch-sbs-0d63eb29-566a-4061-a8bf-b279c69699ed"/>
<meta name="dtb:sourceEdition" content=""/>
<meta name="dtb:sourcePublisher" content=""/>
<meta name="dtb:sourceRights" content=""/>
<meta name="prod:series" content=""/>
<meta name="prod:seriesNumber" content=""/>
</head>
<book>
<bodymatter>
<level1>
<p>Ein Sprichwort: <span brl:grade="0">Tout vient à point à qui sait attendre</span> (Zu
dem, der warten kann, kommt alles mit der Zeit).</p>
<p>Ein Sprichwort: <span brl:grade="1">Tout vient à point à qui sait attendre</span> (Zu
dem, der warten kann, kommt alles mit der Zeit).</p>
<p>Ein Sprichwort: <span brl:grade="2">Tout vient à point à qui sait attendre</span> (Zu
dem, der warten kann, kommt alles mit der Zeit).</p>
</level1>
<level1>
<p>... schrieb er folgendes Gedicht:</p>
<poem xml:lang="en">
<line>If you want to get a favour done</line>
<line>By some obliging friend,</line>
<line>And want a promise, safe and sure,</line>
<line>On which you may depend,</line>
<line>Don't go to him who always has</line>
<line>Much leisure time to plan,</line>
<line>If you want your favour done,</line>
<line>Just ask the busy man.</line>
</poem>
</level1>
<level1>
<level2>
<poem xml:lang="en">
<line>bla</line>
</poem>
</level2>
<level2>
<poem xml:lang="en">
<line>bla-blo</line>
</poem>
</level2>
<level2>
<p><span brl:grade="0">bla</span></p>
</level2>
<level2>
<p><span brl:grade="0">bla-blo</span></p>
</level2>
</level1>
</bodymatter>
</book>
</dtbook>
18 changes: 18 additions & 0 deletions src/test/xprocspec/test_dtbook-to-pef.xprocspec
Original file line number Diff line number Diff line change
Expand Up @@ -754,4 +754,22 @@
</x:expect>
</x:scenario>

<x:scenario label="disable-hyphenation">
<x:call step="sbs:dtbook-to-pef">
<x:input port="source">
<x:document type="file" href="../resources/test_downgrade_contracted_braille/test_downgrade_contracted_braille.xml"/>
</x:input>
<x:option name="contraction-grade" select="2"/>
<x:option name="hyphenation" select="false()"/>
<x:option name="pef-output-dir" select="concat($temp-dir,'output-dir/test_downgrade_contracted_braille/')"/>
<x:option name="temp-dir" select="concat($temp-dir,'temp-dir/')"/>
</x:call>
<x:context label="result">
<x:document type="file" base-uri="temp-dir" href="output-dir/test_downgrade_contracted_braille/test_downgrade_contracted_braille.pef"/>
</x:context>
<x:expect label="result" type="custom" href="http://www.daisy.org/pipeline/modules/braille/pef-utils/library.xpl" step="x:pef-compare">
<x:document type="file" href="../resources/test_downgrade_contracted_braille/output_expected/test_downgrade_contracted_braille.pef"/>
</x:expect>
</x:scenario>

</x:description>

0 comments on commit 6738c45

Please sign in to comment.