metanorma-iho 0.3.3 → 0.3.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 288f5d8afd0281c3ff10cb514820baa3b9915e1f050c946bed0c9eaa22a3c506
4
- data.tar.gz: 665c46bd50d23bed2a4b9ba983890694c7b9da051a7adf4d71f4c8b478ce839d
3
+ metadata.gz: aaadb9f1a37db3c3b5aff92d2a593b365194c6d4e1435d06a7334766511adb1c
4
+ data.tar.gz: fb552d20da927d65e91ad726ef7926fc7a1617cdee4cc71cfab8807d64a79888
5
5
  SHA512:
6
- metadata.gz: 0f272b7464a8932dda4d3947eb5b1c471387766e12ec86b33887eb31b0482ea6c077c8c3f6fb110756fe5322774e675b8801c2bec5796790a085fdfba49bb6ad
7
- data.tar.gz: f4b6b13deb6ae462ce7f23b909a3c342b1f278fd895382cf0d38a68710e2d6ba399b15d2338e385759b854c97f04063c2a636bed0d754c2f8e9bd4b819043ee8
6
+ metadata.gz: 664a4bdc46f48822c6eb58ad3e258498dd8ff33da546168b905a4c5299643a1f0e3b7928167457139b7db70c2572f37305318f31f78ffb74824f6f78e9c7d2e0
7
+ data.tar.gz: 475f2b786a53d4641fc6ebc0d8ab08c142d6c3dacf3053d5046497d7d8e63b2125b0104729d390b6d88097adace7536c061d269bc06f2374483b26015dcd85a6
@@ -4,7 +4,7 @@ name: rake
4
4
 
5
5
  on:
6
6
  push:
7
- branches: [ master, main ]
7
+ branches: [ master, main ]
8
8
  tags: [ v* ]
9
9
  pull_request:
10
10
 
@@ -16,19 +16,9 @@ jobs:
16
16
  strategy:
17
17
  fail-fast: false
18
18
  matrix:
19
- ruby: [ '2.7', '2.6', '2.5', '2.4' ]
19
+ ruby: [ '3.0', '2.7', '2.6', '2.5', '2.4' ]
20
20
  os: [ ubuntu-latest, windows-latest, macos-latest ]
21
21
  experimental: [ false ]
22
- include:
23
- - ruby: '3.0'
24
- os: 'ubuntu-latest'
25
- experimental: true
26
- - ruby: '3.0'
27
- os: 'windows-latest'
28
- experimental: true
29
- - ruby: '3.0'
30
- os: 'macos-latest'
31
- experimental: true
32
22
  steps:
33
23
  - uses: actions/checkout@master
34
24
 
@@ -49,5 +39,5 @@ jobs:
49
39
  with:
50
40
  token: ${{ secrets.METANORMA_CI_PAT_TOKEN || secrets.GITHUB_TOKEN }}
51
41
  repository: ${{ github.repository }}
52
- event-type: notify
42
+ event-type: tests-passed
53
43
  client-payload: '{"ref": "${{ github.ref }}", "sha": "${{ github.sha }}"}'
data/.hound.yml ADDED
@@ -0,0 +1,5 @@
1
+ # Auto-generated by Cimas: Do not edit it manually!
2
+ # See https://github.com/metanorma/cimas
3
+ ruby:
4
+ enabled: true
5
+ config_file: .rubocop.yml
data/.rubocop.yml CHANGED
@@ -1,12 +1,10 @@
1
- # This project follows the Ribose OSS style guide.
2
- # https://github.com/riboseinc/oss-guides
3
- # All project-specific additions and overrides should be specified in this file.
1
+ # Auto-generated by Cimas: Do not edit it manually!
2
+ # See https://github.com/metanorma/cimas
4
3
  inherit_from:
5
4
  - https://raw.githubusercontent.com/riboseinc/oss-guides/master/ci/rubocop.yml
6
5
 
7
6
  # local repo-specific modifications
7
+ # ...
8
8
 
9
9
  AllCops:
10
- DisplayCopNames: false
11
- StyleGuideCopsOnly: false
12
10
  TargetRubyVersion: 2.4
@@ -36,6 +36,9 @@
36
36
  <optional>
37
37
  <ref name="doctype"/>
