metanorma-standoc 1.6.5 → 1.8.1
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/.github/workflows/rake.yml +17 -0
- data/lib/asciidoctor/standoc/base.rb +31 -44
- data/lib/asciidoctor/standoc/basicdoc.rng +20 -3
- data/lib/asciidoctor/standoc/blocks.rb +7 -7
- data/lib/asciidoctor/standoc/blocks_notes.rb +2 -2
- data/lib/asciidoctor/standoc/cleanup.rb +5 -6
- data/lib/asciidoctor/standoc/cleanup_block.rb +3 -11
- data/lib/asciidoctor/standoc/cleanup_boilerplate.rb +89 -20
- data/lib/asciidoctor/standoc/cleanup_inline.rb +23 -25
- data/lib/asciidoctor/standoc/cleanup_ref.rb +0 -85
- data/lib/asciidoctor/standoc/cleanup_ref_dl.rb +94 -0
- data/lib/asciidoctor/standoc/cleanup_terms.rb +1 -6
- data/lib/asciidoctor/standoc/converter.rb +2 -51
- data/lib/asciidoctor/standoc/front.rb +2 -2
- data/lib/asciidoctor/standoc/front_contributor.rb +8 -4
- data/lib/asciidoctor/standoc/inline.rb +8 -6
- data/lib/asciidoctor/standoc/isodoc.rng +36 -3
- data/lib/asciidoctor/standoc/lists.rb +2 -2
- data/lib/asciidoctor/standoc/macros.rb +14 -1
- data/lib/asciidoctor/standoc/macros_plantuml.rb +1 -1
- data/lib/asciidoctor/standoc/ref_sect.rb +2 -2
- data/lib/asciidoctor/standoc/reqt.rb +6 -1
- data/lib/asciidoctor/standoc/section.rb +14 -89
- data/lib/asciidoctor/standoc/table.rb +1 -1
- data/lib/asciidoctor/standoc/terms.rb +125 -0
- data/lib/asciidoctor/standoc/utils.rb +2 -94
- data/lib/metanorma/standoc/version.rb +1 -1
- data/metanorma-standoc.gemspec +2 -3
- data/spec/asciidoctor-standoc/base_spec.rb +44 -9
- data/spec/asciidoctor-standoc/blocks_spec.rb +6 -1
- data/spec/asciidoctor-standoc/cleanup_sections_spec.rb +12 -7
- data/spec/asciidoctor-standoc/cleanup_spec.rb +116 -4
- data/spec/asciidoctor-standoc/inline_spec.rb +4 -5
- data/spec/asciidoctor-standoc/isobib_cache_spec.rb +4 -4
- data/spec/asciidoctor-standoc/macros_lutaml_spec.rb +1 -1
- data/spec/asciidoctor-standoc/macros_spec.rb +30 -0
- data/spec/asciidoctor-standoc/refs_dl_spec.rb +17 -5
- data/spec/asciidoctor-standoc/refs_spec.rb +12 -12
- data/spec/asciidoctor-standoc/section_spec.rb +149 -4
- data/spec/asciidoctor-standoc/table_spec.rb +60 -0
- data/spec/vcr_cassettes/dated_iso_ref_joint_iso_iec.yml +48 -48
- data/spec/vcr_cassettes/isobib_get_123.yml +12 -12
- data/spec/vcr_cassettes/isobib_get_123_1.yml +26 -26
- data/spec/vcr_cassettes/isobib_get_123_1_fr.yml +36 -36
- data/spec/vcr_cassettes/isobib_get_123_2001.yml +14 -14
- data/spec/vcr_cassettes/isobib_get_124.yml +14 -14
- data/spec/vcr_cassettes/rfcbib_get_rfc8341.yml +8 -8
- data/spec/vcr_cassettes/separates_iev_citations_by_top_level_clause.yml +65 -59
- metadata +18 -31
- data/lib/asciidoctor/standoc/log.rb +0 -59
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: 1.
|
4
|
+
version: 1.8.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-01-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: asciidoctor
|
@@ -44,14 +44,14 @@ dependencies:
|
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 1.
|
47
|
+
version: 1.5.0
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: 1.
|
54
|
+
version: 1.5.0
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: iev
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -122,20 +122,6 @@ dependencies:
|
|
122
122
|
- - "~>"
|
123
123
|
- !ruby/object:Gem::Version
|
124
124
|
version: 1.1.0
|
125
|
-
- !ruby/object:Gem::Dependency
|
126
|
-
name: sterile
|
127
|
-
requirement: !ruby/object:Gem::Requirement
|
128
|
-
requirements:
|
129
|
-
- - "~>"
|
130
|
-
- !ruby/object:Gem::Version
|
131
|
-
version: 1.0.14
|
132
|
-
type: :runtime
|
133
|
-
prerelease: false
|
134
|
-
version_requirements: !ruby/object:Gem::Requirement
|
135
|
-
requirements:
|
136
|
-
- - "~>"
|
137
|
-
- !ruby/object:Gem::Version
|
138
|
-
version: 1.0.14
|
139
125
|
- !ruby/object:Gem::Dependency
|
140
126
|
name: concurrent-ruby
|
141
127
|
requirement: !ruby/object:Gem::Requirement
|
@@ -165,21 +151,21 @@ dependencies:
|
|
165
151
|
- !ruby/object:Gem::Version
|
166
152
|
version: 0.0.1
|
167
153
|
- !ruby/object:Gem::Dependency
|
168
|
-
name:
|
154
|
+
name: metanorma-utils
|
169
155
|
requirement: !ruby/object:Gem::Requirement
|
170
156
|
requirements:
|
171
|
-
- - "
|
157
|
+
- - "~>"
|
172
158
|
- !ruby/object:Gem::Version
|
173
|
-
version: '
|
159
|
+
version: '1'
|
174
160
|
type: :runtime
|
175
161
|
prerelease: false
|
176
162
|
version_requirements: !ruby/object:Gem::Requirement
|
177
163
|
requirements:
|
178
|
-
- - "
|
164
|
+
- - "~>"
|
179
165
|
- !ruby/object:Gem::Version
|
180
|
-
version: '
|
166
|
+
version: '1'
|
181
167
|
- !ruby/object:Gem::Dependency
|
182
|
-
name:
|
168
|
+
name: mimemagic
|
183
169
|
requirement: !ruby/object:Gem::Requirement
|
184
170
|
requirements:
|
185
171
|
- - ">="
|
@@ -193,7 +179,7 @@ dependencies:
|
|
193
179
|
- !ruby/object:Gem::Version
|
194
180
|
version: '0'
|
195
181
|
- !ruby/object:Gem::Dependency
|
196
|
-
name:
|
182
|
+
name: mathml2asciimath
|
197
183
|
requirement: !ruby/object:Gem::Requirement
|
198
184
|
requirements:
|
199
185
|
- - ">="
|
@@ -207,19 +193,19 @@ dependencies:
|
|
207
193
|
- !ruby/object:Gem::Version
|
208
194
|
version: '0'
|
209
195
|
- !ruby/object:Gem::Dependency
|
210
|
-
name:
|
196
|
+
name: latexmath
|
211
197
|
requirement: !ruby/object:Gem::Requirement
|
212
198
|
requirements:
|
213
|
-
- - "
|
199
|
+
- - ">="
|
214
200
|
- !ruby/object:Gem::Version
|
215
|
-
version:
|
201
|
+
version: '0'
|
216
202
|
type: :runtime
|
217
203
|
prerelease: false
|
218
204
|
version_requirements: !ruby/object:Gem::Requirement
|
219
205
|
requirements:
|
220
|
-
- - "
|
206
|
+
- - ">="
|
221
207
|
- !ruby/object:Gem::Version
|
222
|
-
version:
|
208
|
+
version: '0'
|
223
209
|
- !ruby/object:Gem::Dependency
|
224
210
|
name: byebug
|
225
211
|
requirement: !ruby/object:Gem::Requirement
|
@@ -427,6 +413,7 @@ files:
|
|
427
413
|
- lib/asciidoctor/standoc/cleanup_footnotes.rb
|
428
414
|
- lib/asciidoctor/standoc/cleanup_inline.rb
|
429
415
|
- lib/asciidoctor/standoc/cleanup_ref.rb
|
416
|
+
- lib/asciidoctor/standoc/cleanup_ref_dl.rb
|
430
417
|
- lib/asciidoctor/standoc/cleanup_section.rb
|
431
418
|
- lib/asciidoctor/standoc/cleanup_terms.rb
|
432
419
|
- lib/asciidoctor/standoc/converter.rb
|
@@ -438,7 +425,6 @@ files:
|
|
438
425
|
- lib/asciidoctor/standoc/inline.rb
|
439
426
|
- lib/asciidoctor/standoc/isodoc.rng
|
440
427
|
- lib/asciidoctor/standoc/lists.rb
|
441
|
-
- lib/asciidoctor/standoc/log.rb
|
442
428
|
- lib/asciidoctor/standoc/macros.rb
|
443
429
|
- lib/asciidoctor/standoc/macros_plantuml.rb
|
444
430
|
- lib/asciidoctor/standoc/macros_terms.rb
|
@@ -449,6 +435,7 @@ files:
|
|
449
435
|
- lib/asciidoctor/standoc/section.rb
|
450
436
|
- lib/asciidoctor/standoc/table.rb
|
451
437
|
- lib/asciidoctor/standoc/term_lookup_cleanup.rb
|
438
|
+
- lib/asciidoctor/standoc/terms.rb
|
452
439
|
- lib/asciidoctor/standoc/utils.rb
|
453
440
|
- lib/asciidoctor/standoc/validate.rb
|
454
441
|
- lib/asciidoctor/standoc/validate_section.rb
|
@@ -1,59 +0,0 @@
|
|
1
|
-
module Asciidoctor
|
2
|
-
module Standoc
|
3
|
-
class Log
|
4
|
-
def initialize
|
5
|
-
@log = {}
|
6
|
-
end
|
7
|
-
|
8
|
-
def add(category, loc, msg)
|
9
|
-
return if @novalid
|
10
|
-
@log[category] = [] unless @log[category]
|
11
|
-
@log[category] << { location: current_location(loc), message: msg,
|
12
|
-
context: context(loc) }
|
13
|
-
loc = loc.nil? ? "" : "(#{current_location(loc)}): "
|
14
|
-
warn "#{category}: #{loc}#{msg}"
|
15
|
-
end
|
16
|
-
|
17
|
-
def current_location(n)
|
18
|
-
return "" if n.nil?
|
19
|
-
return n if n.is_a? String
|
20
|
-
return "Asciidoctor Line #{"%06d" % n.lineno}" if n.respond_to?(:lineno) &&
|
21
|
-
!n.lineno.nil? && !n.lineno.empty?
|
22
|
-
return "XML Line #{"%06d" % n.line}" if n.respond_to?(:line) &&
|
23
|
-
!n.line.nil?
|
24
|
-
return "ID #{n.id}" if n.respond_to?(:id) && !n.id.nil?
|
25
|
-
while !n.nil? &&
|
26
|
-
(!n.respond_to?(:level) || n.level.positive?) &&
|
27
|
-
(!n.respond_to?(:context) || n.context != :section)
|
28
|
-
n = n.parent
|
29
|
-
return "Section: #{n.title}" if n&.respond_to?(:context) &&
|
30
|
-
n&.context == :section
|
31
|
-
end
|
32
|
-
"??"
|
33
|
-
end
|
34
|
-
|
35
|
-
def context(n)
|
36
|
-
return nil if n.is_a? String
|
37
|
-
n.respond_to?(:to_xml) and return n.to_xml
|
38
|
-
n.respond_to?(:to_s) and return n.to_s
|
39
|
-
nil
|
40
|
-
end
|
41
|
-
|
42
|
-
def write(file)
|
43
|
-
File.open(file, "w:UTF-8") do |f|
|
44
|
-
f.puts "#{file} errors"
|
45
|
-
@log.keys.each do |key|
|
46
|
-
f.puts "\n\n== #{key}\n\n"
|
47
|
-
@log[key].sort do |a, b|
|
48
|
-
a[:location] <=> b[:location]
|
49
|
-
end.each do |n|
|
50
|
-
loc = n[:location] ? "(#{n[:location]}): " : ""
|
51
|
-
f.puts "#{loc}#{n[:message]}"
|
52
|
-
n[:context]&.split(/\n/)&.first(5)&.each { |l| f.puts "\t#{l}" }
|
53
|
-
end
|
54
|
-
end
|
55
|
-
end
|
56
|
-
end
|
57
|
-
end
|
58
|
-
end
|
59
|
-
end
|