Skip to content

Commit 1264db8

Browse files
committed
[mod-nlb] Add options "Inkluder strong" and "Inkluder em"
see issue #217
1 parent e0ccfb8 commit 1264db8

File tree

6 files changed

+34
-6
lines changed

6 files changed

+34
-6
lines changed

modules/nlb/book-to-pef/src/main/resources/css/nlb-default.scss

+2
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ $page-width: 40 !default;
1414
$hyphenation: true !default;
1515
$force-norwegian: true !default;
1616
$duplex: true !default;
17+
$include-strong: true !default;
18+
$include-em: true !default;
1719

1820
@import "page-numbers";
1921
@import "line-spacing";

modules/nlb/book-to-pef/src/main/resources/css/text-formatting.scss

+14-6
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,23 @@
2626
close: "⠐⠂";
2727
}
2828

29-
strong, b {
30-
text-transform: strong;
31-
:root:not(:has(em, i)) & {
32-
text-transform: em;
29+
@if ($include-strong) {
30+
strong, b {
31+
@if ($include-em) {
32+
text-transform: strong;
33+
:root:not(:has(em, i)) & {
34+
text-transform: em;
35+
}
36+
} @else {
37+
text-transform: em;
38+
}
3339
}
3440
}
3541

36-
em, i {
37-
text-transform: em;
42+
@if ($include-em) {
43+
em, i {
44+
text-transform: em;
45+
}
3846
}
3947

4048
u {

modules/nlb/book-to-pef/src/main/resources/xml/dtbook-to-pef.xpl

+2
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@
6969
<p:option name="include-obfl"/>
7070
<p:option name="include-captions"/>
7171
<p:option name="include-images"/>
72+
<p:option name="include-strong"/>
73+
<p:option name="include-em"/>
7274
<p:option name="include-notes"/>
7375
<p:option name="notes-placement"/>
7476
<p:option name="include-production-notes"/>

modules/nlb/book-to-pef/src/main/resources/xml/epub3-to-pef.xpl

+2
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@
6464
<p:option name="include-obfl"/>
6565
<p:option name="include-captions"/>
6666
<p:option name="include-images"/>
67+
<p:option name="include-strong"/>
68+
<p:option name="include-em"/>
6769
<p:option name="include-notes"/>
6870
<p:option name="notes-placement"/>
6971
<p:option name="include-production-notes"/>

modules/nlb/book-to-pef/src/main/resources/xml/html-to-pef.xpl

+2
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@
7070
<p:option name="include-obfl"/>
7171
<p:option name="include-captions"/>
7272
<p:option name="include-images"/>
73+
<p:option name="include-strong"/>
74+
<p:option name="include-em"/>
7375
<p:option name="include-notes"/>
7476
<p:option name="notes-placement"/>
7577
<p:option name="include-production-notes"/>

modules/nlb/book-to-pef/src/main/resources/xml/xml-to-pef.xpl

+12
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,18 @@ Dette kan være nyttig for å løse problemer med formatering av PEF'en.</p>
149149
<!-- =============== -->
150150
<!-- Tekst-elementer -->
151151
<!-- =============== -->
152+
<p:option name="include-strong" select="'true'" px:type="boolean">
153+
<p:documentation xmlns="http://www.w3.org/1999/xhtml">
154+
<h2 px:role="name">Tekstelementer: Inkluder em</h2>
155+
<h2 px:role="desc">Når boksen er tom, blir em utelatt fra produksjonen.</h2>
156+
</p:documentation>
157+
</p:option>
158+
<p:option name="include-em" select="'true'" px:type="boolean">
159+
<p:documentation xmlns="http://www.w3.org/1999/xhtml">
160+
<h2 px:role="name">Tekstelementer: Inkluder strong</h2>
161+
<h2 px:role="desc">Når boksen er tom, vil strong bli utelatt fra produksjonen.</h2>
162+
</p:documentation>
163+
</p:option>
152164
<p:option name="include-notes" select="'true'" px:type="boolean">
153165
<p:documentation xmlns="http://www.w3.org/1999/xhtml">
154166
<h2 px:role="name">Tekstelementer: Inkluder noter</h2>

0 commit comments

Comments
 (0)