38
38
  </optional>
39
+ <optional>
40
+ <ref name="docsubtype"/>
41
+ </optional>
39
42
  <zeroOrMore>
40
43
  <ref name="editorialgroup"/>
41
44
  </zeroOrMore>
@@ -45,6 +45,11 @@
45
45
  <optional>
46
46
  <attribute name="alt"/>
47
47
  </optional>
48
+ <optional>
49
+ <attribute name="updatetype">
50
+ <data type="boolean"/>
51
+ </attribute>
52
+ </optional>
48
53
  <text/>
49
54
  </element>
50
55
  </define>
@@ -543,6 +548,9 @@
543
548
  </define>
544
549
  <define name="BibDataExtensionType">
545
550
  <ref name="doctype"/>
551
+ <optional>
552
+ <ref name="docsubtype"/>
553
+ </optional>
546
554
  <optional>
547
555
  <ref name="editorialgroup"/>
548
556
  </optional>
@@ -890,6 +898,14 @@
890
898
  </define>
891
899
  </include>
892
900
  <!-- end overrides -->
901
+ <define name="docsubtype">
902
+ <element name="docsubtype">
903
+ <ref name="DocumentSubtype"/>
904
+ </element>
905
+ </define>
906
+ <define name="DocumentSubtype">
907
+ <text/>
908
+ </define>
893
909
  <define name="colgroup">
894
910
  <element name="colgroup">
895
911
  <oneOrMore>
@@ -15,30 +15,32 @@ module IsoDoc
15
15
  super
16
16
  end
17
17
 
18
- def std_bibitem_entry(list, b, ordinal, biblio)
19
- list.p **attr_code(iso_bibitem_entry_attrs(b, biblio)) do |ref|
18
+ def std_bibitem_entry(list, bib, ordinal, biblio)
19
+ list.p **attr_code(iso_bibitem_entry_attrs(bib, biblio)) do |ref|
20
20
  prefix_bracketed_ref(ref, "[#{ordinal}]")
21
- standard_citation(ref, b)
21
+ standard_citation(ref, bib)
22
22
  end
23
23
  end
24
24
 
25
- def nodes_to_span(n)
25
+ def nodes_to_span(node)
26
26
  noko do |xml|
27
27
  xml.span do |s|
28
- n&.children&.each { |x| parse(x, s) }
28
+ node&.children&.each { |x| parse(x, s) }
29
29
  end
30
30
  end.join("")
31
31
  end
32
32
 
33
33
  def multiplenames_and(names)
34
- return "" if names.length == 0
34
+ return "" if names.empty?
35
35
  return names[0] if names.length == 1
36
36
  return "#{names[0]} and #{names[1]}" if names.length == 2
37
+
37
38
  names[0..-2].join(", ") + " and #{names[-1]}"
38
39
  end
39
40
 
40
- def extract_publisher(b)
41
- c = b.xpath(ns("./contributor[role/@type = 'publisher'][organization]"))
41
+ def extract_publisher(bib)
42
+ c = bib
43
+ .xpath(ns("./contributor[role/@type = 'publisher'][organization]"))
42
44
  abbrs = []
43
45
  names = []
44
46
  c&.each do |c1|
@@ -47,63 +49,55 @@ module IsoDoc
47
49
  names << nodes_to_span(n)
48
50
  end
49
51
  return [nil, nil] if names.empty?
50
- return [multiplenames_and(names), (abbrs.map { |x| x.text }).join("/")]
52
+
53
+ [multiplenames_and(names), abbrs.map(&:text).join("/")]
51
54
  end
52
55
 
53
- def inline_bibitem_ref_code(b)
54
- id = b.at(ns("./docidentifier[not(@type = 'DOI' or @type = 'metanorma' "\
55
- "or @type = 'ISSN' or @type = 'ISBN' or @type = 'rfc-anchor')]"))
56
- id ||= b.at(ns("./docidentifier[not(@type = 'metanorma')]"))
56
+ def inline_bibitem_ref_code(bib)
57
+ id = bib.at(ns("./docidentifier[not(@type = 'DOI' or "\
58
+ "@type = 'metanorma' or @type = 'ISSN' or "\
59
+ "@type = 'ISBN' or @type = 'rfc-anchor')]"))
60
+ id ||= bib.at(ns("./docidentifier[not(@type = 'metanorma')]"))
57
61
  return [nil, id, nil] if id
