metanorma-utils 2.0.4 → 2.0.5
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/anchor.rb +2 -0
- data/lib/utils/main.rb +11 -4
- data/lib/utils/version.rb +1 -1
- data/metanorma-utils.gemspec +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a8cac634f15681d53c158ec3fb5c020e7e26326b20e43fb076837e50bb7963f0
|
|
4
|
+
data.tar.gz: 55755da66e1c7194b869db222261dada9094be7b83b9985d61e260a860fee112
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 283c7c24d7ba002a8d48999b66387cd15fff96581273622d70af9d9727c33bc5368d29f29e5848eac60307bf3fbb20630ccab6fecf58484966404722dd77e359
|
|
7
|
+
data.tar.gz: 865da9bf2f1c1aa4c06f36669c3bedff53f10c79b63e7257f8f2d6c3396d89c5326fba0d1e2c2ebd1d1eb86fdcfdc6fde5a35d99411306e32832cb5bea7d4fe3
|
data/lib/utils/anchor.rb
CHANGED
|
@@ -119,10 +119,12 @@ module Metanorma
|
|
|
119
119
|
def anchor_attributes(presxml: false)
|
|
120
120
|
ret = [%w(annotation from), %w(annotation to), %w(callout target),
|
|
121
121
|
%w(xref to), %w(eref bibitemid), %w(citation bibitemid),
|
|
122
|
+
%w(origin bibitemid),
|
|
122
123
|
%w(xref target), %w(label for), %w(location target),
|
|
123
124
|
%w(index to), %w(termsource bibitemid), %w(admonition target)]
|
|
124
125
|
ret1 = [%w(fn target), %w(semx source), %w(fmt-title source),
|
|
125
126
|
%w(fmt-xref to), %w(fmt-xref target), %w(fmt-eref bibitemid),
|
|
127
|
+
%w(fmt-origin bibitemid),
|
|
126
128
|
%w(fmt-xref-label container), %w(fmt-fn-body target),
|
|
127
129
|
%w(fmt-annotation-body from), %w(fmt-annotation-body to),
|
|
128
130
|
%w(fmt-annotation-start source), %w(fmt-annotation-start end),
|
data/lib/utils/main.rb
CHANGED
|
@@ -83,20 +83,27 @@ module Metanorma
|
|
|
83
83
|
hash
|
|
84
84
|
end
|
|
85
85
|
|
|
86
|
+
def trim_split(str)
|
|
87
|
+
m = /^(\s*)(?=\S)(.+)(?<=\S)(\s*)$/.match(str)
|
|
88
|
+
[m[1], m[2], m[3]]
|
|
89
|
+
end
|
|
90
|
+
|
|
86
91
|
def strict_capitalize_phrase(str)
|
|
87
|
-
|
|
92
|
+
a, body, b = trim_split(str)
|
|
93
|
+
a + body.split(/ /).map do |w|
|
|
88
94
|
letters = w.chars
|
|
89
95
|
letters.first.upcase!
|
|
90
96
|
letters.join
|
|
91
|
-
end.join(" ")
|
|
97
|
+
end.join(" ") + b
|
|
92
98
|
end
|
|
93
99
|
|
|
94
100
|
def strict_capitalize_first(str)
|
|
95
|
-
|
|
101
|
+
a, body, b = trim_split(str)
|
|
102
|
+
a + body.split(/ /).each_with_index.map do |w, i|
|
|
96
103
|
letters = w.chars
|
|
97
104
|
letters.first.upcase! if i.zero?
|
|
98
105
|
letters.join
|
|
99
|
-
end.join(" ")
|
|
106
|
+
end.join(" ") + b
|
|
100
107
|
end
|
|
101
108
|
|
|
102
109
|
def external_path(path)
|
data/lib/utils/version.rb
CHANGED
data/metanorma-utils.gemspec
CHANGED
|
@@ -46,6 +46,6 @@ Gem::Specification.new do |spec|
|
|
|
46
46
|
spec.add_development_dependency "simplecov", "~> 0.15"
|
|
47
47
|
spec.add_development_dependency "timecop", "~> 0.9"
|
|
48
48
|
spec.add_development_dependency "webmock"
|
|
49
|
-
spec.add_development_dependency "canon", "= 0.
|
|
49
|
+
spec.add_development_dependency "canon", "= 0.2.3"
|
|
50
50
|
# spec.metadata["rubygems_mfa_required"] = "true"
|
|
51
51
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: metanorma-utils
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.0.
|
|
4
|
+
version: 2.0.5
|
|
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-04-
|
|
11
|
+
date: 2026-04-27 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: asciidoctor
|
|
@@ -282,14 +282,14 @@ dependencies:
|
|
|
282
282
|
requirements:
|
|
283
283
|
- - '='
|
|
284
284
|
- !ruby/object:Gem::Version
|
|
285
|
-
version: 0.
|
|
285
|
+
version: 0.2.3
|
|
286
286
|
type: :development
|
|
287
287
|
prerelease: false
|
|
288
288
|
version_requirements: !ruby/object:Gem::Requirement
|
|
289
289
|
requirements:
|
|
290
290
|
- - '='
|
|
291
291
|
- !ruby/object:Gem::Version
|
|
292
|
-
version: 0.
|
|
292
|
+
version: 0.2.3
|
|
293
293
|
description: 'metanorma-utils provides utilities for the Metanorma stack
|
|
294
294
|
|
|
295
295
|
'
|