metanorma-standoc 1.8.8 → 1.9.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (69) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/rake.yml +3 -13
  3. data/.hound.yml +3 -1
  4. data/.rubocop.yml +3 -7
  5. data/Gemfile.devel +0 -0
  6. data/lib/asciidoctor/standoc/base.rb +42 -36
  7. data/lib/asciidoctor/standoc/biblio.rng +1 -0
  8. data/lib/asciidoctor/standoc/blocks.rb +25 -9
  9. data/lib/asciidoctor/standoc/blocks_notes.rb +41 -24
  10. data/lib/asciidoctor/standoc/cleanup.rb +59 -84
  11. data/lib/asciidoctor/standoc/cleanup_block.rb +63 -85
  12. data/lib/asciidoctor/standoc/cleanup_boilerplate.rb +51 -29
  13. data/lib/asciidoctor/standoc/cleanup_footnotes.rb +1 -0
  14. data/lib/asciidoctor/standoc/cleanup_image.rb +71 -0
  15. data/lib/asciidoctor/standoc/cleanup_maths.rb +36 -27
  16. data/lib/asciidoctor/standoc/cleanup_ref.rb +24 -15
  17. data/lib/asciidoctor/standoc/cleanup_ref_dl.rb +1 -1
  18. data/lib/asciidoctor/standoc/cleanup_reqt.rb +47 -0
  19. data/lib/asciidoctor/standoc/cleanup_section.rb +77 -134
  20. data/lib/asciidoctor/standoc/cleanup_section_names.rb +75 -0
  21. data/lib/asciidoctor/standoc/converter.rb +10 -3
  22. data/lib/asciidoctor/standoc/datamodel/plantuml_renderer.rb +67 -66
  23. data/lib/asciidoctor/standoc/front.rb +35 -18
  24. data/lib/asciidoctor/standoc/front_contributor.rb +70 -45
  25. data/lib/asciidoctor/standoc/inline.rb +30 -22
  26. data/lib/asciidoctor/standoc/isodoc.rng +321 -4
  27. data/lib/asciidoctor/standoc/lists.rb +4 -2
  28. data/lib/asciidoctor/standoc/macros.rb +50 -23
  29. data/lib/asciidoctor/standoc/macros_form.rb +63 -0
  30. data/lib/asciidoctor/standoc/ref.rb +87 -112
  31. data/lib/asciidoctor/standoc/ref_date_id.rb +62 -0
  32. data/lib/asciidoctor/standoc/ref_sect.rb +20 -17
  33. data/lib/asciidoctor/standoc/section.rb +3 -1
  34. data/lib/asciidoctor/standoc/term_lookup_cleanup.rb +31 -16
  35. data/lib/asciidoctor/standoc/terms.rb +27 -16
  36. data/lib/asciidoctor/standoc/utils.rb +35 -9
  37. data/lib/asciidoctor/standoc/validate.rb +30 -28
  38. data/lib/metanorma-standoc.rb +0 -1
  39. data/lib/metanorma/standoc/version.rb +5 -5
  40. data/metanorma-standoc.gemspec +11 -11
  41. data/spec/asciidoctor/base_spec.rb +715 -509
  42. data/spec/asciidoctor/blocks_spec.rb +830 -727
  43. data/spec/asciidoctor/cleanup_sections_spec.rb +51 -14
  44. data/spec/asciidoctor/cleanup_spec.rb +1836 -1673
  45. data/spec/asciidoctor/inline_spec.rb +330 -283
  46. data/spec/asciidoctor/isobib_cache_spec.rb +406 -358
  47. data/spec/asciidoctor/lists_spec.rb +3 -3
  48. data/spec/asciidoctor/macros_plantuml_spec.rb +8 -8
  49. data/spec/asciidoctor/macros_spec.rb +546 -444
  50. data/spec/asciidoctor/macros_yaml2text_spec.rb +1 -1
  51. data/spec/asciidoctor/refs_dl_spec.rb +4 -4
  52. data/spec/asciidoctor/refs_spec.rb +1528 -1533
  53. data/spec/asciidoctor/section_spec.rb +778 -689
  54. data/spec/asciidoctor/table_spec.rb +6 -6
  55. data/spec/asciidoctor/validate_spec.rb +296 -304
  56. data/spec/spec_helper.rb +13 -9
  57. data/spec/vcr_cassettes/dated_iso_ref_joint_iso_iec.yml +66 -66
  58. data/spec/vcr_cassettes/isobib_get_123.yml +17 -17
  59. data/spec/vcr_cassettes/isobib_get_123_1.yml +31 -31
  60. data/spec/vcr_cassettes/isobib_get_123_1_fr.yml +40 -40
  61. data/spec/vcr_cassettes/isobib_get_123_2001.yml +17 -17
  62. data/spec/vcr_cassettes/isobib_get_124.yml +16 -16
  63. data/spec/vcr_cassettes/rfcbib_get_rfc8341.yml +14 -14
  64. data/spec/vcr_cassettes/separates_iev_citations_by_top_level_clause.yml +78 -66
  65. metadata +69 -67
  66. data/lib/liquid/custom_blocks/key_iterator.rb +0 -21
  67. data/lib/liquid/custom_blocks/with_json_nested_context.rb +0 -18
  68. data/lib/liquid/custom_blocks/with_yaml_nested_context.rb +0 -19
  69. data/lib/liquid/custom_filters/values.rb +0 -7
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.8.8
4
+ version: 1.9.4
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-03-29 00:00:00.000000000 Z
11
+ date: 2021-06-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: asciidoctor
@@ -25,49 +25,49 @@ dependencies:
25
25
  - !ruby/object:Gem::Version
