mn-requirements 0.3.4 → 0.3.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 41cb14a86e3b4fc25c64a3ac59332f35da0d111de2e8d66194273fa5d92b370b
4
- data.tar.gz: 340e4d252c1a0e2a27de24be51cec9036900a9f461b80739d3b3f086f9183f01
3
+ metadata.gz: 33414d3ac6b85f24c09e8dd8555f26e776b5c1ddd67aaf0a15217e0b9466e324
4
+ data.tar.gz: '098df5f8bba64b14bfef2ceead84bc5cc230f4601a33329092f382fcc9bce7d2'
5
5
  SHA512:
6
- metadata.gz: 7ebe357fa3c17264a716910853b96d1513fe93e7d7039a8faf2f83ff0f28197ea47dbf670498de9ed0a9dad6bee4e417e176a49a483db7007b1065404fbdcda3
7
- data.tar.gz: 17642bf0e4b3094e42a0c925aa9a4ff7ac7ed187dd735290b93964906b1eb49c151e4b5ea3523124d107591afbb7a30b2337323c632262dcd4c274dca82b2e1c
6
+ metadata.gz: b7fe62355d49df8647545cdacff491d6d7aa4696f8f680ef468839930b5c12614706f80e8adf99fa4ab2f48b42a03adf4a282acdafc23d52ceabe4d2e8093fa5
7
+ data.tar.gz: 1a7babef01ab00b531200e100b8feaf99f4a817dc14e7c9e7c0c200525443d71d0a8fa0dcee17dfdced1197104067c4e254b707f1f69d04581cd5a32dd01395a
@@ -95,16 +95,32 @@ module Metanorma
95
95
  end
96
96
 
97
97
  def requirement_component_parse(node, out)
98
- return out if node["exclude"] == "true"
99
-
98
+ node["exclude"] == "true" and return out
100
99
  ret = node.dup
101
100
  if reqt_subpart?(node.name)
102
101
  ret["type"] = reqt_component_type(node)
103
102
  ret.name = "div"
104
103
  end
104
+ descr_classif_render(ret)
105
105
  out << ret
106
106
  out
107
107
  end
108
+
109
+ def descr_classif_render(reqt)
110
+ reqt.at(ns("./classification")) or return
111
+ ins = reqt.at(ns("./classification")).before("<dl/>").previous
112
+ descr_classif_extract(reqt, ins)
113
+ end
114
+
115
+ def descr_classif_extract(desc, ins)
116
+ dlist = desc.xpath(ns("./classification"))
117
+ dlist.each do |x|
118
+ x.at(ns("./tag")).name = "dt"
119
+ x.at(ns("./value")).name = "dd"
120
+ ins << x.children
121
+ x.remove
122
+ end
123
+ end
108
124
  end
109
125
  end
110
126
  end
@@ -184,6 +184,7 @@ module Metanorma
184
184
 
185
185
  def requirement_component_parse(node, out)
186
186
  node["exclude"] == "true" and return out
187
+ descr_classif_render(node)
187
188
  node.elements.size == 1 && node.first_element_child.name == "dl" and
188
189
  return reqt_dl(node.first_element_child, out)
189
190
  node.name == "component" and
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  class Requirements
3
- VERSION = "0.3.4".freeze
3
+ VERSION = "0.3.5".freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mn-requirements
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.4
4
+ version: 0.3.5
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-10-09 00:00:00.000000000 Z
11
+ date: 2023-11-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: isodoc-i18n