metanorma-iho 0.7.7 → 0.7.9

Sign up to get free protection for your applications and to get access to all the features.
@@ -14,10 +14,24 @@ module IsoDoc
14
14
  "[#{ordinal}]<tab/>"
15
15
  end
16
16
 
17
- def biblio_ref_entry_code(ordinal, _idents, _ids, _standard, _datefn, _bib)
17
+ def biblio_ref_entry_code(ordinal, _idents, _ids, _standard, _datefn,
18
+ _bib)
18
19
  "[#{ordinal}]<tab/>"
19
20
  end
20
21
 
22
+ def preface_rearrange(doc)
23
+ preface_move(doc.at(ns("//preface/abstract")),
24
+ %w(foreword executivesummary introduction clause acknowledgements), doc)
25
+ preface_move(doc.at(ns("//preface/foreword")),
26
+ %w(executivesummary introduction clause acknowledgements), doc)
27
+ preface_move(doc.at(ns("//preface/executivesummary")),
28
+ %w(introduction clause acknowledgements), doc)
29
+ preface_move(doc.at(ns("//preface/introduction")),
30
+ %w(clause acknowledgements), doc)
31
+ preface_move(doc.at(ns("//preface/acknowledgements")),
32
+ %w(), doc)
33
+ end
34
+
21
35
  include Init
22
36
  end
23
37
  end
@@ -12,32 +12,32 @@ module IsoDoc
12
12
  end
13
13
 
14
14
  def make_body1(body, _docxml)
15
- body.div **{ class: "WordSection1" } do |div1|
16
- div1.p **{style: "font-size:0pt;" } do
17
- |p| p << "&nbsp;"
15
+ body.div class: "WordSection1" do |div1|
16
+ div1.p style: "font-size:0pt;" do |p|
17
+ p << "&nbsp;"
18
18
  end # placeholder
19
19
  end
20
20
  section_break(body)
21
21
  end
22
22
 
23
- def make_body2(body, docxml)
24
- body.div **{ class: "WordSection2" } do |div2|
25
- boilerplate docxml, div2
26
- preface_block docxml, div2
27
- abstract docxml, div2
28
- foreword docxml, div2
29
- introduction docxml, div2
30
- preface docxml, div2
31
- acknowledgements docxml, div2
32
- div2.p { |p| p << "&nbsp;" } # placeholder
33
- end
34
- section_break(body)
35
- end
23
+ # def make_body2(body, docxml)
24
+ # body.div **{ class: "WordSection2" } do |div2|
25
+ # boilerplate docxml, div2
26
+ # preface_block docxml, div2
27
+ # abstract docxml, div2
28
+ # foreword docxml, div2
29
+ # introduction docxml, div2
30
+ # preface docxml, div2
31
+ # acknowledgements docxml, div2
32
+ # div2.p { |p| p << "&nbsp;" } # placeholder
33
+ # end
34
+ # section_break(body)
35
+ # end
36
36
 
37
37
  def authority_cleanup(docxml)
38
38
  super
39
39
  docxml.xpath("//div[@class = 'boilerplate-feedback']/p").each do |p|
40
- p["style"] = 'font-size:8pt;font-family:Arial;text-align:right'
40
+ p["style"] = "font-size:8pt;font-family:Arial;text-align:right"
41
41
  end
42
42
  end
43
43
 
@@ -1,6 +1,7 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
- <grammar ns="https://www.metanorma.org/ns/iho" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
2
+ <grammar ns='https://www.metanorma.org/ns/iho' 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.
@@ -63,13 +64,7 @@
63
64
  </define>
64
65
  <define name="iho-standard">
65
66
  <element name="iho-standard">
66
- <attribute name="version"/>
67
- <attribute name="type">
68
- <choice>
69
- <value>semantic</value>
70
- <value>presentation</value>
71
- </choice>
72
- </attribute>
67
+ <ref name="Root-Attributes"/>
73
68
  <ref name="bibdata"/>
74
69
  <zeroOrMore>
75
70
  <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.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,5 +1,5 @@
1
1
  module Metanorma
2
2
  module IHO
3
- VERSION = "0.7.7".freeze
3
+ VERSION = "0.7.9".freeze
4
4
  end
5
5
  end
@@ -27,7 +27,7 @@ Gem::Specification.new do |spec|
27
27
  spec.require_paths = ["lib"]
28
28
  spec.required_ruby_version = Gem::Requirement.new(">= 2.7.0")
29
29
 
30
- spec.add_dependency "metanorma-generic", "~> 2.4.0"
30
+ spec.add_dependency "metanorma-generic", "~> 2.4.1"
31
31
 
32
32
  spec.add_development_dependency "debug"
33
33
  spec.add_development_dependency "equivalent-xml", "~> 0.6"
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.7.7
4
+ version: 0.7.9
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: metanorma-generic
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 2.4.0
19
+ version: 2.4.1
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 2.4.0
26
+ version: 2.4.1
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: debug
29
29
  requirement: !ruby/object:Gem::Requirement