58
- id = Nokogiri::XML::Node.new("docidentifier", b.document)
62
+
63
+ id = Nokogiri::XML::Node.new("docidentifier", bib.document)
59
64
  id << "(NO ID)"
60
65
  [nil, id, nil]
61
66
  end
62
67
 
63
- def extract_edition(b)
64
- b&.at(ns("./edition"))&.text
68
+ def extract_edition(bib)
69
+ bib&.at(ns("./edition"))&.text
65
70
  end
66
71
 
67
- def extract_uri(b)
68
- b.at(ns("./uri"))
72
+ def extract_uri(bib)
73
+ bib.at(ns("./uri"))
69
74
  end
70
75
 
71
76
  def omit_docid_prefix(prefix)
72
77
  return true if prefix == "IHO"
78
+
73
79
  super
74
80
  end
75
81
 
76
82
  def render_identifier(id)
77
- if !id[1].nil? and id[1]["type"] == "IHO"
83
+ if !id[1].nil? && (id[1]["type"] == "IHO")
78
84
  id[1].children = id[1].text.sub(/^IHO /, "")
79
85
  end
80
86
  super
81
87
  end
82
88
 
83
- def extract_publisher(b)
84
- c = b.xpath(ns("./contributor[role/@type = 'publisher'][organization]"))
85
- abbrs = []
86
- names = []
87
- c&.each do |c1|
88
- n = c1.at(ns("./organization/name")) or next
89
- abbrs << (c1.at(ns("./organization/abbreviation")) || n)
90
- names << nodes_to_span(n)
91
- end
92
- return [nil, nil] if names.empty?
93
- return [multiplenames_and(names), (abbrs.map { |x| x.text }).join("/")]
94
- end
89
+ def extract_author(bib)
90
+ c = bib.xpath(ns("./contributor[role/@type = 'author']"))
91
+ c = bib.xpath(ns("./contributor[role/@type = 'editor']")) if c.empty?
92
+ return extract_publisher(bib)[0] if c.empty?
95
93
 
96
- def extract_author(b)
97
- c = b.xpath(ns("./contributor[role/@type = 'author']"))
98
- c = b.xpath(ns("./contributor[role/@type = 'editor']")) if c.empty?
99
- return extract_publisher(b)[0] if c.empty?
100
94
  c.map do |c1|
101
95
  c1&.at(ns("./organization/name"))&.text || extract_person_name(c1)
102
96
  end.reject { |e| e.nil? || e.empty? }.join(", ")
103
97
  end
104
98
 
105
- def extract_person_name(b)
106
- p = b.at(ns("./person/name")) or return
99
+ def extract_person_name(bib)
100
+ p = bib.at(ns("./person/name")) or return
107
101
  c = p.at(ns("./completename")) and return c.text
108
102
  s = p&.at(ns("./surname"))&.text or return
109
103
  i = p.xpath(ns("./initial")) and
@@ -113,25 +107,25 @@ module IsoDoc
113
107
  front ? "#{s} #{front}" : s
114
108
  end
115
109
 
116
- def is_iho?(b)
117
- extract_publisher(b)[1] == "IHO"
110
+ def iho?(bib)
111
+ extract_publisher(bib)[1] == "IHO"
118
112
  end
119
113
 
120
114
  # [{number}] {docID} edition {edition}: {title}, {author/organization}
121
- def standard_citation(out, b)
122
- if ftitle = b.at(ns("./formattedref"))
115
+ def standard_citation(out, bib)
116
+ if ftitle = bib.at(ns("./formattedref"))
123
117
  ftitle&.children&.each { |n| parse(n, out) }
124
118
  else
125
- id = render_identifier(inline_bibitem_ref_code(b))
119
+ id = render_identifier(inline_bibitem_ref_code(bib))
126
120
  out << id[1] if id[1]
127
- ed = extract_edition(b) if is_iho?(b)
121
+ ed = extract_edition(bib) if iho?(bib)
128
122
  out << " edition #{ed}" if ed
129
123
  out << ": " if id[1] || ed
