metanorma-itu 1.0.8 → 1.0.9

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 92b374ee3e278b12759d26c62e85d81023788306f4639ca919aa78906149c616
4
- data.tar.gz: 043a1c9e5369836d7c55a008e2feda0ebdd24885be8bd80bc7eb8713b67d90cc
3
+ metadata.gz: 6fdcd13b8422d4f34b193763e505ce838c6a9db793fa61be7e9259d063f2d42e
4
+ data.tar.gz: 530301c50e4dd6f121015b5821b1e4d971a7de37eb8016ded73143e37ab03dfd
5
5
  SHA512:
6
- metadata.gz: 179787fb1008d36a701db731f7273acf0993a0ce7d1c2f36c92dc35dba6928264e5bcce59336bdf5de2db62e69aa05603c1b4ceaadcb0b1b7b38f287836ee566
7
- data.tar.gz: 9fb8d8a62f6530e15a0205ef068f2fd90f5d6992b8e90010b7305f9ad34a506c74d883204207b24bb684f3636049171825cac4832a4448455ecef924f656a182
6
+ metadata.gz: 2667f0a8b869354315893203b60b4a091565c027b95136ca42636bffc175d82add61ce900ea8a3430f3d6c09e21482f0489651a188c181ed08b35ef197c9e911
7
+ data.tar.gz: 3c6a9be2da83277ac8286c41c2512bfb8f49995a30fb0231169e61c4dbb1fc7284c647c60a181003cb7e32ca7fb4c354d2784877da3932bc31f392610586f13a
@@ -43,32 +43,14 @@ module Asciidoctor
43
43
  end
44
44
 
45
45
  def olist(node)
46
+ id = Asciidoctor::Standoc::Utils::anchor_or_uuid(node)
46
47
  noko do |xml|
47
- xml.ol **attr_code(id: Asciidoctor::Standoc::Utils::anchor_or_uuid(node),
48
- class: node.attr("class")) do |xml_ol|
48
+ xml.ol **attr_code(id: id, class: node.attr("class")) do |xml_ol|
49
49
  node.items.each { |item| li(xml_ol, item) }
50
50
  end
51
51
  end.join("\n")
52
52
  end
53
53
 
54
- def clause_parse(attrs, xml, node)
55
- attrs[:preface] = true if node.attr("style") == "preface"
56
- super
57
- end
58
-
59
- def move_sections_into_preface(x, preface)
60
- x.xpath("//clause[@preface]").each do |c|
61
- c.delete("preface")
62
- preface.add_child c.remove
63
- end
64
- end
65
-
66
- def make_preface(x, s)
67
- s.add_previous_sibling("<preface/>") unless x.at("//preface")
68
- make_abstract(x, s)
69
- move_sections_into_preface(x, x.at("//preface"))
70
- end
71
-
72
54
  def document(node)
73
55
  init(node)
74
56
  ret1 = makexml(node)
@@ -99,40 +81,12 @@ module Asciidoctor
99
81
  case ret
100
82
  when "definitions" then "terms and definitions"
101
83
  when "abbreviations and acronyms" then "symbols and abbreviated terms"
84
+ when "references" then "normative references"
102
85
  else
103
86
  super
104
87
  end
105
88
  end
106
89
 
107
- def section(node)
108
- a = section_attributes(node)
109
- noko do |xml|
110
- case sectiontype(node)
111
- when "references" then norm_ref_parse(a, xml, node)
112
- when "terms and definitions"
113
- @term_def = true
114
- term_def_parse(a, xml, node, true)
115
- @term_def = false
116
- when "symbols and abbreviated terms"
117
- symbols_parse(a, xml, node)
118
- when "bibliography" then bibliography_parse(a, xml, node)
119
- else
120
- if @term_def then term_def_subclause_parse(a, xml, node)
121
- elsif @definitions then symbols_parse(a, xml, node)
122
- elsif @biblio then bibliography_parse(a, xml, node)
123
- elsif node.attr("style") == "bibliography"
124
- bibliography_parse(a, xml, node)
125
- elsif node.attr("style") == "abstract"
126
- abstract_parse(a, xml, node)
127
- elsif node.attr("style") == "appendix" && node.level == 1
128
- annex_parse(a, xml, node)
129
- else
130
- clause_parse(a, xml, node)
131
- end
132
- end
133
- end.join("\n")
134
- end
135
-
136
90
  def norm_ref_parse(attrs, xml, node)
137
91
  @norm_ref = true
138
92
  xml.references **attr_code(attrs) do |xml_section|
@@ -29,7 +29,7 @@ module IsoDoc
29
29
  isoxml.xpath(ns(FRONT_CLAUSE)).each do |c|
30
30
  title = c&.at(ns("./title"))
31
31
  out.div **attr_code(id: c["id"]) do |s|
32
- clause_name(nil, title&.content, s, class: "IntroTitle")
32
+ clause_name(nil, title, s, class: "IntroTitle")
33
33
  c.elements.reject { |c1| c1.name == "title" }.each do |c1|
34
34
  parse(c1, s)
35
35
  end
@@ -70,9 +70,9 @@ module IsoDoc
70
70
  def middle_section_asset_names(d)
71
71
  return super unless @hierarchical_assets
72
72
  middle_sections = "//clause[title = 'Scope'] | "\
73
- "//foreword | //introduction | "\
73
+ "//foreword | //introduction | //acknowledgements | "\
74
74
  "//references[title = 'References' or title = 'references'] | "\
75
- "//sections/terms | "\
75
+ "//sections/terms | //preface/clause | "\
76
76
  "//sections/definitions | //clause[parent::sections]"
77
77
  d.xpath(ns(middle_sections)).each do |c|
78
78
  hierarchical_asset_names(c, @anchors[c["id"]][:label])
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module ITU
3
- VERSION = "1.0.8"
3
+ VERSION = "1.0.9"
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: 1.0.8
4
+ version: 1.0.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: 2020-02-17 00:00:00.000000000 Z
11
+ date: 2020-02-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: htmlentities