metanorma-taste 0.1.6 → 0.1.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/data/csa/csa.standard.xsl +244 -153
- data/data/elf/config.yaml +2 -0
- data/data/elf/elf.xsl +754 -0
- data/data/pdfa/config.yaml +1 -0
- data/data/pdfa/htmlcoverpage.html +6 -2
- data/data/pdfa/htmlstylesheet-override.scss +7 -0
- data/data/pdfa/pdfa.xsl +71 -11
- data/lib/metanorma/taste/base.rb +10 -0
- data/lib/metanorma/taste/value_attributes.rb +14 -0
- data/lib/metanorma/taste/version.rb +1 -1
- metadata +3 -2
data/data/pdfa/config.yaml
CHANGED
|
@@ -19,6 +19,7 @@ base-override:
|
|
|
19
19
|
header-font: "'Source Sans Pro', 'Helvetica Neue', Helvetica, sans-serif"
|
|
20
20
|
fonts: Source Sans 3;Source Sans Pro
|
|
21
21
|
output-extensions: xml,html,pdf
|
|
22
|
+
toclevels-html: 6
|
|
22
23
|
doctypes:
|
|
23
24
|
- taste: specification # Specification # The name goes into i18n.yaml
|
|
24
25
|
base: standard
|
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
<div id='toggle'> <span>•</span> </div>
|
|
2
2
|
|
|
3
|
+
<div class="coverpage-container">
|
|
4
|
+
|
|
3
5
|
<p class="coverpage_docnumber"><b>{{ docnumber }}</b></p>
|
|
4
6
|
|
|
5
7
|
<div class="logo">
|
|
6
8
|
<img src="{{ copublisher_logos[0] }}"/>
|
|
7
9
|
</div>
|
|
8
10
|
|
|
11
|
+
<div>
|
|
12
|
+
<p class="doctitle-en">{{ doctitle }}</p>
|
|
13
|
+
</div>
|
|
14
|
+
|
|
9
15
|
<div class="docidentifier">
|
|
10
16
|
<p><b>
|
|
11
17
|
{{doctype_display}}<br/>
|
|
@@ -13,6 +19,4 @@
|
|
|
13
19
|
</b></p>
|
|
14
20
|
</div>
|
|
15
21
|
|
|
16
|
-
<div>
|
|
17
|
-
<p class="doctitle-en">{{ doctitle }}</p>
|
|
18
22
|
</div>
|
data/data/pdfa/pdfa.xsl
CHANGED
|
@@ -18,16 +18,26 @@
|
|
|
18
18
|
<fo:simple-page-master master-name="copyright-page" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
|
|
19
19
|
<fo:region-body margin-top="20mm" margin-bottom="35mm" margin-left="18mm" margin-right="18mm"/>
|
|
20
20
|
</fo:simple-page-master>
|
|
21
|
+
|
|
22
|
+
<fo:simple-page-master master-name="first" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
|
|
23
|
+
<fo:region-body margin-top="14mm" margin-bottom="{$marginBottom}mm" margin-left="{$marginLeftRight1}mm" margin-right="{$marginLeftRight2}mm"/>
|
|
24
|
+
<fo:region-before region-name="header-LB-yellow" extent="14mm"/>
|
|
25
|
+
<fo:region-after region-name="footer-even" extent="12.5mm"/>
|
|
26
|
+
<fo:region-start region-name="left-region" extent="13mm"/>
|
|
27
|
+
<fo:region-end region-name="right-region" extent="12mm"/>
|
|
28
|
+
</fo:simple-page-master>
|
|
21
29
|
</fo:layout-master-set>
|
|
22
30
|
</xsl:template>
|
|
23
31
|
|
|
24
32
|
<xsl:variable name="cover_page_color_box1">rgb(202,152,49)</xsl:variable>
|
|
25
33
|
<xsl:variable name="cover_page_color_box2">rgb(139,152,91)</xsl:variable>
|
|
26
|
-
<xsl:variable name="cover_page_color_box3">rgb(208,63,78)</xsl:variable
|
|
34
|
+
<xsl:variable name="cover_page_color_box3">rgb(208,63,78)</xsl:variable><!-- #d03f4e -->
|
|
27
35
|
<xsl:variable name="cover_page_color_box4">rgb(72,145,175)</xsl:variable>
|
|
28
36
|
<xsl:variable name="cover_page_color_box_border_width">2.5pt</xsl:variable>
|
|
29
37
|
<xsl:variable name="cover_page_color_box_height">57mm</xsl:variable>
|
|
30
38
|
|
|
39
|
+
<xsl:variable name="color_secondary" select="$cover_page_color_box3"/>
|
|
40
|
+
|
|
31
41
|
<xsl:attribute-set name="cover_page_box">
|
|
32
42
|
<xsl:attribute name="padding-left">0.5mm</xsl:attribute>
|
|
33
43
|
<xsl:attribute name="padding-right">0.5mm</xsl:attribute>
|
|
@@ -96,12 +106,20 @@
|
|
|
96
106
|
<fo:block>
|
|
97
107
|
<!-- Status / Version.
|
|
98
108
|
e.g. "Draft Release Candidate 1.2", or just a version -->
|
|
99
|
-
<xsl:variable name="status" select="/mn:metanorma/mn:metanorma-extension/mn:presentation-metadata/mn:status"/>
|
|
100
|
-
<xsl:
|
|
101
|
-
<xsl:
|
|
102
|
-
<xsl:
|
|
103
|
-
</xsl:
|
|
104
|
-
|
|
109
|
+
<!-- <xsl:variable name="status" select="/mn:metanorma/mn:metanorma-extension/mn:presentation-metadata/mn:status"/> -->
|
|
110
|
+
<xsl:variable name="status">
|
|
111
|
+
<xsl:call-template name="capitalize">
|
|
112
|
+
<xsl:with-param name="str" select="/mn:metanorma/mn:bibdata/mn:status/mn:stage"/>
|
|
113
|
+
</xsl:call-template>
|
|
114
|
+
</xsl:variable>
|
|
115
|
+
<!-- <xsl:choose> -->
|
|
116
|
+
<xsl:if test="normalize-space($status) != '' and $status != 'Published'">
|
|
117
|
+
<fo:block color="{$color_secondary}">
|
|
118
|
+
<xsl:value-of select="$status"/>
|
|
119
|
+
</fo:block>
|
|
120
|
+
</xsl:if>
|
|
121
|
+
<!-- </xsl:when>
|
|
122
|
+
<xsl:otherwise> --><!-- just a version -->
|
|
105
123
|
<xsl:variable name="i18n_version"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">version</xsl:with-param></xsl:call-template></xsl:variable>
|
|
106
124
|
<xsl:call-template name="capitalize">
|
|
107
125
|
<xsl:with-param name="str" select="$i18n_version"/>
|
|
@@ -110,8 +128,8 @@
|
|
|
110
128
|
<xsl:variable name="edition" select="/mn:metanorma/mn:bibdata/mn:edition[normalize-space(@language) = '']"/>
|
|
111
129
|
<xsl:value-of select="$edition"/>
|
|
112
130
|
<xsl:if test="not(contains($edition, '.'))">.0</xsl:if>
|
|
113
|
-
</xsl:otherwise>
|
|
114
|
-
</xsl:choose>
|
|
131
|
+
<!-- </xsl:otherwise>
|
|
132
|
+
</xsl:choose> -->
|
|
115
133
|
</fo:block>
|
|
116
134
|
<fo:block margin-bottom="2mm">
|
|
117
135
|
<xsl:value-of select="substring(/mn:metanorma/mn:bibdata/mn:version/mn:revision-date, 1, 7)"/>
|
|
@@ -256,8 +274,8 @@
|
|
|
256
274
|
<xsl:template name="insertFooter">
|
|
257
275
|
<!-- <xsl:param name="invert"/> -->
|
|
258
276
|
<xsl:variable name="footerText">
|
|
259
|
-
<xsl:text>PDF Association</xsl:text>
|
|
260
|
-
<xsl:text> </xsl:text>
|
|
277
|
+
<!-- <xsl:text>PDF Association</xsl:text>
|
|
278
|
+
<xsl:text> </xsl:text> -->
|
|
261
279
|
<xsl:call-template name="capitalizeWords">
|
|
262
280
|
<xsl:with-param name="str">
|
|
263
281
|
<xsl:choose>
|
|
@@ -285,4 +303,46 @@
|
|
|
285
303
|
</xsl:if>
|
|
286
304
|
</xsl:template>
|
|
287
305
|
|
|
306
|
+
<xsl:template name="refine_list-item-label-style"><?extend?>
|
|
307
|
+
<xsl:if test="parent::mn:ul">
|
|
308
|
+
<xsl:attribute name="color"><xsl:value-of select="$color_secondary"/></xsl:attribute>
|
|
309
|
+
</xsl:if>
|
|
310
|
+
</xsl:template>
|
|
311
|
+
|
|
312
|
+
<xsl:template name="refine_title-style"><?extend?>
|
|
313
|
+
<xsl:attribute name="color"><xsl:value-of select="$color_secondary"/></xsl:attribute>
|
|
314
|
+
</xsl:template>
|
|
315
|
+
|
|
316
|
+
<xsl:template name="refine_list-item-label-style"><?extend?>
|
|
317
|
+
<xsl:if test="parent::mn:ul">
|
|
318
|
+
<xsl:attribute name="color"><xsl:value-of select="$color_secondary"/></xsl:attribute>
|
|
319
|
+
</xsl:if>
|
|
320
|
+
</xsl:template>
|
|
321
|
+
|
|
322
|
+
<xsl:template name="refine_sourcecode-style"><?extend?>
|
|
323
|
+
<xsl:attribute name="font-size">85%</xsl:attribute>
|
|
324
|
+
</xsl:template>
|
|
325
|
+
|
|
326
|
+
<xsl:template match="mn:ul/mn:li/mn:fmt-name[normalize-space() = 'o']" priority="3" mode="update_xml_step1">
|
|
327
|
+
<xsl:attribute name="label">■</xsl:attribute>
|
|
328
|
+
</xsl:template>
|
|
329
|
+
|
|
330
|
+
<xsl:attribute-set name="note-style"><?extend?>
|
|
331
|
+
<xsl:attribute name="background-color">rgb(236,242,246)</xsl:attribute>
|
|
332
|
+
<xsl:attribute name="margin-left">0.5mm</xsl:attribute>
|
|
333
|
+
<xsl:attribute name="margin-right">0.5mm</xsl:attribute>
|
|
334
|
+
<xsl:attribute name="padding">1mm</xsl:attribute>
|
|
335
|
+
<xsl:attribute name="padding-left">1.5mm</xsl:attribute>
|
|
336
|
+
<xsl:attribute name="padding-right">1.5mm</xsl:attribute>
|
|
337
|
+
<xsl:attribute name="font-size">85%</xsl:attribute>
|
|
338
|
+
</xsl:attribute-set>
|
|
339
|
+
|
|
340
|
+
<xsl:attribute-set name="note-name-style"><?extend?>
|
|
341
|
+
<xsl:attribute name="padding-right">3mm</xsl:attribute>
|
|
342
|
+
</xsl:attribute-set>
|
|
343
|
+
|
|
344
|
+
<xsl:template match="mn:note/mn:fmt-name/mn:tab" mode="tab">
|
|
345
|
+
<xsl:attribute name="padding-right">1mm</xsl:attribute>
|
|
346
|
+
</xsl:template>
|
|
347
|
+
|
|
288
348
|
</xsl:stylesheet>
|
data/lib/metanorma/taste/base.rb
CHANGED
|
@@ -38,6 +38,8 @@ module Metanorma
|
|
|
38
38
|
# @example Configuration to attribute mapping
|
|
39
39
|
# config.base_override.value_attributes.publisher => :publisher:
|
|
40
40
|
# config.base_override.value_attributes.presentation_metadata_color_secondary => :presentation-metadata-color-secondary:
|
|
41
|
+
#
|
|
42
|
+
# TODO: metaprogramming to extract these from value_attributes.rb
|
|
41
43
|
VALUE_ATTRIBUTE_MAPPINGS = {
|
|
42
44
|
publisher: "publisher",
|
|
43
45
|
publisher_abbr: "publisher_abbr",
|
|
@@ -56,6 +58,14 @@ module Metanorma
|
|
|
56
58
|
monospace_font: "monospace-font",
|
|
57
59
|
fonts: "fonts",
|
|
58
60
|
output_extensions: "output-extensions",
|
|
61
|
+
toclevels: "toclevels",
|
|
62
|
+
htmltoclevels: "toclevels-html",
|
|
63
|
+
doctoclevels: "toclevels-doc",
|
|
64
|
+
pdftoclevels: "toclevels-pdf",
|
|
65
|
+
toc_figures: "toc-figures",
|
|
66
|
+
toc_tables: "toc-tables",
|
|
67
|
+
toc_recommendations: "toc-recommendations",
|
|
68
|
+
|
|
59
69
|
}.freeze
|
|
60
70
|
|
|
61
71
|
|
|
@@ -24,6 +24,13 @@ module Metanorma
|
|
|
24
24
|
attribute :presentation_metadata_ol_label_template_arabic, :string
|
|
25
25
|
attribute :fonts, :string
|
|
26
26
|
attribute :output_extensions, :string
|
|
27
|
+
attribute :toclevels, :string
|
|
28
|
+
attribute :htmltoclevels, :string
|
|
29
|
+
attribute :doctoclevels, :string
|
|
30
|
+
attribute :pdftoclevels, :string
|
|
31
|
+
attribute :toc_figures, :string
|
|
32
|
+
attribute :toc_tables, :string
|
|
33
|
+
attribute :toc_recommendations, :string
|
|
27
34
|
|
|
28
35
|
key_value do
|
|
29
36
|
map "publisher", to: :publisher
|
|
@@ -53,6 +60,13 @@ module Metanorma
|
|
|
53
60
|
map "presentation-metadata-ol-label-template-arabic",
|
|
54
61
|
to: :presentation_metadata_ol_label_template_arabic
|
|
55
62
|
map "output-extensions", to: :output_extensions
|
|
63
|
+
map "toclevels", to: :toclevels
|
|
64
|
+
map "toclevels-html", to: :htmltoclevels
|
|
65
|
+
map "doclevels-doc", to: :doctoclevels
|
|
66
|
+
map "toclevels-pdf", to: :pdftoclevels
|
|
67
|
+
map "toc-figures", to: :toc_figures
|
|
68
|
+
map "toc-tables", to: :toc_tables
|
|
69
|
+
map "toc-recommendations", to: :toc_recommendations
|
|
56
70
|
end
|
|
57
71
|
end
|
|
58
72
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: metanorma-taste
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.9
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ribose Inc.
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2025-
|
|
11
|
+
date: 2025-11-17 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: lutaml-model
|
|
@@ -322,6 +322,7 @@ files:
|
|
|
322
322
|
- data/csa/wordstyle.scss
|
|
323
323
|
- data/elf/config.yaml
|
|
324
324
|
- data/elf/copyright.adoc
|
|
325
|
+
- data/elf/elf.xsl
|
|
325
326
|
- data/elf/i18n.yaml
|
|
326
327
|
- data/elf/logo.svg
|
|
327
328
|
- data/enosema/config.yaml
|