130
- iso_title(b)&.children&.each { |n| parse(n, out) }
124
+ iso_title(bib)&.children&.each { |n| parse(n, out) }
131
125
  out << ", "
132
- author = extract_author(b)
126
+ author = extract_author(bib)
133
127
  out << author
134
- u = extract_uri(b)
128
+ u = extract_uri(bib)
135
129
  out << " (<a href='#{u.text}'>#{u.text}</a>)" if u
136
130
  end
137
131
  end
@@ -1122,6 +1122,7 @@
1122
1122
 
1123
1123
 
1124
1124
 
1125
+
1125
1126
  </xsl:attribute-set><xsl:attribute-set name="sourcecode-style">
1126
1127
  <xsl:attribute name="white-space">pre</xsl:attribute>
1127
1128
  <xsl:attribute name="wrap-option">wrap</xsl:attribute>
@@ -1190,6 +1191,7 @@
1190
1191
 
1191
1192
 
1192
1193
 
1194
+
1193
1195
  </xsl:attribute-set><xsl:attribute-set name="example-body-style">
1194
1196
 
1195
1197
 
@@ -1209,9 +1211,7 @@
1209
1211
 
1210
1212
 
1211
1213
 
1212
-
1213
-
1214
-
1214
+
1215
1215
 
1216
1216
 
1217
1217
 
@@ -1261,6 +1261,7 @@
1261
1261
 
1262
1262
 
1263
1263
 
1264
+
1264
1265
  </xsl:attribute-set><xsl:attribute-set name="appendix-style">
1265
1266
 
1266
1267
 
@@ -1277,11 +1278,13 @@
1277
1278
  <xsl:attribute name="text-decoration">underline</xsl:attribute>
1278
1279
 
1279
1280
 
1281
+
1280
1282
  </xsl:attribute-set><xsl:attribute-set name="eref-style">
1281
1283
 
1282
1284
 
1283
1285
 
1284
1286
 
1287
+
1285
1288
  </xsl:attribute-set><xsl:attribute-set name="note-style">
1286
1289
 
1287
1290
 
@@ -1379,6 +1382,7 @@
1379
1382
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1380
1383
 
1381
1384
 
1385
+
1382
1386
  </xsl:attribute-set><xsl:attribute-set name="origin-style">
1383
1387
 
1384
1388
 
@@ -1386,6 +1390,7 @@
1386
1390
  <xsl:attribute name="text-decoration">underline</xsl:attribute>
1387
1391
 
1388
1392
 
1393
+
1389
1394
  </xsl:attribute-set><xsl:attribute-set name="term-style">
1390
1395
 
1391
1396
  <xsl:attribute name="margin-bottom">10pt</xsl:attribute>
@@ -1458,8 +1463,10 @@
1458
1463
  </xsl:attribute-set><xsl:attribute-set name="admitted-style">
1459
1464
 
1460
1465
 
1466
+
1461
1467
  </xsl:attribute-set><xsl:attribute-set name="deprecates-style">
1462
1468
 
1469
+
1463
1470
  </xsl:attribute-set><xsl:attribute-set name="definition-style">
1464
1471
 
1465
1472
 
@@ -2212,6 +2219,7 @@
2212
2219
 
2213
2220
 
2214
2221
 
2222
+
2215
2223
  <xsl:if test="$lang = 'ar'">
2216
2224
  <xsl:attribute name="padding-right">1mm</xsl:attribute>
2217
2225
  </xsl:if>
@@ -2580,6 +2588,7 @@
2580
2588
 
2581
2589
 
2582
2590
 
2591
+
2583
2592
  <xsl:variable name="title-key">
2584
2593
 
2585
2594
 
@@ -2868,6 +2877,8 @@
2868
2877
 
2869
2878
  <xsl:apply-templates/>
2870
2879
  </fo:inline>
2880
+ </xsl:template><xsl:template match="*[local-name()='padding']">
2881
+ <fo:inline padding-right="{@value}"> </fo:inline>
2871
2882
  </xsl:template><xsl:template match="*[local-name()='sup']">
2872
2883
  <fo:inline font-size="80%" vertical-align="super">
2873
2884
  <xsl:apply-templates/>
@@ -3360,6 +3371,16 @@
3360
3371
  <mathml:mspace width="0.5ex"/>
