metanorma-itu 2.2.8 → 2.2.10

Sign up to get free protection for your applications and to get access to all the features.
@@ -195,6 +195,12 @@ module IsoDoc
195
195
  ret.gsub(/-/, "‑").gsub(/ /, " ")
196
196
  end
197
197
 
198
+ def toc_title(docxml)
199
+ doctype = docxml.at(ns("//bibdata/ext/doctype"))
200
+ doctype&.text == "resolution" and return
201
+ super
202
+ end
203
+
198
204
  include Init
199
205
  end
200
206
  end
@@ -22,24 +22,28 @@ module IsoDoc
22
22
  end
23
23
 
24
24
  def make_body2(body, docxml)
25
- body.div **{ class: "WordSection2" } do |div2|
25
+ body.div class: "WordSection2" do |div2|
26
26
  info docxml, div2
27
27
  boilerplate docxml, div2
28
- preface_block docxml, div2
29
- abstract docxml, div2
30
- keywords docxml, div2
31
- preface docxml, div2
28
+ front docxml, div2
32
29
  div2.p { |p| p << "&#xa0;" } # placeholder
33
30
  end
34
31
  section_break(body)
35
32
  end
36
33
 
37
- def abstract(isoxml, out)
38
- f = isoxml.at(ns("//preface/abstract")) || return
39
- out.div **attr_code(id: f["id"], class: "Abstract") do |s|
40
- clause_name(f, "Summary", s, class: "AbstractTitle")
41
- f.elements.each { |e| parse(e, s) unless e.name == "title" }
34
+ def front(isoxml, out)
35
+ if !isoxml.at(ns("//preface/abstract"))
36
+ keywords(isoxml, out)
42
37
  end
38
+ super # do keyword with abstract
39
+ end
40
+
41
+ def abstract(clause, out)
42
+ out.div **attr_code(id: clause["id"], class: "Abstract") do |s|
43
+ clause_name(clause, "Summary", s, class: "AbstractTitle")
44
+ clause.elements.each { |e| parse(e, s) unless e.name == "title" }
45
+ end
46
+ keywords(nil, out)
43
47
  end
44
48
 
45
49
  def keywords(_docxml, out)
@@ -47,7 +51,7 @@ module IsoDoc
47
51
  kw.nil? || kw.empty? and return
48
52
  out.div **attr_code(class: "Keyword") do |div|
49
53
  clause_name(nil, "Keywords", div, class: "IntroTitle")
50
- div.p kw.join(", ") + "."
54
+ div.p "#{kw.join(', ')}."
51
55
  end
52
56
  end
53
57
 
@@ -127,6 +131,24 @@ module IsoDoc
127
131
  super.merge(ret)
128
132
  end
129
133
 
134
+ def table_of_contents(clause, out)
135
+ page_break(out)
136
+ out.div **attr_code(preface_attrs(clause)) do |div|
137
+ div.p class: "zzContents" do |p|
138
+ clause.at(ns("./title"))&.children&.each do |c|
139
+ parse(c, p)
140
+ end
141
+ end
142
+ div.p style: "tab-stops:right 17.0cm" do |p|
143
+ insert_tab(p, 1)
144
+ p << "<b>#{@i18n.page}</b>"
145
+ end
146
+ clause.elements.each do |e|
147
+ parse(e, div) unless e.name == "title"
148
+ end
149
+ end
150
+ end
151
+
130
152
  include BaseConvert
131
153
  include Init
132
154
  end
@@ -17,6 +17,7 @@
17
17
  these elements; we just want one namespace for any child grammars
18
18
  of this.
19
19
  -->
20
+ <!-- VERSION v1.2.1 -->
20
21
  <grammar xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
21
22
  <include href="reqt.rng"/>
22
23
  <include href="basicdoc.rng">
@@ -382,6 +383,9 @@
382
383
  <optional>
383
384
  <ref name="dl"/>
384
385
  </optional>
386
+ <optional>
387
+ <ref name="source"/>
388
+ </optional>
385
389
  </element>
386
390
  </define>
387
391
  <define name="figure">
@@ -404,9 +408,6 @@
404
408
  <attribute name="class"/>
405
409
  </optional>
406
410
  <ref name="BlockAttributes"/>
407
- <optional>
408
- <ref name="source"/>
409
- </optional>
410
411
  <optional>
411
412
  <ref name="tname"/>
412
413
  </optional>
@@ -431,6 +432,20 @@
431
432
  <zeroOrMore>
432
433
  <ref name="note"/>
433
434
  </zeroOrMore>