26
26
  version: 2.0.0
27
27
  - !ruby/object:Gem::Dependency
28
- name: ruby-jing
28
+ name: iev
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ">="
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '0'
33
+ version: 0.2.1
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ">="
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '0'
40
+ version: 0.2.1
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: isodoc
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: 1.5.0
47
+ version: 1.6.2
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.5.0
54
+ version: 1.6.2
55
55
  - !ruby/object:Gem::Dependency
56
- name: iev
56
+ name: metanorma-plugin-datastruct
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - "~>"
59
+ - - ">="
60
60
  - !ruby/object:Gem::Version
61
- version: 0.2.1
61
+ version: '0'
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - "~>"
66
+ - - ">="
67
67
  - !ruby/object:Gem::Version
68
- version: 0.2.1
68
+ version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
- name: metanorma-plugin-datastruct
70
+ name: metanorma-plugin-lutaml
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - ">="
@@ -81,49 +81,49 @@ dependencies:
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
83
  - !ruby/object:Gem::Dependency
84
- name: metanorma-plugin-lutaml
84
+ name: ruby-jing
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - "~>"
87
+ - - ">="
88
88
  - !ruby/object:Gem::Version
89
- version: 0.3.0
89
+ version: '0'
90
90
  type: :runtime
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - "~>"
94
+ - - ">="
95
95
  - !ruby/object:Gem::Version
96
- version: 0.3.0
96
+ version: '0'
97
97
  - !ruby/object:Gem::Dependency
98
- name: relaton-cli
98
+ name: asciimath2unitsml
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
101
  - - "~>"
102
102
  - !ruby/object:Gem::Version
103
- version: 1.7.0
103
+ version: 0.3.0
104
104
  type: :runtime
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
108
  - - "~>"
109
109
  - !ruby/object:Gem::Version
110
- version: 1.7.0
110
+ version: 0.3.0
111
111
  - !ruby/object:Gem::Dependency
112
- name: relaton-iev
112
+ name: concurrent-ruby
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
- - - "~>"
115
+ - - ">="
116
116
  - !ruby/object:Gem::Version
117
- version: 1.1.0
117
+ version: '0'
118
118
  type: :runtime
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
- - - "~>"
122
+ - - ">="
123
123
  - !ruby/object:Gem::Version
124
- version: 1.1.0
124
+ version: '0'
125
125
  - !ruby/object:Gem::Dependency
126
- name: concurrent-ruby
126
+ name: latexmath
127
127
  requirement: !ruby/object:Gem::Requirement
128
128
  requirements:
129
129
  - - ">="
@@ -137,75 +137,75 @@ dependencies:
137
137
  - !ruby/object:Gem::Version
138
138
  version: '0'
139
139
  - !ruby/object:Gem::Dependency
140
- name: unicode2latex
140
+ name: mathml2asciimath
141
141
  requirement: !ruby/object:Gem::Requirement
142
142
  requirements:
143
- - - "~>"
143
+ - - ">="
144
144
  - !ruby/object:Gem::Version
145
- version: 0.0.1
145
+ version: '0'
146
146
  type: :runtime
147
147
  prerelease: false
148
148
  version_requirements: !ruby/object:Gem::Requirement
149
149
  requirements:
150
- - - "~>"
150
+ - - ">="
151
151
  - !ruby/object:Gem::Version
152
- version: 0.0.1
152
+ version: '0'
153
153
  - !ruby/object:Gem::Dependency
154
154
  name: metanorma-utils
155
155
  requirement: !ruby/object:Gem::Requirement