3361
3372
  </xsl:template><xsl:template match="mathml:math/*[local-name()='unit']" mode="mathml"/><xsl:template match="mathml:math/*[local-name()='prefix']" mode="mathml"/><xsl:template match="mathml:math/*[local-name()='dimension']" mode="mathml"/><xsl:template match="mathml:math/*[local-name()='quantity']" mode="mathml"/><xsl:template match="*[local-name()='localityStack']"/><xsl:template match="*[local-name()='link']" name="link">
3362
3373
  <xsl:variable name="target">
3374
+ <xsl:choose>
3375
+ <xsl:when test="@updatetype = 'true'">
3376
+ <xsl:value-of select="concat(normalize-space(@target), '.pdf')"/>
3377
+ </xsl:when>
3378
+ <xsl:otherwise>
3379
+ <xsl:value-of select="normalize-space(@target)"/>
3380
+ </xsl:otherwise>
3381
+ </xsl:choose>
3382
+ </xsl:variable>
3383
+ <xsl:variable name="target_text">
3363
3384
  <xsl:choose>
3364
3385
  <xsl:when test="starts-with(normalize-space(@target), 'mailto:')">
3365
3386
  <xsl:value-of select="normalize-space(substring-after(@target, 'mailto:'))"/>
@@ -3372,19 +3393,19 @@
3372
3393
  <fo:inline xsl:use-attribute-sets="link-style">
3373
3394
 
3374
3395
  <xsl:choose>
3375
- <xsl:when test="$target = ''">
3396
+ <xsl:when test="$target_text = ''">
3376
3397
  <xsl:apply-templates/>
3377
3398
  </xsl:when>
3378
3399
  <xsl:otherwise>
3379
- <fo:basic-link external-destination="{@target}" fox:alt-text="{@target}">
3400
+ <fo:basic-link external-destination="{$target}" fox:alt-text="{$target}">
3380
3401
  <xsl:choose>
3381
3402
  <xsl:when test="normalize-space(.) = ''">
3382
- <!-- <xsl:value-of select="$target"/> -->
3383
3403
  <xsl:call-template name="add-zero-spaces-link-java">
3384
- <xsl:with-param name="text" select="$target"/>
3404
+ <xsl:with-param name="text" select="$target_text"/>
3385
3405
  </xsl:call-template>
3386
3406
  </xsl:when>
3387
3407
  <xsl:otherwise>
3408
+ <!-- output text from <link>text</link> -->
3388
3409
  <xsl:apply-templates/>
3389
3410
  </xsl:otherwise>
3390
3411
  </xsl:choose>
@@ -3962,6 +3983,7 @@
3962
3983
  </xsl:template><xsl:template match="*[local-name()='sourcecode']" name="sourcecode">
3963
3984
 
3964
3985
  <fo:block-container margin-left="0mm">
3986
+ <xsl:copy-of select="@id"/>
3965
3987
  <xsl:if test="parent::*[local-name() = 'note']">
3966
3988
  <xsl:attribute name="margin-left">
3967
3989
  <xsl:choose>
@@ -4239,6 +4261,7 @@
4239
4261
  </xsl:template><xsl:template match="*[local-name() = 'example']">
4240
4262
  <fo:block id="{@id}" xsl:use-attribute-sets="example-style">
4241
4263
 
4264
+
4242
4265
  <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
4243
4266
 
4244
4267
  <xsl:variable name="element">
@@ -4348,12 +4371,13 @@
4348
4371
 
4349
4372
 
4350
4373
 
4374
+
4351
4375
  <xsl:call-template name="getTitle">
4352
4376
  <xsl:with-param name="name" select="'title-source'"/>
4353
4377
  </xsl:call-template>
4378
+ <xsl:text>: </xsl:text>
4354
4379
 
4355
4380
 
4356
- <xsl:text>: </xsl:text>
4357
4381
  </fo:inline>
4358
4382
 
4359
4383
  <fo:inline xsl:use-attribute-sets="origin-style">
@@ -4480,6 +4504,7 @@
4480
4504
 
4481
4505
 
4482
4506
 
4507
+
4483
4508
  </xsl:variable>
4484
4509
 
4485
4510
  <xsl:variable name="padding-right">