435
+ <optional>
436
+ <ref name="source"/>
437
+ </optional>
438
+ </element>
439
+ </define>
440
+ <define name="source">
441
+ <element name="source">
442
+ <attribute name="status">
443
+ <ref name="SourceStatusType"/>
444
+ </attribute>
445
+ <ref name="origin"/>
446
+ <optional>
447
+ <ref name="modification"/>
448
+ </optional>
434
449
  </element>
435
450
  </define>
436
451
  <define name="sourcecode">
@@ -1335,15 +1350,19 @@
1335
1350
  </choice>
1336
1351
  </element>
1337
1352
  </define>
1353
+ <define name="Root-Attributes">
1354
+ <attribute name="version"/>
1355
+ <attribute name="schema-version"/>
1356
+ <attribute name="type">
1357
+ <choice>
1358
+ <value>semantic</value>
1359
+ <value>presentation</value>
1360
+ </choice>
1361
+ </attribute>
1362
+ </define>
1338
1363
  <define name="standard-document">
1339
1364
  <element name="standard-document">
1340
- <attribute name="version"/>
1341
- <attribute name="type">
1342
- <choice>
1343
- <value>semantic</value>
1344
- <value>presentation</value>
1345
- </choice>
1346
- </attribute>
1365
+ <ref name="Root-Attributes"/>
1347
1366
  <ref name="bibdata"/>
1348
1367
  <optional>
1349
1368
  <ref name="misccontainer"/>
@@ -2099,10 +2118,7 @@
2099
2118
  <define name="termsource">
2100
2119
  <element name="termsource">
2101
2120
  <attribute name="status">
2102
- <choice>
2103
- <value>identical</value>
2104
- <value>modified</value>
2105
- </choice>
2121
+ <ref name="SourceStatusType"/>
2106
2122
  </attribute>
2107
2123
  <attribute name="type">
2108
2124
  <choice>
@@ -2116,6 +2132,17 @@
2116
2132
  </optional>
2117
2133
  </element>
2118
2134
  </define>
2135
+ <define name="SourceStatusType">
2136
+ <choice>
2137
+ <value>identical</value>
2138
+ <value>modified</value>
2139
+ <value>restyled</value>
2140
+ <value>context-added</value>
2141
+ <value>generalisation</value>
2142
+ <value>specialisation</value>
2143
+ <value>unspecified</value>
2144
+ </choice>
2145
+ </define>
2119
2146
  <define name="origin">
2120
2147
  <element name="origin">
2121
2148
  <choice>
@@ -1,6 +1,7 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
- <grammar ns="https://www.metanorma.org/ns/itu" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
2
+ <grammar ns='https://www.metanorma.org/ns/itu' xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
3
3
  <!--
4
+ VERSION v1.2.1
4
5
  Currently we inherit from a namespaced grammar, isostandard. Until we inherit from isodoc,
5
6
  we cannot have a new default namespace: we will end up with a grammar with two different
6
7
  namespaces, one for isostandard and one for csand additions. And we do not want that.
@@ -101,13 +102,7 @@
101
102
  </include>
102
103
  <define name="itu">
103
104
  <element name="itu-standard">
104
- <attribute name="version"/>
105
- <attribute name="type">
106
- <choice>
107
- <value>semantic</value>
108
- <value>presentation</value>
109
- </choice>
110
- </attribute>
105
+ <ref name="Root-Attributes"/>
111
106
  <ref name="bibdata"/>
112
107
  <zeroOrMore>
113
108
  <ref name="termdocsource"/>
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module ITU
3
- VERSION = "2.2.8".freeze
3
+ VERSION = "2.2.10".freeze
4
4
  end
5
5
  end
@@ -26,7 +26,7 @@ Gem::Specification.new do |spec|
26
26
  spec.required_ruby_version = Gem::Requirement.new(">= 2.7.0")
27
27
 
28
28
  spec.add_dependency "htmlentities", "~> 4.3.4"
29
- spec.add_dependency "metanorma-standoc", "~> 2.4.0"
29
+ spec.add_dependency "metanorma-standoc", "~> 2.4.2"
30
30
  spec.add_dependency "ruby-jing"
31
31
  spec.add_dependency "twitter_cldr", ">= 3.0.0"
32
32
  spec.add_dependency "tzinfo-data" # we need this for windows only
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-itu
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.8
4
+ version: 2.2.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-03-27 00:00:00.000000000 Z
11
+ date: 2023-04-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: htmlentities
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 2.4.0
33
+ version: 2.4.2
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 2.4.0
40
+ version: 2.4.2
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: ruby-jing
43
43
  requirement: !ruby/object:Gem::Requirement