156
156
  requirements:
157
157
  - - "~>"
158
158
  - !ruby/object:Gem::Version
159
- version: 1.1.0
159
+ version: 1.2.0
160
160
  type: :runtime
161
161
  prerelease: false
162
162
  version_requirements: !ruby/object:Gem::Requirement
163
163
  requirements:
164
164
  - - "~>"
165
165
  - !ruby/object:Gem::Version
166
- version: 1.1.0
166
+ version: 1.2.0
167
167
  - !ruby/object:Gem::Dependency
168
- name: mathml2asciimath
168
+ name: relaton-cli
169
169
  requirement: !ruby/object:Gem::Requirement
170
170
  requirements:
171
- - - ">="
171
+ - - "~>"
172
172
  - !ruby/object:Gem::Version
173
- version: '0'
173
+ version: 1.8.0
174
174
  type: :runtime
175
175
  prerelease: false
176
176
  version_requirements: !ruby/object:Gem::Requirement
177
177
  requirements:
178
- - - ">="
178
+ - - "~>"
179
179
  - !ruby/object:Gem::Version
180
- version: '0'
180
+ version: 1.8.0
181
181
  - !ruby/object:Gem::Dependency
182
- name: latexmath
182
+ name: relaton-iev
183
183
  requirement: !ruby/object:Gem::Requirement
184
184
  requirements:
185
- - - ">="
185
+ - - "~>"
186
186
  - !ruby/object:Gem::Version
187
- version: '0'
187
+ version: 1.1.0
188
188
  type: :runtime
189
189
  prerelease: false
190
190
  version_requirements: !ruby/object:Gem::Requirement
191
191
  requirements:
192
- - - ">="
192
+ - - "~>"
193
193
  - !ruby/object:Gem::Version
194
- version: '0'
194
+ version: 1.1.0
195
195
  - !ruby/object:Gem::Dependency
196
- name: asciimath2unitsml
196
+ name: unicode2latex
197
197
  requirement: !ruby/object:Gem::Requirement
198
198
  requirements:
199
199
  - - "~>"
200
200
  - !ruby/object:Gem::Version
201
- version: 0.3.0
201
+ version: 0.0.1
202
202
  type: :runtime
203
203
  prerelease: false
204
204
  version_requirements: !ruby/object:Gem::Requirement
205
205
  requirements:
206
206
  - - "~>"
207
207
  - !ruby/object:Gem::Version
208
- version: 0.3.0
208
+ version: 0.0.1
209
209
  - !ruby/object:Gem::Dependency
210
210
  name: byebug
211
211
  requirement: !ruby/object:Gem::Requirement
@@ -220,20 +220,6 @@ dependencies:
220
220
  - - ">="
221
221
  - !ruby/object:Gem::Version
222
222
  version: '0'
223
- - !ruby/object:Gem::Dependency
224
- name: sassc
225
- requirement: !ruby/object:Gem::Requirement
226
- requirements:
227
- - - '='
228
- - !ruby/object:Gem::Version
229
- version: 2.4.0
230
- type: :development
231
- prerelease: false
232
- version_requirements: !ruby/object:Gem::Requirement
233
- requirements:
234
- - - '='
235
- - !ruby/object:Gem::Version
236
- version: 2.4.0
237
223
  - !ruby/object:Gem::Dependency
238
224
  name: equivalent-xml
239
225
  requirement: !ruby/object:Gem::Requirement
@@ -318,6 +304,20 @@ dependencies:
318
304
  - - "~>"
319
305
  - !ruby/object:Gem::Version
320
306
  version: 1.5.2
307
+ - !ruby/object:Gem::Dependency
308
+ name: sassc
309
+ requirement: !ruby/object:Gem::Requirement
310
+ requirements:
311
+ - - '='
312
+ - !ruby/object:Gem::Version
313
+ version: 2.4.0
314
+ type: :development
315
+ prerelease: false
316
+ version_requirements: !ruby/object:Gem::Requirement
317
+ requirements:
318
+ - - '='
319
+ - !ruby/object:Gem::Version
320
+ version: 2.4.0
321
321
  - !ruby/object:Gem::Dependency
322
322
  name: simplecov
323
323
  requirement: !ruby/object:Gem::Requirement
@@ -393,6 +393,7 @@ files:
393
393
  - ".tex"
394
394
  - CODE_OF_CONDUCT.md
395
395
  - Gemfile
396
+ - Gemfile.devel
396
397
  - LICENSE
397
398
  - Makefile
398
399
  - README.adoc
@@ -409,11 +410,14 @@ files:
409
410
  - lib/asciidoctor/standoc/cleanup_block.rb