@@ -5244,6 +5269,9 @@
5244
5269
  <xsl:when test="parent::*[local-name() = 'preface']">
5245
5270
  <xsl:value-of select="$level_total - 1"/>
5246
5271
  </xsl:when>
5272
+ <xsl:when test="ancestor::*[local-name() = 'preface'] and not(ancestor::*[local-name() = 'foreword']) and not(ancestor::*[local-name() = 'introduction'])"> <!-- for preface/clause -->
5273
+ <xsl:value-of select="$level_total - 1"/>
5274
+ </xsl:when>
5247
5275
  <xsl:when test="ancestor::*[local-name() = 'preface']">
5248
5276
  <xsl:value-of select="$level_total - 2"/>
5249
5277
  </xsl:when>
@@ -5384,7 +5412,14 @@
5384
5412
  <xsl:when test="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]">
5385
5413
  <xsl:value-of select="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
5386
5414
  </xsl:when>
5387
- <xsl:otherwise><xsl:value-of select="$key"/></xsl:otherwise>
5415
+ <xsl:otherwise>
5416
+ <xsl:variable name="key_">
5417
+ <xsl:call-template name="capitalize">
5418
+ <xsl:with-param name="str" select="translate($key, '_', ' ')"/>
5419
+ </xsl:call-template>
5420
+ </xsl:variable>
5421
+ <xsl:value-of select="$key_"/>
5422
+ </xsl:otherwise>
5388
5423
  </xsl:choose>
5389
5424
 
5390
5425
  </xsl:template><xsl:template name="setTrackChangesStyles">
@@ -1122,6 +1122,7 @@
1122
1122
 
1123
1123
 
1124
1124
 
1125
+
1125
1126
  </xsl:attribute-set><xsl:attribute-set name="sourcecode-style">
1126
1127
  <xsl:attribute name="white-space">pre</xsl:attribute>
1127
1128
  <xsl:attribute name="wrap-option">wrap</xsl:attribute>
@@ -1190,6 +1191,7 @@
1190
1191
 
1191
1192
 
1192
1193
 
1194
+
1193
1195
  </xsl:attribute-set><xsl:attribute-set name="example-body-style">
1194
1196
 
1195
1197
 
@@ -1209,9 +1211,7 @@
1209
1211
 
1210
1212
 
1211
1213
 
1212
-
1213
-
1214
-
1214
+
1215
1215
 
1216
1216
 
1217
1217
 
@@ -1261,6 +1261,7 @@
1261
1261
 
1262
1262
 
1263
1263
 
1264
+
1264
1265
  </xsl:attribute-set><xsl:attribute-set name="appendix-style">
1265
1266
 
1266
1267
 
@@ -1277,11 +1278,13 @@
1277
1278
  <xsl:attribute name="text-decoration">underline</xsl:attribute>
1278
1279
 
1279
1280
 
1281
+
1280
1282
  </xsl:attribute-set><xsl:attribute-set name="eref-style">
1281
1283
 
1282
1284
 
1283
1285
 
1284
1286
 
1287
+
1285
1288
  </xsl:attribute-set><xsl:attribute-set name="note-style">
1286
1289
 
1287
1290
 
@@ -1379,6 +1382,7 @@
1379
1382
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1380
1383
 
1381
1384
 
1385
+
1382
1386
  </xsl:attribute-set><xsl:attribute-set name="origin-style">
1383
1387
 
1384
1388
 
@@ -1386,6 +1390,7 @@
1386
1390
  <xsl:attribute name="text-decoration">underline</xsl:attribute>
1387
1391
 
1388
1392
 
1393
+
1389
1394
  </xsl:attribute-set><xsl:attribute-set name="term-style">
1390
1395
 
1391
1396
  <xsl:attribute name="margin-bottom">10pt</xsl:attribute>
@@ -1458,8 +1463,10 @@
1458
1463
  </xsl:attribute-set><xsl:attribute-set name="admitted-style">
1459
1464
 
1460
1465
 
1466
+
1461
1467
  </xsl:attribute-set><xsl:attribute-set name="deprecates-style">
1462
1468
 
1469
+
1463
1470
  </xsl:attribute-set><xsl:attribute-set name="definition-style">
1464
1471
 
