metanorma-standoc 2.4.6 → 2.4.8
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ce54912310b9af4d98ddc7626191a27b3dd982afbcbba47af1f2b1503d1eaac1
|
4
|
+
data.tar.gz: db2b1f1bafa6875952c611db4bc4f31568d63102545fb15b9236afd69e77f84b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 43d771eebc8879517b65e977a74add3008cc6bfc636f8408a48c0761352a31e113cb2a5720406ce0748faccdbad4e6ff1f290b2a4c446fd576f2a0f91c6bb054
|
7
|
+
data.tar.gz: 73da28422191e64bd324959c1fa63fc29b82074284fc1dc9a25ea70a5982bdb471d1961a3259d26455c9ea470b9f77ee3cc7c64a03f6e645acd9e8e69aa93787
|
@@ -145,15 +145,26 @@ module Metanorma
|
|
145
145
|
# If Asciidoctor, convert top clauses to tags and wrap in <boilerplate>
|
146
146
|
def boilerplate_file_restructure(file)
|
147
147
|
ret = adoc2xml(file, backend.to_sym)
|
148
|
-
|
149
|
-
ret.traverse do |n|
|
150
|
-
n.element? and n.namespace.href == ns and n.namespace = nil
|
151
|
-
end
|
148
|
+
boilerplate_xml_cleanup(ret)
|
152
149
|
ret.name = "boilerplate"
|
153
150
|
boilerplate_top_elements(ret)
|
154
151
|
ret
|
155
152
|
end
|
156
153
|
|
154
|
+
# remove Metanorma namespace, so generated doc containing boilerplate
|
155
|
+
# can be queried consistently
|
156
|
+
# _\d+ anchor is assigned to titleless clauses, will clash with main doc
|
157
|
+
# instances of same
|
158
|
+
def boilerplate_xml_cleanup(xml)
|
159
|
+
ns = xml.namespace.href
|
160
|
+
xml.traverse do |n|
|
161
|
+
n.element? or next
|
162
|
+
n.namespace.href == ns and n.namespace = nil
|
163
|
+
/^_\d+$/.match?(n["id"]) and
|
164
|
+
n["id"] = "_#{UUIDTools::UUID.random_create}"
|
165
|
+
end
|
166
|
+
end
|
167
|
+
|
157
168
|
def boilerplate_top_elements(xml)
|
158
169
|
xml.elements.each do |e|
|
159
170
|
(t = e.at("./title") and /-statement$/.match?(t.text)) or next
|
@@ -22,9 +22,9 @@ module Metanorma
|
|
22
22
|
Asciidoctor::Extensions.register do
|
23
23
|
preprocessor Metanorma::Standoc::Datamodel::AttributesTablePreprocessor
|
24
24
|
preprocessor Metanorma::Standoc::Datamodel::DiagramPreprocessor
|
25
|
-
preprocessor Metanorma::Plugin::Glossarist::DatasetPreprocessor
|
26
25
|
preprocessor Metanorma::Plugin::Datastruct::Json2TextPreprocessor
|
27
26
|
preprocessor Metanorma::Plugin::Datastruct::Yaml2TextPreprocessor
|
27
|
+
preprocessor Metanorma::Plugin::Glossarist::DatasetPreprocessor
|
28
28
|
inline_macro Metanorma::Standoc::PreferredTermInlineMacro
|
29
29
|
inline_macro Metanorma::Standoc::DateInlineMacro
|
30
30
|
inline_macro Metanorma::Standoc::SpanInlineMacro
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: metanorma-standoc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.4.
|
4
|
+
version: 2.4.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-06
|
11
|
+
date: 2023-07-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: asciidoctor
|