410
411
  - lib/asciidoctor/standoc/cleanup_boilerplate.rb
411
412
  - lib/asciidoctor/standoc/cleanup_footnotes.rb
413
+ - lib/asciidoctor/standoc/cleanup_image.rb
412
414
  - lib/asciidoctor/standoc/cleanup_inline.rb
413
415
  - lib/asciidoctor/standoc/cleanup_maths.rb
414
416
  - lib/asciidoctor/standoc/cleanup_ref.rb
415
417
  - lib/asciidoctor/standoc/cleanup_ref_dl.rb
418
+ - lib/asciidoctor/standoc/cleanup_reqt.rb
416
419
  - lib/asciidoctor/standoc/cleanup_section.rb
420
+ - lib/asciidoctor/standoc/cleanup_section_names.rb
417
421
  - lib/asciidoctor/standoc/cleanup_terms.rb
418
422
  - lib/asciidoctor/standoc/converter.rb
419
423
  - lib/asciidoctor/standoc/datamodel/attributes_table_preprocessor.rb
@@ -425,9 +429,11 @@ files:
425
429
  - lib/asciidoctor/standoc/isodoc.rng
426
430
  - lib/asciidoctor/standoc/lists.rb
427
431
  - lib/asciidoctor/standoc/macros.rb
432
+ - lib/asciidoctor/standoc/macros_form.rb
428
433
  - lib/asciidoctor/standoc/macros_plantuml.rb
429
434
  - lib/asciidoctor/standoc/macros_terms.rb
430
435
  - lib/asciidoctor/standoc/ref.rb
436
+ - lib/asciidoctor/standoc/ref_date_id.rb
431
437
  - lib/asciidoctor/standoc/ref_sect.rb
432
438
  - lib/asciidoctor/standoc/reqt.rb
433
439
  - lib/asciidoctor/standoc/reqt.rng
@@ -440,10 +446,6 @@ files:
440
446
  - lib/asciidoctor/standoc/validate_section.rb
441
447
  - lib/asciidoctor/standoc/views/datamodel/model_representation.adoc.erb
442
448
  - lib/asciidoctor/standoc/views/datamodel/plantuml_representation.adoc.erb
443
- - lib/liquid/custom_blocks/key_iterator.rb
444
- - lib/liquid/custom_blocks/with_json_nested_context.rb
445
- - lib/liquid/custom_blocks/with_yaml_nested_context.rb
446
- - lib/liquid/custom_filters/values.rb
447
449
  - lib/metanorma-standoc.rb
448
450
  - lib/metanorma/standoc.rb
449
451
  - lib/metanorma/standoc/processor.rb
@@ -1,21 +0,0 @@
1
- module Liquid
2
- module CustomBlocks
3
- class KeyIterator < Block
4
- def initialize(tag_name, markup, tokens)
5
- super
6
- @context_name, @var_name = markup.split(',').map(&:strip)
7
- end
8
-
9
- def render(context)
10
- res = ''
11
- iterator = context[@context_name].is_a?(Hash) ? context[@context_name].keys : context[@context_name]
12
- iterator.each.with_index do |key, index|
13
- context['index'] = index
14
- context[@var_name] = key
15
- res += super
16
- end
17
- res
18
- end
19
- end
20
- end
21
- end
@@ -1,18 +0,0 @@
1
- module Liquid
2
- module CustomBlocks
3
- class WithJsonNestedContext < Block
4
- def initialize(tag_name, markup, tokens)
5
- super
6
- @context_file_variable, @context_name = markup.split(",").map(&:strip)
7
- end
8
-
9
- def render(context)
10
- context_file = context[@context_file_variable].to_s.strip
11
- context[@context_name] = JSON.parse(
12
- File.read(context_file, encoding: "utf-8")
13
- )
14
- super
15
- end
16
- end
17
- end
18
- end
@@ -1,19 +0,0 @@
1
- module Liquid
2
- module CustomBlocks
3
- class WithYamlNestedContext < Block
4
- def initialize(tag_name, markup, tokens)
5
- super
6
- @context_file_variable, @context_name = markup.split(",").map(&:strip)
7
- end
8
-
9
- def render(context)
10
- context_file = context[@context_file_variable].to_s.strip
11
- context[@context_name] = YAML.safe_load(
12
- File.read(context_file, encoding: "utf-8"),
13
- [Date, Time]
14
- )
15
- super
16
- end
17
- end
18
- end
19
- end
@@ -1,7 +0,0 @@
1
- module Liquid
2
- module CustomFilters
3
- def values(list)
4
- list.values
5
- end
6
- end
7
- end