metanorma-utils 2.0.13 → 2.0.14
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 +4 -4
- data/lib/utils/version.rb +1 -1
- data/lib/utils/xml.rb +9 -3
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 2d02c080014b8cabcfeaa0e9ed6c6aaa0c3eaa2f577785ff2fff1f0e2a38f4e9
|
|
4
|
+
data.tar.gz: d02010244c01b3c5f08575ff928a00a947cafc36389410632c5f21adccb7e215
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 58ae304620ccfac55ec0d88a4c06f3c48b25770103439d73b95746399a8acabd73292a262fed529b0eeb5a791ba1bfdf7de0889b5d23aaf42b07c2bf1c4ea960
|
|
7
|
+
data.tar.gz: 19f07d138c5cdb0b85486fec3891a80eb0b6c0ca5ca1f70a0c14870b2960cf4329530cefc344eb1ffdfca19b5500064367339beb373c377e145f1b7155d944f2
|
data/lib/utils/version.rb
CHANGED
data/lib/utils/xml.rb
CHANGED
|
@@ -52,7 +52,12 @@ module Metanorma
|
|
|
52
52
|
# large compiles. Fragments off the shared document are
|
|
53
53
|
# independent trees; conversion is single-threaded.
|
|
54
54
|
def noko(_script = "Latn", &block)
|
|
55
|
-
|
|
55
|
+
# DocumentFragment.new without input skips the per-call parse:
|
|
56
|
+
# fragment("") minted a ParseOptions and ran a parse pass on
|
|
57
|
+
# the empty string for every call (73k per plateau compile,
|
|
58
|
+
# 30% of this method's wall time, measured). The built
|
|
59
|
+
# serialization is byte-identical.
|
|
60
|
+
fragment = Nokogiri::XML::DocumentFragment.new(noko_template)
|
|
56
61
|
::Nokogiri::XML::Builder.with fragment, &block
|
|
57
62
|
fragment
|
|
58
63
|
.to_xml(encoding: "UTF-8", indent: 0,
|
|
@@ -88,8 +93,9 @@ module Metanorma
|
|
|
88
93
|
def noko_html(&block)
|
|
89
94
|
# Fragments off the shared template are independent trees, like in
|
|
90
95
|
# #noko: duplicating the whole scaffold document per call buys
|
|
91
|
-
# nothing and copies every node of it.
|
|
92
|
-
|
|
96
|
+
# nothing and copies every node of it. No-input new skips the
|
|
97
|
+
# per-call parse, as in #noko.
|
|
98
|
+
fragment = Nokogiri::XML::DocumentFragment.new(noko_template)
|
|
93
99
|
::Nokogiri::XML::Builder.with fragment, &block
|
|
94
100
|
fragment.to_xml(encoding: "UTF-8", indent: 0,
|
|
95
101
|
save_with: Nokogiri::XML::Node::SaveOptions::AS_XML)
|