metanorma-standoc 3.5.20 → 3.5.22
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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: fc313e79a3b7597ba7779788e1683bba880f0d0ac07fa17190f94eb27e1fa450
|
|
4
|
+
data.tar.gz: 887b7042c8df8946f776b9ecb7f5db2cbff82941aef47fdcd56715a855eeea56
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7dfbeeb00214be8735bd373bb8fe2ec287f26c9997ee44e3baef03c35ec391645a8ed31b3ee87f2b748bea4db535395beb0e1e68ad7aa06b74607af113aa2ee1
|
|
7
|
+
data.tar.gz: c4d1d374cef220f08adeb0b0b8ee287335e0655ffd915abc0b1aa92502e20e99453a8fc2b28bc60657fe72c86abb973655d4f0f4fe7990891d9146095a894c03
|
|
@@ -21,9 +21,24 @@ module Metanorma
|
|
|
21
21
|
end
|
|
22
22
|
end
|
|
23
23
|
|
|
24
|
+
NO_BULLET_STYLES = %w(nobullet no-bullet).freeze
|
|
25
|
+
|
|
26
|
+
# asciidoctor encodes bulletless lists through the +nobullet+ role
|
|
27
|
+
# ({@.nobullet} or {@options=nobullet}) or the +no-bullet+ option
|
|
28
|
+
# ({@options=no-bullet}); both map to a list @type, which renderers
|
|
29
|
+
# suppress markers for. The ordered list styles +none+ and
|
|
30
|
+
# renderer-native format strings flow through +olist_style+.
|
|
31
|
+
def list_bullet_type(node)
|
|
32
|
+
NO_BULLET_STYLES.each do |s|
|
|
33
|
+
node.role?(s) || node.option?(s) and return s
|
|
34
|
+
end
|
|
35
|
+
nil
|
|
36
|
+
end
|
|
37
|
+
|
|
24
38
|
def ul_attrs(node)
|
|
25
39
|
attr_code(id_attr(node).merge(keep_attrs(node)
|
|
26
|
-
.merge(
|
|
40
|
+
.merge(type: list_bullet_type(node),
|
|
41
|
+
display: node.attr("display"),
|
|
27
42
|
class: node.attr("class"),
|
|
28
43
|
"display-directives": node.attr("display-directives"))))
|
|
29
44
|
end
|
|
@@ -61,7 +76,7 @@ module Metanorma
|
|
|
61
76
|
# as a positional attribute
|
|
62
77
|
def ol_attrs(node)
|
|
63
78
|
attr_code(id_attr(node).merge(keep_attrs(node)
|
|
64
|
-
.merge(type: olist_style(node.style),
|
|
79
|
+
.merge(type: list_bullet_type(node) || olist_style(node.style),
|
|
65
80
|
start: node.attr("start"),
|
|
66
81
|
display: node.attr("display"),
|
|
67
82
|
class: node.attr("class"),
|
|
@@ -43,16 +43,10 @@ module Metanorma
|
|
|
43
43
|
[integer_part, fractional_part]
|
|
44
44
|
end
|
|
45
45
|
|
|
46
|
-
#
|
|
46
|
+
# The value emitted into <mn> is canonical positional decimal:
|
|
47
|
+
# the exponent form is a rendering decision driven by the
|
|
48
|
+
# number-format attributes, not baked into the semantic content.
|
|
47
49
|
def number(text)
|
|
48
|
-
n = BigDecimal(number_base(text))
|
|
49
|
-
trailing_zeroes = 0
|
|
50
|
-
m = /\.[1-9]*(0+)/.match(text) and trailing_zeroes += m[1].size
|
|
51
|
-
n.to_s("E").sub("e", "0" * trailing_zeroes + "e") # rubocop:disable Style/StringConcatenation
|
|
52
|
-
end
|
|
53
|
-
|
|
54
|
-
# Detect prefix and convert to decimal
|
|
55
|
-
def number_base(text)
|
|
56
50
|
case text.strip
|
|
57
51
|
when /^0[xX]([0-9A-Fa-f.]+)$/
|
|
58
52
|
parse_number_with_base(Regexp.last_match(1), 16)
|
|
@@ -60,9 +54,25 @@ module Metanorma
|
|
|
60
54
|
parse_number_with_base(Regexp.last_match(1), 2)
|
|
61
55
|
when /^0[oO]([0-7.]+)$/
|
|
62
56
|
parse_number_with_base(Regexp.last_match(1), 8)
|
|
57
|
+
when /\A[0-9]+(\.[0-9]+)?[eE][+-]?[0-9]+\z/
|
|
58
|
+
BigDecimal(text.strip).to_s("F").sub(/\.0\z/, "")
|
|
59
|
+
when /\A[0-9]+(\.[0-9]+)?\z/
|
|
60
|
+
text.strip # Regular decimal - pass through
|
|
63
61
|
else
|
|
64
|
-
text
|
|
62
|
+
BigDecimal(text.strip).to_s("F").sub(/\.0\z/, "")
|
|
63
|
+
end
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
# Handle numbers with fractional parts in different bases
|
|
67
|
+
# Split on decimal point
|
|
68
|
+
def parse_number_with_base(num_str, base)
|
|
69
|
+
integer_part, fractional_part = split_number(num_str)
|
|
70
|
+
int_value = integer_part.to_i(base)
|
|
71
|
+
return int_value.to_s if fractional_part.empty?
|
|
72
|
+
frac_value = fractional_part.chars.each_with_index.sum do |digit, index|
|
|
73
|
+
BigDecimal(digit.to_i(base).to_s) / BigDecimal((base**(index + 1)).to_s)
|
|
65
74
|
end
|
|
75
|
+
(BigDecimal(int_value.to_s) + frac_value).to_s("F")
|
|
66
76
|
end
|
|
67
77
|
|
|
68
78
|
def process(parent, target, attrs)
|
|
@@ -63,8 +63,11 @@ requirements:
|
|
|
63
63
|
- tag: "text"
|
|
64
64
|
attributes: ["x", "y", "rotate", "id", "role", "fill", "style", "transform", "font-size", "fill-rule", "base", "lang", "class", "rel", "rev", "typeof", "content", "datatype", "resource", "about", "property", "space", "font-stretch", "writing-mode", "text-decoration", "clip-path", "mask", "textLength", "lengthAdjust", "opacity"]
|
|
65
65
|
allowed_children: ["desc", "title", "tspan", "text", "a"]
|
|
66
|
+
# PlantUML emits text-layout attributes (textLength/lengthAdjust,
|
|
67
|
+
# font-*, text-anchor) on g containers; all are valid SVG presentation
|
|
68
|
+
# attributes on container elements (metanorma-pdfa#106).
|
|
66
69
|
- tag: "g"
|
|
67
|
-
attributes: ["label", "class", "id", "role", "fill", "style", "transform", "fill-rule", "visibility", "base", "lang", "rel", "rev", "typeof", "content", "datatype", "resource", "about", "property", "space", "data-name", "clip-path", "clip-rule", "mask", "opacity"]
|
|
70
|
+
attributes: ["label", "class", "id", "role", "fill", "style", "transform", "fill-rule", "visibility", "base", "lang", "rel", "rev", "typeof", "content", "datatype", "resource", "about", "property", "space", "data-name", "clip-path", "clip-rule", "mask", "opacity", "textLength", "lengthAdjust", "font-family", "font-size", "font-weight", "font-style", "text-anchor", "letter-spacing", "word-spacing"]
|
|
68
71
|
allowed_children: ["title", "path", "rect", "circle", "line", "ellipse", "polyline", "polygon", "solidColor", "textArea", "text", "g", "defs", "use", "a", "tspan", "desc", "image"]
|
|
69
72
|
- tag: "defs"
|
|
70
73
|
attributes: ["id", "role", "fill", "fill-rule", "base", "lang", "class", "rel", "rev", "typeof", "content", "datatype", "resource", "about", "property", "space", "clip-path", "mask"]
|
|
@@ -103,7 +106,7 @@ requirements:
|
|
|
103
106
|
attributes: ["id", "role", "fill", "transform", "fill-rule", "target", "base", "lang", "class", "rel", "rev", "typeof", "content", "datatype", "resource", "about", "property", "space", "title", "clip-path", "mask"]
|
|
104
107
|
allowed_children: ["title", "path", "rect", "circle", "line", "ellipse", "polyline", "polygon", "solidColor", "textArea", "text", "g", "defs", "use", "a", "tspan", "desc"]
|
|
105
108
|
- tag: "tspan"
|
|
106
|
-
attributes: ["x", "y", "id", "role", "fill", "fill-rule", "base", "lang", "class", "rel", "rev", "typeof", "content", "datatype", "resource", "about", "property", "space", "letter-spacing"]
|
|
109
|
+
attributes: ["x", "y", "id", "role", "fill", "fill-rule", "base", "lang", "class", "rel", "rev", "typeof", "content", "datatype", "resource", "about", "property", "space", "letter-spacing", "textLength", "lengthAdjust"]
|
|
107
110
|
allowed_children: ["desc", "title", "tspan", "text", "a", "tbreak"]
|
|
108
111
|
- tag: "tbreak"
|
|
109
112
|
attributes: ["id", "role", "base", "lang", "class", "rel", "rev", "typeof", "content", "datatype", "resource", "about", "property", "space"]
|
|
@@ -260,7 +260,9 @@ Sources are currently only rendered in metanorma-plateau</a:documentation>
|
|
|
260
260
|
<a:documentation>Type of numbering to be applied to the list items: one of the five named
|
|
261
261
|
numbering styles, or a renderer-native numbering format string passed
|
|
262
262
|
through for the target rendering language to expand (e.g. xml2rfc v2
|
|
263
|
-
format strings such as "R%d", carried through by metanorma-ietf)
|
|
263
|
+
format strings such as "R%d", carried through by metanorma-ietf).
|
|
264
|
+
The values `nobullet`, `no-bullet` and `none` do not number the list
|
|
265
|
+
items: they suppress the list markers in rendering.</a:documentation>
|
|
264
266
|
<choice>
|
|
265
267
|
<value>roman</value>
|
|
266
268
|
<value>alphabet</value>
|
|
@@ -925,6 +927,18 @@ titlecase, or lowercase</a:documentation>
|
|
|
925
927
|
</define>
|
|
926
928
|
<define name="UlAttributes" combine="interleave">
|
|
927
929
|
<ref name="BlockAttributes"/>
|
|
930
|
+
<optional>
|
|
931
|
+
<attribute name="type">
|
|
932
|
+
<a:documentation>Directive to suppress the list markers in rendering: the list is
|
|
933
|
+
rendered as a bulletless list. This attribute is not used for
|
|
934
|
+
numbering, unlike the corresponding attribute of `ol`.</a:documentation>
|
|
935
|
+
<choice>
|
|
936
|
+
<value>nobullet</value>
|
|
937
|
+
<value>no-bullet</value>
|
|
938
|
+
<value>none</value>
|
|
939
|
+
</choice>
|
|
940
|
+
</attribute>
|
|
941
|
+
</optional>
|
|
928
942
|
<optional>
|
|
929
943
|
<ref name="DisplayDirective"/>
|
|
930
944
|
</optional>
|
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: 3.5.
|
|
4
|
+
version: 3.5.22
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ribose Inc.
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-11-
|
|
11
|
+
date: 2026-11-13 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: addressable
|