metanorma-standoc 1.7.3 → 1.8.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.
Files changed (62) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/rake.yml +11 -41
  3. data/.rubocop.yml +1 -1
  4. data/lib/asciidoctor/standoc/base.rb +34 -45
  5. data/lib/asciidoctor/standoc/basicdoc.rng +5 -3
  6. data/lib/asciidoctor/standoc/blocks.rb +20 -11
  7. data/lib/asciidoctor/standoc/blocks_notes.rb +2 -2
  8. data/lib/asciidoctor/standoc/cleanup.rb +29 -77
  9. data/lib/asciidoctor/standoc/cleanup_block.rb +39 -27
  10. data/lib/asciidoctor/standoc/cleanup_boilerplate.rb +56 -0
  11. data/lib/asciidoctor/standoc/cleanup_inline.rb +26 -29
  12. data/lib/asciidoctor/standoc/cleanup_maths.rb +123 -0
  13. data/lib/asciidoctor/standoc/cleanup_ref.rb +4 -98
  14. data/lib/asciidoctor/standoc/cleanup_ref_dl.rb +94 -0
  15. data/lib/asciidoctor/standoc/cleanup_section.rb +5 -0
  16. data/lib/asciidoctor/standoc/cleanup_terms.rb +2 -2
  17. data/lib/asciidoctor/standoc/converter.rb +0 -1
  18. data/lib/asciidoctor/standoc/front.rb +2 -2
  19. data/lib/asciidoctor/standoc/inline.rb +8 -16
  20. data/lib/asciidoctor/standoc/isodoc.rng +108 -2
  21. data/lib/asciidoctor/standoc/lists.rb +2 -2
  22. data/lib/asciidoctor/standoc/macros_plantuml.rb +1 -1
  23. data/lib/asciidoctor/standoc/ref_sect.rb +2 -2
  24. data/lib/asciidoctor/standoc/reqt.rb +6 -1
  25. data/lib/asciidoctor/standoc/section.rb +12 -80
  26. data/lib/asciidoctor/standoc/table.rb +1 -1
  27. data/lib/asciidoctor/standoc/terms.rb +125 -0
  28. data/lib/asciidoctor/standoc/utils.rb +2 -120
  29. data/lib/asciidoctor/standoc/validate.rb +16 -1
  30. data/lib/metanorma/standoc/version.rb +1 -1
  31. data/metanorma-standoc.gemspec +4 -4
  32. data/spec/{asciidoctor-standoc → asciidoctor}/base_spec.rb +30 -1
  33. data/spec/{asciidoctor-standoc → asciidoctor}/blocks_spec.rb +0 -0
  34. data/spec/{asciidoctor-standoc → asciidoctor}/cleanup_sections_spec.rb +0 -0
  35. data/spec/{asciidoctor-standoc → asciidoctor}/cleanup_spec.rb +408 -6
  36. data/spec/{asciidoctor-standoc → asciidoctor}/datamodel/attributes_table_preprocessor_spec.rb +0 -0
  37. data/spec/{asciidoctor-standoc → asciidoctor}/datamodel/diagram_preprocessor_spec.rb +0 -0
  38. data/spec/{asciidoctor-standoc → asciidoctor}/inline_spec.rb +2 -0
  39. data/spec/{asciidoctor-standoc → asciidoctor}/isobib_cache_spec.rb +4 -4
  40. data/spec/{asciidoctor-standoc → asciidoctor}/lists_spec.rb +0 -0
  41. data/spec/{asciidoctor-standoc → asciidoctor}/macros_json2text_spec.rb +0 -0
  42. data/spec/{asciidoctor-standoc → asciidoctor}/macros_lutaml_spec.rb +0 -0
  43. data/spec/{asciidoctor-standoc → asciidoctor}/macros_plantuml_spec.rb +0 -0
  44. data/spec/{asciidoctor-standoc → asciidoctor}/macros_spec.rb +0 -0
  45. data/spec/{asciidoctor-standoc → asciidoctor}/macros_yaml2text_spec.rb +0 -0
  46. data/spec/{asciidoctor-standoc → asciidoctor}/refs_dl_spec.rb +13 -1
  47. data/spec/{asciidoctor-standoc → asciidoctor}/refs_spec.rb +175 -153
  48. data/spec/{asciidoctor-standoc → asciidoctor}/section_spec.rb +22 -3
  49. data/spec/{asciidoctor-standoc → asciidoctor}/table_spec.rb +0 -0
  50. data/spec/{asciidoctor-standoc → asciidoctor}/validate_spec.rb +20 -0
  51. data/spec/fixtures/action_schemaexpg1.svg +122 -0
  52. data/spec/spec_helper.rb +8 -0
  53. data/spec/vcr_cassettes/dated_iso_ref_joint_iso_iec.yml +47 -47
  54. data/spec/vcr_cassettes/isobib_get_123.yml +14 -14
  55. data/spec/vcr_cassettes/isobib_get_123_1.yml +27 -27
  56. data/spec/vcr_cassettes/isobib_get_123_1_fr.yml +36 -36
  57. data/spec/vcr_cassettes/isobib_get_123_2001.yml +13 -13
  58. data/spec/vcr_cassettes/isobib_get_124.yml +13 -13
  59. data/spec/vcr_cassettes/rfcbib_get_rfc8341.yml +94 -30
  60. data/spec/vcr_cassettes/separates_iev_citations_by_top_level_clause.yml +45 -45
  61. metadata +49 -46
  62. 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.7.3
