metanorma-itu 2.2.9 → 2.2.11

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.2 -->
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">
@@ -210,6 +211,9 @@
210
211
  <data type="boolean"/>
211
212
  </attribute>
212
213
  </optional>
214
+ <optional>
215
+ <attribute name="style"/>
216
+ </optional>
213
217
  <ref name="CitationType"/>
214
218
  <oneOrMore>
215
219
  <ref name="PureTextElement"/>
@@ -1349,15 +1353,19 @@
1349
1353
  </choice>
1350
1354
  </element>
1351
1355
  </define>
1356
+ <define name="Root-Attributes">
1357
+ <attribute name="version"/>
1358
+ <attribute name="schema-version"/>
1359
+ <attribute name="type">
1360
+ <choice>
1361
+ <value>semantic</value>
1362
+ <value>presentation</value>
1363
+ </choice>
1364
+ </attribute>
1365
+ </define>
1352
1366
  <define name="standard-document">
1353
1367
  <element name="standard-document">
1354
- <attribute name="version"/>
1355
- <attribute name="type">
1356
- <choice>
1357
- <value>semantic</value>
1358
- <value>presentation</value>
1359
- </choice>
1360
- </attribute>
1368
+ <ref name="Root-Attributes"/>
1361
1369
  <ref name="bibdata"/>
1362
1370
  <optional>
1363
1371
  <ref name="misccontainer"/>
@@ -2131,6 +2139,7 @@
2131
2139
  <choice>
2132
2140
  <value>identical</value>
2133
2141
  <value>modified</value>
2142
+ <value>adapted</value>
2134
2143
  <value>restyled</value>
2135
2144
  <value>context-added</value>
2136
2145
  <value>generalisation</value>
@@ -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.9".freeze
3
+ VERSION = "2.2.11".freeze
4
4
  end
5
5
  end
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.9
4
+ version: 2.2.11
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-04-10 00:00:00.000000000 Z
11
+ date: 2023-05-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: htmlentities