1465
1472
 
@@ -2212,6 +2219,7 @@
2212
2219
 
2213
2220
 
2214
2221
 
2222
+
2215
2223
  <xsl:if test="$lang = 'ar'">
2216
2224
  <xsl:attribute name="padding-right">1mm</xsl:attribute>
2217
2225
  </xsl:if>
@@ -2580,6 +2588,7 @@
2580
2588
 
2581
2589
 
2582
2590
 
2591
+
2583
2592
  <xsl:variable name="title-key">
2584
2593
 
2585
2594
 
@@ -2868,6 +2877,8 @@
2868
2877
 
2869
2878
  <xsl:apply-templates/>
2870
2879
  </fo:inline>
2880
+ </xsl:template><xsl:template match="*[local-name()='padding']">
2881
+ <fo:inline padding-right="{@value}"> </fo:inline>
2871
2882
  </xsl:template><xsl:template match="*[local-name()='sup']">
2872
2883
  <fo:inline font-size="80%" vertical-align="super">
2873
2884
  <xsl:apply-templates/>
@@ -3360,6 +3371,16 @@
3360
3371
  <mathml:mspace width="0.5ex"/>
3361
3372
  </xsl:template><xsl:template match="mathml:math/*[local-name()='unit']" mode="mathml"/><xsl:template match="mathml:math/*[local-name()='prefix']" mode="mathml"/><xsl:template match="mathml:math/*[local-name()='dimension']" mode="mathml"/><xsl:template match="mathml:math/*[local-name()='quantity']" mode="mathml"/><xsl:template match="*[local-name()='localityStack']"/><xsl:template match="*[local-name()='link']" name="link">
3362
3373
  <xsl:variable name="target">
3374
+ <xsl:choose>
3375
+ <xsl:when test="@updatetype = 'true'">
3376
+ <xsl:value-of select="concat(normalize-space(@target), '.pdf')"/>
3377
+ </xsl:when>
3378
+ <xsl:otherwise>
3379
+ <xsl:value-of select="normalize-space(@target)"/>
3380
+ </xsl:otherwise>
3381
+ </xsl:choose>
3382
+ </xsl:variable>
3383
+ <xsl:variable name="target_text">
3363
3384
  <xsl:choose>
3364
3385
  <xsl:when test="starts-with(normalize-space(@target), 'mailto:')">
3365
3386
  <xsl:value-of select="normalize-space(substring-after(@target, 'mailto:'))"/>
@@ -3372,19 +3393,19 @@
3372
3393
  <fo:inline xsl:use-attribute-sets="link-style">
3373
3394
 
3374
3395
  <xsl:choose>
3375
- <xsl:when test="$target = ''">
3396
+ <xsl:when test="$target_text = ''">
3376
3397
  <xsl:apply-templates/>
3377
3398
  </xsl:when>
3378
3399
  <xsl:otherwise>
3379
- <fo:basic-link external-destination="{@target}" fox:alt-text="{@target}">
3400
+ <fo:basic-link external-destination="{$target}" fox:alt-text="{$target}">
3380
3401
  <xsl:choose>
3381
3402
  <xsl:when test="normalize-space(.) = ''">
3382
- <!-- <xsl:value-of select="$target"/> -->
3383
3403
  <xsl:call-template name="add-zero-spaces-link-java">
3384
- <xsl:with-param name="text" select="$target"/>
3404
+ <xsl:with-param name="text" select="$target_text"/>
3385
3405
  </xsl:call-template>
3386
3406
  </xsl:when>
3387
3407
  <xsl:otherwise>
3408
+ <!-- output text from <link>text</link> -->
3388
3409
  <xsl:apply-templates/>
3389
3410
  </xsl:otherwise>
3390
3411
  </xsl:choose>
@@ -3962,6 +3983,7 @@
3962
3983
  </xsl:template><xsl:template match="*[local-name()='sourcecode']" name="sourcecode">
3963
3984
 
3964
3985
  <fo:block-container margin-left="0mm">
3986
+ <xsl:copy-of select="@id"/>
3965
3987
  <xsl:if test="parent::*[local-name() = 'note']">
3966
3988
  <xsl:attribute name="margin-left">
3967
3989
  <xsl:choose>