4
+ version: 1.8.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: 2021-01-11 00:00:00.000000000 Z
11
+ date: 2021-03-16 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.4.2
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.4.2
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,19 +151,19 @@ dependencies:
165
151
  - !ruby/object:Gem::Version
166
152
  version: 0.0.1
167
153
  - !ruby/object:Gem::Dependency
168
- name: mimemagic
154
+ name: metanorma-utils
169
155
  requirement: !ruby/object:Gem::Requirement
170
156
  requirements:
171
- - - ">="
157
+ - - "~>"
172
158
  - !ruby/object:Gem::Version
173
- version: '0'
159
+ version: 1.0.2
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: '0'
166
+ version: 1.0.2
181
167
  - !ruby/object:Gem::Dependency
182
168
  name: mathml2asciimath
183
169
  requirement: !ruby/object:Gem::Requirement
@@ -206,6 +192,20 @@ dependencies:
206
192
  - - ">="
207
193
  - !ruby/object:Gem::Version
208
194
  version: '0'
195
+ - !ruby/object:Gem::Dependency
196
+ name: asciimath2unitsml
197
+ requirement: !ruby/object:Gem::Requirement
198
+ requirements:
199
+ - - "~>"
200
+ - !ruby/object:Gem::Version
201
+ version: 0.2.0
202
+ type: :runtime
203
+ prerelease: false
204
+ version_requirements: !ruby/object:Gem::Requirement
205
+ requirements:
206
+ - - "~>"
207
+ - !ruby/object:Gem::Version
208
+ version: 0.2.0
209
209
  - !ruby/object:Gem::Dependency
210
210
  name: byebug
211
211
  requirement: !ruby/object:Gem::Requirement
@@ -282,14 +282,14 @@ dependencies:
282
282
  requirements:
283
283
  - - "~>"
284
284
  - !ruby/object:Gem::Version
285
- version: '12.0'
285
+ version: '13.0'
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: '12.0'
292
+ version: '13.0'
293
293
  - !ruby/object:Gem::Dependency
294
294
  name: rspec
295
295
  requirement: !ruby/object:Gem::Requirement
@@ -412,7 +412,9 @@ files:
412
412
  - lib/asciidoctor/standoc/cleanup_boilerplate.rb
413
413
  - lib/asciidoctor/standoc/cleanup_footnotes.rb
414
414
  - lib/asciidoctor/standoc/cleanup_inline.rb
415
+ - lib/asciidoctor/standoc/cleanup_maths.rb
415
416
  - lib/asciidoctor/standoc/cleanup_ref.rb
417
+ - lib/asciidoctor/standoc/cleanup_ref_dl.rb
416
418
  - lib/asciidoctor/standoc/cleanup_section.rb
417
419
  - lib/asciidoctor/standoc/cleanup_terms.rb
418
420
  - lib/asciidoctor/standoc/converter.rb
@@ -424,7 +426,6 @@ files:
424
426
  - lib/asciidoctor/standoc/inline.rb
425
427
  - lib/asciidoctor/standoc/isodoc.rng
426
428
  - lib/asciidoctor/standoc/lists.rb
427
- - lib/asciidoctor/standoc/log.rb
428
429
  - lib/asciidoctor/standoc/macros.rb
429
430
  - lib/asciidoctor/standoc/macros_plantuml.rb
430
431
  - lib/asciidoctor/standoc/macros_terms.rb
@@ -435,6 +436,7 @@ files:
435
436
  - lib/asciidoctor/standoc/section.rb
