metanorma-ieee 1.0.9 → 1.0.11

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.
@@ -38,6 +38,9 @@ module IsoDoc
38
38
 
39
39
  def make_WordToC(docxml, level)
40
40
  toc = ""
41
+ if source = docxml.at("//div[@class = 'TOC']")
42
+ toc = to_xml(source.children)
43
+ end
41
44
  xpath = (1..level).each.map do |i|
42
45
  "//h#{i}[not(ancestor::*[@class = 'WordSection2'])]"
43
46
  end.join (" | ")
@@ -70,7 +73,7 @@ module IsoDoc
70
73
  if hdr.at("./ancestor::div[@class = 'Annex']")
71
74
  hdr.delete("class")
72
75
  hdr["style"] = "mso-list:l13 level#{idx} lfo33;"
73
- elsif hdr.at("./ancestor::div[@class = 'Section3']")
76
+ elsif hdr.at("./ancestor::div[@class = 'Section3' or @class = 'WordSectionContents']")
74
77
  hdr.name = "p"
75
78
  hdr["class"] = "IEEEStdsLevel#{idx}frontmatter"
76
79
  else
@@ -47,12 +47,11 @@ module IsoDoc
47
47
  ulstyle: "l11", olstyle: "l16" }
48
48
  end
49
49
 
50
- def abstract(isoxml, out)
51
- f = isoxml.at(ns("//preface/abstract")) || return
50
+ def abstract(clause, out)
52
51
  page_break(out)
53
- out.div **attr_code(id: f["id"], class: "abstract") do |s|
54
- clause_name(f, f.at(ns("./title")), s, { class: "AbstractTitle" })
55
- f.elements.each { |e| parse(e, s) unless e.name == "title" }
52
+ out.div **attr_code(id: clause["id"], class: "abstract") do |s|
53
+ clause_name(clause, clause.at(ns("./title")), s, { class: "AbstractTitle" })
54
+ clause.elements.each { |e| parse(e, s) unless e.name == "title" }
56
55
  end
57
56
  end
58
57
 
@@ -176,6 +175,16 @@ module IsoDoc
176
175
  end
177
176
  end
178
177
 
178
+ def table_of_contents(clause, out)
179
+ out.div class: "WordSectionContents" do |div|
180
+ clause_name(clause, clause.at(ns("./title")), div,
181
+ { class: "IEEEStdsLevel1frontmatter" })
182
+ clause.elements.each do |e|
183
+ parse(e, div) unless e.name == "title"
184
+ end
185
+ end
186
+ end
187
+
179
188
  include BaseConvert
180
189
  include Init
181
190
  end
@@ -118,7 +118,7 @@ module Metanorma
118
118
  end
119
119
  end
120
120
 
121
- def select_docid(ref)
121
+ def select_docid(ref, type = nil)
122
122
  ret = super
123
123
  if %w(standard techreport).include?(ref["type"]) then ret
124
124
  else
@@ -1,6 +1,7 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
- <grammar ns="https://www.metanorma.org/ns/ieee" xmlns="http://relaxng.org/ns/structure/1.0">
2
+ <grammar ns='https://www.metanorma.org/ns/ieee' xmlns="http://relaxng.org/ns/structure/1.0">
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.
@@ -29,13 +30,7 @@
29
30
  </include>
30
31
  <define name="ieee-standard">
31
32
  <element name="ieee-standard">
32
- <attribute name="version"/>
33
- <attribute name="type">
34
- <choice>
35
- <value>semantic</value>
36
- <value>presentation</value>
37
- </choice>
38
- </attribute>
33
+ <ref name="Root-Attributes"/>
39
34
  <ref name="bibdata"/>
40
35
  <zeroOrMore>
41
36
  <ref name="termdocsource"/>
@@ -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,5 +1,5 @@
1
1
  module Metanorma
2
2
  module IEEE
3
- VERSION = "1.0.9".freeze
3
+ VERSION = "1.0.11".freeze
4
4
  end
5
5
  end
@@ -27,6 +27,9 @@ Gem::Specification.new do |spec|
27
27
 
28
28
  spec.add_dependency "metanorma-standoc", "~> 2.4.2"
29
29
  spec.add_dependency "mnconvert", "~> 1.20"
30
+ #spec.add_dependency "pubid-ieee", "~> 0.1.1"
31
+ #spec.add_dependency "pubid-iso", "~> 0.5.3"
32
+ #spec.add_dependency "relaton-iso", "~> 1.15.4"
30
33
 
31
34
  spec.add_development_dependency "debug"
32
35
  spec.add_development_dependency "equivalent-xml", "~> 0.6"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-ieee
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.9
4
+ version: 1.0.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: metanorma-standoc