@@ -4239,6 +4261,7 @@
4239
4261
  </xsl:template><xsl:template match="*[local-name() = 'example']">
4240
4262
  <fo:block id="{@id}" xsl:use-attribute-sets="example-style">
4241
4263
 
4264
+
4242
4265
  <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
4243
4266
 
4244
4267
  <xsl:variable name="element">
@@ -4348,12 +4371,13 @@
4348
4371
 
4349
4372
 
4350
4373
 
4374
+
4351
4375
  <xsl:call-template name="getTitle">
4352
4376
  <xsl:with-param name="name" select="'title-source'"/>
4353
4377
  </xsl:call-template>
4378
+ <xsl:text>: </xsl:text>
4354
4379
 
4355
4380
 
4356
- <xsl:text>: </xsl:text>
4357
4381
  </fo:inline>
4358
4382
 
4359
4383
  <fo:inline xsl:use-attribute-sets="origin-style">
@@ -4480,6 +4504,7 @@
4480
4504
 
4481
4505
 
4482
4506
 
4507
+
4483
4508
  </xsl:variable>
4484
4509
 
4485
4510
  <xsl:variable name="padding-right">
@@ -5244,6 +5269,9 @@
5244
5269
  <xsl:when test="parent::*[local-name() = 'preface']">
5245
5270
  <xsl:value-of select="$level_total - 1"/>
5246
5271
  </xsl:when>
5272
+ <xsl:when test="ancestor::*[local-name() = 'preface'] and not(ancestor::*[local-name() = 'foreword']) and not(ancestor::*[local-name() = 'introduction'])"> <!-- for preface/clause -->
5273
+ <xsl:value-of select="$level_total - 1"/>
5274
+ </xsl:when>
5247
5275
  <xsl:when test="ancestor::*[local-name() = 'preface']">
5248
5276
  <xsl:value-of select="$level_total - 2"/>
5249
5277
  </xsl:when>
@@ -5384,7 +5412,14 @@
5384
5412
  <xsl:when test="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]">
5385
5413
  <xsl:value-of select="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
5386
5414
  </xsl:when>
5387
- <xsl:otherwise><xsl:value-of select="$key"/></xsl:otherwise>
5415
+ <xsl:otherwise>
5416
+ <xsl:variable name="key_">
5417
+ <xsl:call-template name="capitalize">
5418
+ <xsl:with-param name="str" select="translate($key, '_', ' ')"/>
5419
+ </xsl:call-template>
5420
+ </xsl:variable>
5421
+ <xsl:value-of select="$key_"/>
5422
+ </xsl:otherwise>
5388
5423
  </xsl:choose>
5389
5424
 
5390
5425
  </xsl:template><xsl:template name="setTrackChangesStyles">
@@ -9,17 +9,17 @@ module IsoDoc
9
9
  @meta = Metadata.new(lang, script, labels)
10
10
  end
11
11
 
12
- def xref_init(lang, script, klass, labels, options)
12
+ def xref_init(lang, script, _klass, labels, options)
13
13
  html = HtmlConvert.new(language: lang, script: script)
14
14
  @xrefs = Xref.new(lang, script, html, labels, options)
15
15
  end
16
16
 
17
17
  def i18n_init(lang, script, i18nyaml = nil)
18
18
  @i18n = I18n.new(
19
- lang, script, i18nyaml ||
20
- Metanorma::IHO.configuration.i18nyaml || @i18nyaml)
19
+ lang, script, i18nyaml ||
20
+ Metanorma::IHO.configuration.i18nyaml || @i18nyaml
21
+ )
21
22
  end
22
23
  end
23
24
  end
24
25
  end
25
-
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module IHO
3
- VERSION = "0.3.3".freeze
3
+ VERSION = "0.3.4".freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-iho
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.3
4
+ version: 0.3.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-05-24 00:00:00.000000000 Z
11
+ date: 2021-06-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: htmlentities
@@ -190,6 +190,7 @@ extra_rdoc_files: []
190
190
  files:
191
191
  - ".github/workflows/rake.yml"
192
192
  - ".gitignore"
193
+ - ".hound.yml"
193
194
  - ".rubocop.yml"
194
195
  - CODE_OF_CONDUCT.md
195
196
  - Gemfile