436
437
  - lib/asciidoctor/standoc/table.rb
437
438
  - lib/asciidoctor/standoc/term_lookup_cleanup.rb
439
+ - lib/asciidoctor/standoc/terms.rb
438
440
  - lib/asciidoctor/standoc/utils.rb
439
441
  - lib/asciidoctor/standoc/validate.rb
440
442
  - lib/asciidoctor/standoc/validate_section.rb
@@ -449,25 +451,25 @@ files:
449
451
  - lib/metanorma/standoc/processor.rb
450
452
  - lib/metanorma/standoc/version.rb
451
453
  - metanorma-standoc.gemspec
452
- - spec/asciidoctor-standoc/base_spec.rb
453
- - spec/asciidoctor-standoc/blocks_spec.rb
454
- - spec/asciidoctor-standoc/cleanup_sections_spec.rb
455
- - spec/asciidoctor-standoc/cleanup_spec.rb
456
- - spec/asciidoctor-standoc/datamodel/attributes_table_preprocessor_spec.rb
457
- - spec/asciidoctor-standoc/datamodel/diagram_preprocessor_spec.rb
458
- - spec/asciidoctor-standoc/inline_spec.rb
459
- - spec/asciidoctor-standoc/isobib_cache_spec.rb
460
- - spec/asciidoctor-standoc/lists_spec.rb
461
- - spec/asciidoctor-standoc/macros_json2text_spec.rb
462
- - spec/asciidoctor-standoc/macros_lutaml_spec.rb
463
- - spec/asciidoctor-standoc/macros_plantuml_spec.rb
464
- - spec/asciidoctor-standoc/macros_spec.rb
465
- - spec/asciidoctor-standoc/macros_yaml2text_spec.rb
466
- - spec/asciidoctor-standoc/refs_dl_spec.rb
467
- - spec/asciidoctor-standoc/refs_spec.rb
468
- - spec/asciidoctor-standoc/section_spec.rb
469
- - spec/asciidoctor-standoc/table_spec.rb
470
- - spec/asciidoctor-standoc/validate_spec.rb
454
+ - spec/asciidoctor/base_spec.rb
455
+ - spec/asciidoctor/blocks_spec.rb
456
+ - spec/asciidoctor/cleanup_sections_spec.rb
457
+ - spec/asciidoctor/cleanup_spec.rb
458
+ - spec/asciidoctor/datamodel/attributes_table_preprocessor_spec.rb
459
+ - spec/asciidoctor/datamodel/diagram_preprocessor_spec.rb
460
+ - spec/asciidoctor/inline_spec.rb
461
+ - spec/asciidoctor/isobib_cache_spec.rb
462
+ - spec/asciidoctor/lists_spec.rb
463
+ - spec/asciidoctor/macros_json2text_spec.rb
464
+ - spec/asciidoctor/macros_lutaml_spec.rb
465
+ - spec/asciidoctor/macros_plantuml_spec.rb
466
+ - spec/asciidoctor/macros_spec.rb
467
+ - spec/asciidoctor/macros_yaml2text_spec.rb
468
+ - spec/asciidoctor/refs_dl_spec.rb
469
+ - spec/asciidoctor/refs_spec.rb
470
+ - spec/asciidoctor/section_spec.rb
471
+ - spec/asciidoctor/table_spec.rb
472
+ - spec/asciidoctor/validate_spec.rb
471
473
  - spec/assets/boilerplate.xml
472
474
  - spec/assets/codes.yml
473
475
  - spec/assets/header.html
@@ -527,6 +529,7 @@ files:
527
529
  - spec/examples/rice_images/rice_image3_1.png
528
530
  - spec/examples/rice_images/rice_image3_2.png
529
531
  - spec/examples/rice_images/rice_image3_3.png
532
+ - spec/fixtures/action_schemaexpg1.svg
530
533
  - spec/fixtures/diagram_definitions.lutaml
531
534
  - spec/fixtures/macros_datamodel/address_class_profile.xml
532
535
  - spec/fixtures/macros_datamodel/address_component_profile.xml
@@ -564,7 +567,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
564
567
  - !ruby/object:Gem::Version
565
568
  version: '0'
566
569
  requirements: []
567
- rubygems_version: 3.0.3
570
+ rubygems_version: 3.1.4
568
571
  signing_key:
569
572
  specification_version: 4
570
573
  summary: metanorma-standoc realises standards following the Metanorma standoc model
@@ -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