coradoc 2.0.4 → 2.0.6
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/.rubocop_todo.yml +96 -51
- data/coradoc-adoc/lib/coradoc/asciidoc/model/break.rb +7 -0
- data/coradoc-adoc/lib/coradoc/asciidoc/model/document.rb +2 -2
- data/coradoc-adoc/lib/coradoc/asciidoc/model/include.rb +2 -2
- data/coradoc-adoc/lib/coradoc/asciidoc/model.rb +6 -4
- data/coradoc-adoc/lib/coradoc/asciidoc/parser/base.rb +1 -0
- data/coradoc-adoc/lib/coradoc/asciidoc/parser/block.rb +8 -7
- data/coradoc-adoc/lib/coradoc/asciidoc/parser/content.rb +13 -3
- data/coradoc-adoc/lib/coradoc/asciidoc/parser/inline.rb +15 -15
- data/coradoc-adoc/lib/coradoc/asciidoc/parser/list.rb +2 -2
- data/coradoc-adoc/lib/coradoc/asciidoc/parser/section.rb +1 -0
- data/coradoc-adoc/lib/coradoc/asciidoc/serializer/serializers/document.rb +4 -1
- data/coradoc-adoc/lib/coradoc/asciidoc/transform/from_core_model.rb +84 -13
- data/coradoc-adoc/lib/coradoc/asciidoc/transform/to_core_model.rb +106 -27
- data/coradoc-adoc/lib/coradoc/asciidoc/transform/to_core_model_registrations.rb +50 -19
- data/coradoc-adoc/lib/coradoc/asciidoc/transformer/misc_rules.rb +5 -0
- data/coradoc-adoc/lib/coradoc/asciidoc/transformer/structural_rules.rb +9 -8
- data/coradoc-adoc/lib/coradoc/asciidoc/transformer.rb +22 -5
- data/coradoc-adoc/lib/coradoc/asciidoc.rb +7 -2
- data/coradoc-adoc/spec/coradoc/asciidoc/integration_pipeline_spec.rb +342 -0
- data/coradoc-adoc/spec/coradoc/asciidoc/list_continuation_spec.rb +1 -1
- data/coradoc-adoc/spec/coradoc/asciidoc/round_trip_spec.rb +0 -2
- data/coradoc-adoc/spec/coradoc/asciidoc/transform/from_core_model_spec.rb +3 -2
- data/coradoc-adoc/spec/coradoc/developer_experience_spec.rb +0 -2
- data/coradoc-adoc/spec/transform/from_core_model_spec.rb +3 -3
- data/coradoc-adoc/spec/transform/to_core_model_spec.rb +1 -0
- data/coradoc-html/lib/coradoc/html/converters/base.rb +41 -17
- data/coradoc-html/lib/coradoc/html/converters/example.rb +1 -2
- data/coradoc-html/lib/coradoc/html/converters/listing.rb +1 -2
- data/coradoc-html/lib/coradoc/html/converters/literal.rb +1 -2
- data/coradoc-html/lib/coradoc/html/converters/open.rb +1 -2
- data/coradoc-html/lib/coradoc/html/converters/quote.rb +2 -3
- data/coradoc-html/lib/coradoc/html/converters/sidebar.rb +1 -2
- data/coradoc-html/lib/coradoc/html/converters/source.rb +1 -2
- data/coradoc-html/lib/coradoc/html/converters/source_code.rb +1 -2
- data/coradoc-html/lib/coradoc/html/converters/term.rb +1 -2
- data/coradoc-html/lib/coradoc/html/converters/verse.rb +2 -3
- data/coradoc-html/lib/coradoc/html/input/converters/aside.rb +1 -1
- data/coradoc-html/lib/coradoc/html/input/converters/audio.rb +1 -1
- data/coradoc-html/lib/coradoc/html/input/converters/blockquote.rb +2 -3
- data/coradoc-html/lib/coradoc/html/input/converters/div.rb +1 -2
- data/coradoc-html/lib/coradoc/html/input/converters/figure.rb +2 -3
- data/coradoc-html/lib/coradoc/html/input/converters/hr.rb +1 -1
- data/coradoc-html/lib/coradoc/html/input/converters/p.rb +2 -1
- data/coradoc-html/lib/coradoc/html/input/converters/pre.rb +14 -10
- data/coradoc-html/lib/coradoc/html/input/converters/video.rb +1 -1
- data/coradoc-html/lib/coradoc/html/renderer.rb +50 -2
- data/coradoc-html/lib/coradoc/html/spa.rb +2 -2
- data/coradoc-html/lib/coradoc/html/static.rb +2 -2
- data/coradoc-html/lib/coradoc/html/templates/core_model/definition_list.liquid +11 -0
- data/coradoc-html/lib/coradoc/html/theme/modern/javascript_generator.rb +2 -2
- data/coradoc-html/lib/coradoc/html/theme/modern/serializers/document_serializer.rb +7 -11
- data/coradoc-html/lib/coradoc/html/theme/modern_renderer.rb +6 -7
- data/coradoc-html/lib/coradoc/html.rb +5 -15
- data/coradoc-html/spec/input/converters/converters_spec.rb +6 -8
- data/coradoc-markdown/lib/coradoc/markdown/model/attribute_list.rb +0 -3
- data/coradoc-markdown/lib/coradoc/markdown/model/definition_list.rb +0 -3
- data/coradoc-markdown/lib/coradoc/markdown/model/extension.rb +0 -2
- data/coradoc-markdown/lib/coradoc/markdown/model/highlight.rb +0 -1
- data/coradoc-markdown/lib/coradoc/markdown/model/math.rb +0 -1
- data/coradoc-markdown/lib/coradoc/markdown/model/strikethrough.rb +0 -1
- data/coradoc-markdown/lib/coradoc/markdown/parser/ast_processor.rb +2 -2
- data/coradoc-markdown/lib/coradoc/markdown/parser/block_parser.rb +2 -2
- data/coradoc-markdown/lib/coradoc/markdown/parser/inline_parser.rb +3 -3
- data/coradoc-markdown/lib/coradoc/markdown/parser.rb +9 -3
- data/coradoc-markdown/lib/coradoc/markdown/toc_generator.rb +6 -4
- data/coradoc-markdown/lib/coradoc/markdown/transform/from_core_model.rb +27 -6
- data/coradoc-markdown/lib/coradoc/markdown/transform/to_core_model.rb +5 -9
- data/coradoc-markdown/lib/coradoc/markdown/transformer.rb +2 -1
- data/coradoc-markdown/spec/transform/to_core_model_spec.rb +6 -8
- data/exe/coradoc +1 -0
- data/lib/coradoc/coradoc.rb +6 -7
- data/lib/coradoc/core_model/annotation_block.rb +0 -2
- data/lib/coradoc/core_model/block.rb +92 -32
- data/lib/coradoc/core_model/builder/block_builder.rb +20 -2
- data/lib/coradoc/core_model/builder/detection.rb +0 -8
- data/lib/coradoc/core_model/builder.rb +6 -7
- data/lib/coradoc/core_model/example_block.rb +12 -0
- data/lib/coradoc/core_model/listing_block.rb +15 -0
- data/lib/coradoc/core_model/literal_block.rb +12 -0
- data/lib/coradoc/core_model/open_block.rb +12 -0
- data/lib/coradoc/core_model/pass_block.rb +12 -0
- data/lib/coradoc/core_model/quote_block.rb +14 -0
- data/lib/coradoc/core_model/reviewer_block.rb +12 -0
- data/lib/coradoc/core_model/sidebar_block.rb +12 -0
- data/lib/coradoc/core_model/source_block.rb +22 -0
- data/lib/coradoc/core_model/structural_element.rb +4 -0
- data/lib/coradoc/core_model/verse_block.rb +14 -0
- data/lib/coradoc/core_model.rb +10 -0
- data/lib/coradoc/document_manipulator.rb +3 -1
- data/lib/coradoc/processor_registry.rb +0 -2
- data/lib/coradoc/version.rb +1 -1
- metadata +13 -34
- data/coradoc-markdown/coverage/.last_run.json +0 -5
- data/coradoc-markdown/coverage/.resultset.json +0 -6322
- data/coradoc-markdown/coverage/.resultset.json.lock +0 -0
- data/coradoc-markdown/coverage/assets/0.13.2/DataTables-1.10.20/images/sort_asc.png +0 -0
- data/coradoc-markdown/coverage/assets/0.13.2/DataTables-1.10.20/images/sort_asc_disabled.png +0 -0
- data/coradoc-markdown/coverage/assets/0.13.2/DataTables-1.10.20/images/sort_both.png +0 -0
- data/coradoc-markdown/coverage/assets/0.13.2/DataTables-1.10.20/images/sort_desc.png +0 -0
- data/coradoc-markdown/coverage/assets/0.13.2/DataTables-1.10.20/images/sort_desc_disabled.png +0 -0
- data/coradoc-markdown/coverage/assets/0.13.2/application.css +0 -1
- data/coradoc-markdown/coverage/assets/0.13.2/application.js +0 -7
- data/coradoc-markdown/coverage/assets/0.13.2/colorbox/border.png +0 -0
- data/coradoc-markdown/coverage/assets/0.13.2/colorbox/controls.png +0 -0
- data/coradoc-markdown/coverage/assets/0.13.2/colorbox/loading.gif +0 -0
- data/coradoc-markdown/coverage/assets/0.13.2/colorbox/loading_background.png +0 -0
- data/coradoc-markdown/coverage/assets/0.13.2/favicon_green.png +0 -0
- data/coradoc-markdown/coverage/assets/0.13.2/favicon_red.png +0 -0
- data/coradoc-markdown/coverage/assets/0.13.2/favicon_yellow.png +0 -0
- data/coradoc-markdown/coverage/assets/0.13.2/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
- data/coradoc-markdown/coverage/assets/0.13.2/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
- data/coradoc-markdown/coverage/assets/0.13.2/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
- data/coradoc-markdown/coverage/assets/0.13.2/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/coradoc-markdown/coverage/assets/0.13.2/images/ui-bg_glass_75_dadada_1x400.png +0 -0
- data/coradoc-markdown/coverage/assets/0.13.2/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
- data/coradoc-markdown/coverage/assets/0.13.2/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
- data/coradoc-markdown/coverage/assets/0.13.2/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
- data/coradoc-markdown/coverage/assets/0.13.2/images/ui-icons_222222_256x240.png +0 -0
- data/coradoc-markdown/coverage/assets/0.13.2/images/ui-icons_2e83ff_256x240.png +0 -0
- data/coradoc-markdown/coverage/assets/0.13.2/images/ui-icons_454545_256x240.png +0 -0
- data/coradoc-markdown/coverage/assets/0.13.2/images/ui-icons_888888_256x240.png +0 -0
- data/coradoc-markdown/coverage/assets/0.13.2/images/ui-icons_cd0a0a_256x240.png +0 -0
- data/coradoc-markdown/coverage/assets/0.13.2/loading.gif +0 -0
- data/coradoc-markdown/coverage/assets/0.13.2/magnify.png +0 -0
- data/coradoc-markdown/coverage/index.html +0 -66032
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 0e11ee6694907b37fdbd6fd3e19fcb999f418a7e651ad75905e4a1624cb4b90f
|
|
4
|
+
data.tar.gz: 52d69f86c727cbd25531a0849f5ac45df26c22d7adeb7d3cf7af6dcd6ec04cbb
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d5b89c11f9d99a1a5791e8c2cad44437dbb9af3adad2d5c5600b64d6d0cd222282e577367c2a09035baa69095a43468535cf93092759d788439a65ad33ae3d15
|
|
7
|
+
data.tar.gz: 26174aca95a3d2553919b31b65718ac0376f6c8e46744772201bf5869796226df2223353808ffdcaf871ff4b698cda6effd4cbab49013fc306d3d181af510bff
|
data/.rubocop_todo.yml
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# This configuration was generated by
|
|
2
2
|
# `rubocop --auto-gen-config`
|
|
3
|
-
# on 2026-05-
|
|
3
|
+
# on 2026-05-09 04:47:12 UTC using RuboCop version 1.75.8.
|
|
4
4
|
# The point is for the user to remove these configuration records
|
|
5
5
|
# one by one as the offenses are removed from the code base.
|
|
6
6
|
# Note that changes in the inspected code, or installation of new
|
|
@@ -15,27 +15,56 @@ Gemspec/RequiredRubyVersion:
|
|
|
15
15
|
- 'coradoc-html/coradoc-html.gemspec'
|
|
16
16
|
- 'coradoc.gemspec'
|
|
17
17
|
|
|
18
|
-
# Offense count:
|
|
18
|
+
# Offense count: 2
|
|
19
19
|
# This cop supports safe autocorrection (--autocorrect).
|
|
20
20
|
# Configuration parameters: EnforcedStyle, IndentationWidth.
|
|
21
21
|
# SupportedStyles: with_first_argument, with_fixed_indentation
|
|
22
22
|
Layout/ArgumentAlignment:
|
|
23
23
|
Exclude:
|
|
24
|
-
- 'coradoc-adoc/lib/coradoc/asciidoc/
|
|
24
|
+
- 'coradoc-adoc/lib/coradoc/asciidoc/transformer/structural_rules.rb'
|
|
25
25
|
|
|
26
26
|
# Offense count: 1
|
|
27
27
|
# This cop supports safe autocorrection (--autocorrect).
|
|
28
|
-
|
|
28
|
+
# Configuration parameters: EnforcedStyleAlignWith, Severity.
|
|
29
|
+
# SupportedStylesAlignWith: start_of_line, def
|
|
30
|
+
Layout/DefEndAlignment:
|
|
29
31
|
Exclude:
|
|
30
|
-
- 'lib/coradoc/
|
|
32
|
+
- 'lib/coradoc/core_model/block.rb'
|
|
33
|
+
|
|
34
|
+
# Offense count: 2
|
|
35
|
+
# This cop supports safe autocorrection (--autocorrect).
|
|
36
|
+
Layout/EmptyLineAfterGuardClause:
|
|
37
|
+
Exclude:
|
|
38
|
+
- 'coradoc-adoc/lib/coradoc/asciidoc/transform/to_core_model.rb'
|
|
39
|
+
- 'coradoc-html/lib/coradoc/html/renderer.rb'
|
|
40
|
+
|
|
41
|
+
# Offense count: 4
|
|
42
|
+
# This cop supports safe autocorrection (--autocorrect).
|
|
43
|
+
Layout/EmptyLines:
|
|
44
|
+
Exclude:
|
|
45
|
+
- 'coradoc-markdown/lib/coradoc/markdown/model/extension.rb'
|
|
46
|
+
- 'coradoc-markdown/lib/coradoc/markdown/model/highlight.rb'
|
|
47
|
+
- 'coradoc-markdown/lib/coradoc/markdown/model/math.rb'
|
|
48
|
+
- 'coradoc-markdown/lib/coradoc/markdown/model/strikethrough.rb'
|
|
49
|
+
|
|
50
|
+
# Offense count: 12
|
|
51
|
+
# This cop supports safe autocorrection (--autocorrect).
|
|
52
|
+
# Configuration parameters: AllowMultipleStyles, EnforcedHashRocketStyle, EnforcedColonStyle, EnforcedLastArgumentHashStyle.
|
|
53
|
+
# SupportedHashRocketStyles: key, separator, table
|
|
54
|
+
# SupportedColonStyles: key, separator, table
|
|
55
|
+
# SupportedLastArgumentHashStyles: always_inspect, always_ignore, ignore_implicit, ignore_explicit
|
|
56
|
+
Layout/HashAlignment:
|
|
57
|
+
Exclude:
|
|
58
|
+
- 'coradoc-adoc/lib/coradoc/asciidoc/parser/block.rb'
|
|
59
|
+
- 'coradoc-adoc/lib/coradoc/asciidoc/transformer/structural_rules.rb'
|
|
60
|
+
- 'spec/core_model/typed_blocks_spec.rb'
|
|
31
61
|
|
|
32
62
|
# Offense count: 1
|
|
33
63
|
# This cop supports safe autocorrection (--autocorrect).
|
|
34
|
-
# Configuration parameters:
|
|
35
|
-
|
|
36
|
-
Layout/FirstArgumentIndentation:
|
|
64
|
+
# Configuration parameters: Width, AllowedPatterns.
|
|
65
|
+
Layout/IndentationWidth:
|
|
37
66
|
Exclude:
|
|
38
|
-
- 'lib/coradoc/
|
|
67
|
+
- 'lib/coradoc/core_model/block.rb'
|
|
39
68
|
|
|
40
69
|
# Offense count: 6
|
|
41
70
|
# This cop supports safe autocorrection (--autocorrect).
|
|
@@ -44,26 +73,24 @@ Layout/FirstArgumentIndentation:
|
|
|
44
73
|
Layout/LineLength:
|
|
45
74
|
Max: 235
|
|
46
75
|
|
|
47
|
-
# Offense count:
|
|
48
|
-
# This cop supports safe autocorrection (--autocorrect).
|
|
49
|
-
# Configuration parameters: EnforcedStyle.
|
|
50
|
-
# SupportedStyles: symmetrical, new_line, same_line
|
|
51
|
-
Layout/MultilineMethodCallBraceLayout:
|
|
52
|
-
Exclude:
|
|
53
|
-
- 'lib/coradoc/document_manipulator.rb'
|
|
54
|
-
|
|
55
|
-
# Offense count: 1
|
|
76
|
+
# Offense count: 2
|
|
56
77
|
# This cop supports safe autocorrection (--autocorrect).
|
|
57
78
|
# Configuration parameters: AllowInHeredoc.
|
|
58
79
|
Layout/TrailingWhitespace:
|
|
59
80
|
Exclude:
|
|
60
|
-
- 'coradoc-adoc/lib/coradoc/asciidoc/
|
|
81
|
+
- 'coradoc-adoc/lib/coradoc/asciidoc/parser/block.rb'
|
|
82
|
+
- 'coradoc-adoc/lib/coradoc/asciidoc/transformer/structural_rules.rb'
|
|
61
83
|
|
|
62
84
|
# Offense count: 1
|
|
63
85
|
Lint/BinaryOperatorWithIdenticalOperands:
|
|
64
86
|
Exclude:
|
|
65
87
|
- 'coradoc-html/lib/coradoc/html/converters/attribute_reference.rb'
|
|
66
88
|
|
|
89
|
+
# Offense count: 1
|
|
90
|
+
Lint/DuplicateCaseCondition:
|
|
91
|
+
Exclude:
|
|
92
|
+
- 'coradoc-html/lib/coradoc/html/converters/base.rb'
|
|
93
|
+
|
|
67
94
|
# Offense count: 3
|
|
68
95
|
# This cop supports safe autocorrection (--autocorrect).
|
|
69
96
|
# Configuration parameters: AutoCorrect, AllowComments.
|
|
@@ -92,6 +119,13 @@ Lint/MissingSuper:
|
|
|
92
119
|
- 'coradoc-html/lib/coradoc/html/converters/template_html_converter.rb'
|
|
93
120
|
- 'lib/coradoc/visitor.rb'
|
|
94
121
|
|
|
122
|
+
# Offense count: 2
|
|
123
|
+
# This cop supports safe autocorrection (--autocorrect).
|
|
124
|
+
Lint/RedundantCopEnableDirective:
|
|
125
|
+
Exclude:
|
|
126
|
+
- 'coradoc-adoc/spec/coradoc/asciidoc/round_trip_spec.rb'
|
|
127
|
+
- 'coradoc-adoc/spec/coradoc/developer_experience_spec.rb'
|
|
128
|
+
|
|
95
129
|
# Offense count: 29
|
|
96
130
|
# Configuration parameters: AllowKeywordBlockArguments.
|
|
97
131
|
Lint/UnderscorePrefixedVariableName:
|
|
@@ -133,16 +167,16 @@ Lint/Void:
|
|
|
133
167
|
Exclude:
|
|
134
168
|
- 'coradoc-html/lib/coradoc/html.rb'
|
|
135
169
|
|
|
136
|
-
# Offense count:
|
|
170
|
+
# Offense count: 237
|
|
137
171
|
# Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes.
|
|
138
172
|
Metrics/AbcSize:
|
|
139
|
-
Max:
|
|
173
|
+
Max: 190
|
|
140
174
|
|
|
141
175
|
# Offense count: 15
|
|
142
176
|
# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns, inherit_mode.
|
|
143
177
|
# AllowedMethods: refine
|
|
144
178
|
Metrics/BlockLength:
|
|
145
|
-
Max:
|
|
179
|
+
Max: 151
|
|
146
180
|
|
|
147
181
|
# Offense count: 4
|
|
148
182
|
# Configuration parameters: CountBlocks, CountModifierForms.
|
|
@@ -154,15 +188,15 @@ Metrics/BlockNesting:
|
|
|
154
188
|
Metrics/ClassLength:
|
|
155
189
|
Max: 556
|
|
156
190
|
|
|
157
|
-
# Offense count:
|
|
191
|
+
# Offense count: 183
|
|
158
192
|
# Configuration parameters: AllowedMethods, AllowedPatterns.
|
|
159
193
|
Metrics/CyclomaticComplexity:
|
|
160
|
-
Max:
|
|
194
|
+
Max: 33
|
|
161
195
|
|
|
162
|
-
# Offense count:
|
|
196
|
+
# Offense count: 388
|
|
163
197
|
# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
|
|
164
198
|
Metrics/MethodLength:
|
|
165
|
-
Max:
|
|
199
|
+
Max: 245
|
|
166
200
|
|
|
167
201
|
# Offense count: 21
|
|
168
202
|
# Configuration parameters: CountComments, CountAsOne.
|
|
@@ -175,7 +209,7 @@ Metrics/ParameterLists:
|
|
|
175
209
|
Max: 7
|
|
176
210
|
MaxOptionalParameters: 4
|
|
177
211
|
|
|
178
|
-
# Offense count:
|
|
212
|
+
# Offense count: 123
|
|
179
213
|
# Configuration parameters: AllowedMethods, AllowedPatterns.
|
|
180
214
|
Metrics/PerceivedComplexity:
|
|
181
215
|
Max: 27
|
|
@@ -201,11 +235,12 @@ Naming/MethodName:
|
|
|
201
235
|
Exclude:
|
|
202
236
|
- 'coradoc-markdown/lib/coradoc/markdown.rb'
|
|
203
237
|
|
|
204
|
-
# Offense count:
|
|
238
|
+
# Offense count: 20
|
|
205
239
|
# Configuration parameters: MinNameLength, AllowNamesEndingInNumbers, AllowedNames, ForbiddenNames.
|
|
206
240
|
# AllowedNames: as, at, by, cc, db, id, if, in, io, ip, of, on, os, pp, to
|
|
207
241
|
Naming/MethodParameterName:
|
|
208
242
|
Exclude:
|
|
243
|
+
- 'coradoc-adoc/spec/coradoc/asciidoc/integration_pipeline_spec.rb'
|
|
209
244
|
- 'coradoc-docx/lib/coradoc/docx/transform/from_core_model.rb'
|
|
210
245
|
- 'coradoc-docx/lib/coradoc/docx/transform/rules/run_rule.rb'
|
|
211
246
|
- 'coradoc-html/lib/coradoc/html/converters/base.rb'
|
|
@@ -238,12 +273,6 @@ Naming/VariableName:
|
|
|
238
273
|
Exclude:
|
|
239
274
|
- 'coradoc-markdown/lib/coradoc/markdown.rb'
|
|
240
275
|
|
|
241
|
-
# Offense count: 12
|
|
242
|
-
# This cop supports unsafe autocorrection (--autocorrect-all).
|
|
243
|
-
RSpec/BeEq:
|
|
244
|
-
Exclude:
|
|
245
|
-
- 'coradoc-adoc/spec/coradoc/asciidoc/model/element_classification_spec.rb'
|
|
246
|
-
|
|
247
276
|
# Offense count: 1
|
|
248
277
|
RSpec/BeforeAfterAll:
|
|
249
278
|
Exclude:
|
|
@@ -252,20 +281,12 @@ RSpec/BeforeAfterAll:
|
|
|
252
281
|
- '**/spec/support/**/*.rb'
|
|
253
282
|
- 'spec/benchmark/performance_spec.rb'
|
|
254
283
|
|
|
255
|
-
# Offense count:
|
|
284
|
+
# Offense count: 24
|
|
256
285
|
# Configuration parameters: IgnoredMetadata.
|
|
257
286
|
RSpec/DescribeClass:
|
|
258
287
|
Enabled: false
|
|
259
288
|
|
|
260
|
-
# Offense count:
|
|
261
|
-
# This cop supports unsafe autocorrection (--autocorrect-all).
|
|
262
|
-
# Configuration parameters: SkipBlocks, EnforcedStyle, OnlyStaticConstants.
|
|
263
|
-
# SupportedStyles: described_class, explicit
|
|
264
|
-
RSpec/DescribedClass:
|
|
265
|
-
Exclude:
|
|
266
|
-
- 'coradoc-adoc/spec/coradoc/asciidoc/model/base_spec.rb'
|
|
267
|
-
|
|
268
|
-
# Offense count: 485
|
|
289
|
+
# Offense count: 500
|
|
269
290
|
# Configuration parameters: CountAsOne.
|
|
270
291
|
RSpec/ExampleLength:
|
|
271
292
|
Max: 36
|
|
@@ -316,7 +337,7 @@ RSpec/MessageSpies:
|
|
|
316
337
|
RSpec/MultipleDescribes:
|
|
317
338
|
Enabled: false
|
|
318
339
|
|
|
319
|
-
# Offense count:
|
|
340
|
+
# Offense count: 629
|
|
320
341
|
RSpec/MultipleExpectations:
|
|
321
342
|
Max: 12
|
|
322
343
|
|
|
@@ -395,19 +416,23 @@ Style/ClassVars:
|
|
|
395
416
|
- 'coradoc-adoc/lib/coradoc/asciidoc/serializer/element_registry.rb'
|
|
396
417
|
- 'coradoc-html/lib/coradoc/html/input/converters.rb'
|
|
397
418
|
|
|
398
|
-
# Offense count:
|
|
419
|
+
# Offense count: 305
|
|
399
420
|
# Configuration parameters: AllowedConstants.
|
|
400
421
|
Style/Documentation:
|
|
401
422
|
Enabled: false
|
|
402
423
|
|
|
403
|
-
# Offense count:
|
|
424
|
+
# Offense count: 7
|
|
404
425
|
# This cop supports safe autocorrection (--autocorrect).
|
|
405
426
|
# Configuration parameters: AutoCorrect, EnforcedStyle, AllowComments.
|
|
406
427
|
# SupportedStyles: empty, nil, both
|
|
407
428
|
Style/EmptyElse:
|
|
408
429
|
Exclude:
|
|
409
430
|
- 'coradoc-docx/lib/coradoc/docx/transform/rules/bookmark_rule.rb'
|
|
431
|
+
- 'coradoc-html/lib/coradoc/html/converters/base.rb'
|
|
410
432
|
- 'coradoc-html/lib/coradoc/html/input/converters/text.rb'
|
|
433
|
+
- 'coradoc-markdown/lib/coradoc/markdown/transform/from_core_model.rb'
|
|
434
|
+
- 'lib/coradoc/core_model/block.rb'
|
|
435
|
+
- 'lib/coradoc/core_model/builder/block_builder.rb'
|
|
411
436
|
- 'lib/coradoc/core_model/toc_generator.rb'
|
|
412
437
|
|
|
413
438
|
# Offense count: 3
|
|
@@ -423,19 +448,25 @@ Style/GlobalVars:
|
|
|
423
448
|
Exclude:
|
|
424
449
|
- 'utils/parser_analyzer.rb'
|
|
425
450
|
|
|
426
|
-
# Offense count:
|
|
451
|
+
# Offense count: 6
|
|
427
452
|
# Configuration parameters: MinBranchesCount.
|
|
428
453
|
Style/HashLikeCase:
|
|
429
454
|
Exclude:
|
|
430
455
|
- 'coradoc-adoc/lib/coradoc/asciidoc/model/table_cell.rb'
|
|
431
456
|
- 'coradoc-html/lib/coradoc/html/input/converters/table.rb'
|
|
432
457
|
- 'coradoc-html/lib/coradoc/html/input/converters/td.rb'
|
|
458
|
+
- 'lib/coradoc/core_model/builder/block_builder.rb'
|
|
433
459
|
|
|
434
460
|
# Offense count: 1
|
|
435
461
|
# This cop supports safe autocorrection (--autocorrect).
|
|
436
|
-
Style/
|
|
462
|
+
Style/IfUnlessModifier:
|
|
437
463
|
Exclude:
|
|
438
|
-
- 'coradoc-adoc/
|
|
464
|
+
- 'coradoc-adoc/spec/coradoc/asciidoc/integration_pipeline_spec.rb'
|
|
465
|
+
|
|
466
|
+
# Offense count: 2
|
|
467
|
+
Style/MultilineBlockChain:
|
|
468
|
+
Exclude:
|
|
469
|
+
- 'coradoc-adoc/lib/coradoc/asciidoc/transform/to_core_model.rb'
|
|
439
470
|
|
|
440
471
|
# Offense count: 1
|
|
441
472
|
# This cop supports unsafe autocorrection (--autocorrect-all).
|
|
@@ -452,6 +483,20 @@ Style/OptionalBooleanParameter:
|
|
|
452
483
|
Exclude:
|
|
453
484
|
- 'coradoc-adoc/lib/coradoc/asciidoc/parser/content.rb'
|
|
454
485
|
|
|
486
|
+
# Offense count: 1
|
|
487
|
+
# This cop supports safe autocorrection (--autocorrect).
|
|
488
|
+
Style/RedundantParentheses:
|
|
489
|
+
Exclude:
|
|
490
|
+
- 'lib/coradoc/core_model/block.rb'
|
|
491
|
+
|
|
492
|
+
# Offense count: 1
|
|
493
|
+
# This cop supports unsafe autocorrection (--autocorrect-all).
|
|
494
|
+
# Configuration parameters: ConvertCodeThatCanStartToReturnNil, AllowedMethods, MaxChainLength.
|
|
495
|
+
# AllowedMethods: present?, blank?, presence, try, try!
|
|
496
|
+
Style/SafeNavigation:
|
|
497
|
+
Exclude:
|
|
498
|
+
- 'coradoc-adoc/spec/coradoc/asciidoc/integration_pipeline_spec.rb'
|
|
499
|
+
|
|
455
500
|
# Offense count: 1
|
|
456
501
|
# This cop supports unsafe autocorrection (--autocorrect-all).
|
|
457
502
|
# Configuration parameters: Mode.
|
|
@@ -459,7 +504,7 @@ Style/StringConcatenation:
|
|
|
459
504
|
Exclude:
|
|
460
505
|
- 'coradoc-adoc/lib/coradoc/asciidoc/serializer/serializers/document_attributes.rb'
|
|
461
506
|
|
|
462
|
-
# Offense count:
|
|
507
|
+
# Offense count: 43
|
|
463
508
|
# This cop supports safe autocorrection (--autocorrect).
|
|
464
509
|
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns, SplitStrings.
|
|
465
510
|
# URISchemes: http, https
|
|
@@ -20,6 +20,13 @@ module Coradoc
|
|
|
20
20
|
#
|
|
21
21
|
class ThematicBreak < Base
|
|
22
22
|
end
|
|
23
|
+
|
|
24
|
+
# Page break for AsciiDoc documents.
|
|
25
|
+
#
|
|
26
|
+
# Represented by <<< in AsciiDoc. Layout-only element;
|
|
27
|
+
# has no CoreModel equivalent and is filtered during ToCoreModel.
|
|
28
|
+
class PageBreak < Base
|
|
29
|
+
end
|
|
23
30
|
end
|
|
24
31
|
end
|
|
25
32
|
end
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
require_relative 'resolver'
|
|
4
|
-
|
|
5
3
|
module Coradoc
|
|
6
4
|
module AsciiDoc
|
|
7
5
|
module Model
|
|
6
|
+
autoload :Resolver, "#{__dir__}/resolver"
|
|
7
|
+
|
|
8
8
|
# Document model representing an AsciiDoc document.
|
|
9
9
|
#
|
|
10
10
|
# The Document class is the main container for parsed AsciiDoc content.
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
require_relative 'resolvable'
|
|
4
|
-
|
|
5
3
|
module Coradoc
|
|
6
4
|
module AsciiDoc
|
|
7
5
|
module Model
|
|
6
|
+
autoload :Resolvable, "#{__dir__}/resolvable"
|
|
7
|
+
|
|
8
8
|
# Include directive element for AsciiDoc documents.
|
|
9
9
|
#
|
|
10
10
|
# Include directives allow incorporating content from external files
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
# IMPORTANT: Load
|
|
4
|
-
#
|
|
5
|
-
#
|
|
6
|
-
require_relative 'model/base'
|
|
3
|
+
# IMPORTANT: Load Serialization module eagerly — it registers the asciidoc
|
|
4
|
+
# format with Lutaml::Model, which is needed before any model class can
|
|
5
|
+
# use the asciidoc DSL.
|
|
7
6
|
require_relative 'model/serialization'
|
|
8
7
|
|
|
9
8
|
module Coradoc
|
|
10
9
|
module AsciiDoc
|
|
11
10
|
module Model
|
|
11
|
+
# Base class for all AsciiDoc model classes (no side effects)
|
|
12
|
+
autoload :Base, "#{__dir__}/model/base"
|
|
13
|
+
|
|
12
14
|
# Layer 0: Mixins (no dependencies)
|
|
13
15
|
autoload :Anchorable, "#{__dir__}/model/anchorable"
|
|
14
16
|
autoload :Attached, "#{__dir__}/model/attached"
|
|
@@ -55,7 +55,7 @@ module Coradoc
|
|
|
55
55
|
end
|
|
56
56
|
|
|
57
57
|
def source_block(n_deep)
|
|
58
|
-
block_style(n_deep, '-', 4)
|
|
58
|
+
block_style(n_deep, '-', 4, verbatim: true)
|
|
59
59
|
end
|
|
60
60
|
|
|
61
61
|
# Open block: exactly 2 dashes (cannot nest within itself)
|
|
@@ -76,7 +76,7 @@ module Coradoc
|
|
|
76
76
|
def block_content(n_deep = 3)
|
|
77
77
|
c = block_image |
|
|
78
78
|
list |
|
|
79
|
-
text_line |
|
|
79
|
+
text_line(false, unguarded: true) |
|
|
80
80
|
empty_line.as(:line_break)
|
|
81
81
|
c |= block(n_deep - 1) if n_deep.positive?
|
|
82
82
|
c.repeat(1)
|
|
@@ -110,7 +110,7 @@ module Coradoc
|
|
|
110
110
|
# @param delimiter [String] The delimiter character ("=", "-", "_", "*", "+")
|
|
111
111
|
# @param repeater [Integer] Minimum number of delimiter characters (default: 4)
|
|
112
112
|
# @param type [Symbol] Block type for special handling (e.g., :pass)
|
|
113
|
-
def block_style(n_deep = 3, delimiter = '*', repeater = 4, type = nil)
|
|
113
|
+
def block_style(n_deep = 3, delimiter = '*', repeater = 4, type = nil, verbatim: false)
|
|
114
114
|
# repeat(repeater,) means repeater or more characters
|
|
115
115
|
current_delimiter = str(delimiter).repeat(repeater).capture(:delimit)
|
|
116
116
|
closing_delimiter = dynamic do |_s, c|
|
|
@@ -124,7 +124,8 @@ module Coradoc
|
|
|
124
124
|
closing_pattern = str(delim_str) >> newline
|
|
125
125
|
|
|
126
126
|
# Build content that doesn't match the closing delimiter
|
|
127
|
-
content = block_image | list | text_line
|
|
127
|
+
content = block_image | list | text_line(false, unguarded: true,
|
|
128
|
+
verbatim: verbatim) | empty_line.as(:line_break)
|
|
128
129
|
if n_deep.positive?
|
|
129
130
|
# For nested blocks, also prevent them from consuming the closing delimiter
|
|
130
131
|
content |= block(n_deep - 1)
|
|
@@ -139,7 +140,7 @@ module Coradoc
|
|
|
139
140
|
line_start? >>
|
|
140
141
|
current_delimiter.as(:delimiter) >> newline >>
|
|
141
142
|
if type == :pass
|
|
142
|
-
(text_line | empty_line.as(:line_break)).repeat(1).as(:lines)
|
|
143
|
+
(text_line(false, unguarded: true, verbatim: verbatim) | empty_line.as(:line_break)).repeat(1).as(:lines)
|
|
143
144
|
else
|
|
144
145
|
# Use dynamic block content that respects closing delimiter
|
|
145
146
|
block_content_with_closing.as(:lines)
|
|
@@ -161,7 +162,7 @@ module Coradoc
|
|
|
161
162
|
delim_str = c.captures[:delimit].to_s.strip
|
|
162
163
|
closing_pattern = str(delim_str) >> newline
|
|
163
164
|
|
|
164
|
-
content = block_image | list | text_line | empty_line.as(:line_break)
|
|
165
|
+
content = block_image | list | text_line(false, unguarded: true) | empty_line.as(:line_break)
|
|
165
166
|
content |= block(n_deep - 1) if n_deep.positive?
|
|
166
167
|
|
|
167
168
|
(closing_pattern.absent? >> content).repeat(1)
|
|
@@ -172,7 +173,7 @@ module Coradoc
|
|
|
172
173
|
line_start? >>
|
|
173
174
|
current_delimiter.as(:delimiter) >> newline >>
|
|
174
175
|
if type == :pass
|
|
175
|
-
(text_line | empty_line.as(:line_break)).repeat(1).as(:lines)
|
|
176
|
+
(text_line(false, unguarded: true) | empty_line.as(:line_break)).repeat(1).as(:lines)
|
|
176
177
|
else
|
|
177
178
|
block_content_with_closing.as(:lines)
|
|
178
179
|
end >>
|
|
@@ -22,9 +22,15 @@ module Coradoc
|
|
|
22
22
|
|
|
23
23
|
# Text
|
|
24
24
|
# :zero :one :many
|
|
25
|
-
def text_line(many_breaks = false)
|
|
26
|
-
tl =
|
|
27
|
-
|
|
25
|
+
def text_line(many_breaks = false, unguarded: false, verbatim: false)
|
|
26
|
+
tl = if verbatim
|
|
27
|
+
text_any.as(:text)
|
|
28
|
+
elsif unguarded
|
|
29
|
+
literal_space? >> text_any.as(:text)
|
|
30
|
+
else
|
|
31
|
+
(asciidoc_char_with_id.absent? | element_id_inline) >>
|
|
32
|
+
literal_space? >> text_any.as(:text)
|
|
33
|
+
end
|
|
28
34
|
if many_breaks
|
|
29
35
|
tl >> (line_ending.repeat(1).as(:line_break) | eof?)
|
|
30
36
|
else
|
|
@@ -60,6 +66,10 @@ module Coradoc
|
|
|
60
66
|
def glossaries
|
|
61
67
|
glossary.repeat(1)
|
|
62
68
|
end
|
|
69
|
+
|
|
70
|
+
def page_break
|
|
71
|
+
str('<<<') >> line_ending
|
|
72
|
+
end
|
|
63
73
|
end
|
|
64
74
|
end
|
|
65
75
|
end
|
|
@@ -12,7 +12,7 @@ module Coradoc
|
|
|
12
12
|
|
|
13
13
|
def bold_constrained
|
|
14
14
|
(str('*').present? >> str('*') >>
|
|
15
|
-
match('[
|
|
15
|
+
match('[^*\n]').repeat(1).as(:text).repeat(1, 1) >>
|
|
16
16
|
str('*') >> str('*').absent? >>
|
|
17
17
|
str("\n\n").absent?
|
|
18
18
|
).as(:bold_constrained)
|
|
@@ -20,7 +20,7 @@ module Coradoc
|
|
|
20
20
|
|
|
21
21
|
def bold_unconstrained
|
|
22
22
|
(str('**').present? >> str('**') >>
|
|
23
|
-
match('[
|
|
23
|
+
match('[^*\n]').repeat(1).as(:text).repeat(1, 1) >>
|
|
24
24
|
str('**')
|
|
25
25
|
).as(:bold_unconstrained)
|
|
26
26
|
end
|
|
@@ -28,7 +28,7 @@ module Coradoc
|
|
|
28
28
|
def span_constrained
|
|
29
29
|
(attribute_list >>
|
|
30
30
|
str('#') >>
|
|
31
|
-
match('[
|
|
31
|
+
match('[^#\n]').repeat(1).as(:text) >>
|
|
32
32
|
str('#') >> str('#').absent?
|
|
33
33
|
).as(:span_constrained)
|
|
34
34
|
end
|
|
@@ -36,63 +36,63 @@ module Coradoc
|
|
|
36
36
|
def span_unconstrained
|
|
37
37
|
(attribute_list >>
|
|
38
38
|
str('##') >>
|
|
39
|
-
match('[
|
|
39
|
+
match('[^#\n]').repeat(1).as(:text) >>
|
|
40
40
|
str('##')
|
|
41
41
|
).as(:span_unconstrained)
|
|
42
42
|
end
|
|
43
43
|
|
|
44
44
|
def italic_constrained
|
|
45
45
|
(str('_') >> str('_').absent? >>
|
|
46
|
-
match('[^_]').repeat(1).as(:text).repeat(1, 1) >>
|
|
46
|
+
match('[^_\n]').repeat(1).as(:text).repeat(1, 1) >>
|
|
47
47
|
str('_') >> str('_').absent?
|
|
48
48
|
).as(:italic_constrained)
|
|
49
49
|
end
|
|
50
50
|
|
|
51
51
|
def italic_unconstrained
|
|
52
52
|
(str('__') >>
|
|
53
|
-
match('[^_]').repeat(1).as(:text).repeat(1, 1) >>
|
|
53
|
+
match('[^_\n]').repeat(1).as(:text).repeat(1, 1) >>
|
|
54
54
|
str('__')
|
|
55
55
|
).as(:italic_unconstrained)
|
|
56
56
|
end
|
|
57
57
|
|
|
58
58
|
def highlight_constrained
|
|
59
59
|
(str('#') >>
|
|
60
|
-
match('[
|
|
60
|
+
match('[^#\n]').repeat(1).as(:text).repeat(1, 1) >>
|
|
61
61
|
str('#') >> str('#').absent?
|
|
62
62
|
).as(:highlight_constrained)
|
|
63
63
|
end
|
|
64
64
|
|
|
65
65
|
def highlight_unconstrained
|
|
66
66
|
(str('##') >>
|
|
67
|
-
match('[
|
|
67
|
+
match('[^#\n]').repeat(1).as(:text).repeat(1, 1) >>
|
|
68
68
|
str('##')
|
|
69
69
|
).as(:highlight_unconstrained)
|
|
70
70
|
end
|
|
71
71
|
|
|
72
72
|
def monospace_constrained
|
|
73
73
|
(str('`') >>
|
|
74
|
-
match('[
|
|
74
|
+
match('[^`\n]').repeat(1).as(:text).repeat(1, 1) >>
|
|
75
75
|
str('`') >> str('`').absent?
|
|
76
76
|
).as(:monospace_constrained)
|
|
77
77
|
end
|
|
78
78
|
|
|
79
79
|
def monospace_unconstrained
|
|
80
80
|
(str('``') >>
|
|
81
|
-
match('[
|
|
81
|
+
match('[^`\n]').repeat(1).as(:text).repeat(1, 1) >>
|
|
82
82
|
str('``')
|
|
83
83
|
).as(:monospace_unconstrained)
|
|
84
84
|
end
|
|
85
85
|
|
|
86
86
|
def superscript
|
|
87
87
|
(str('^') >>
|
|
88
|
-
match('[
|
|
88
|
+
match('[^^\n]').repeat(1).as(:text).repeat(1, 1) >>
|
|
89
89
|
str('^')
|
|
90
90
|
).as(:superscript)
|
|
91
91
|
end
|
|
92
92
|
|
|
93
93
|
def subscript
|
|
94
94
|
(str('~') >>
|
|
95
|
-
match('[
|
|
95
|
+
match('[^~\n]').repeat(1).as(:text).repeat(1, 1) >>
|
|
96
96
|
str('~')
|
|
97
97
|
).as(:subscript)
|
|
98
98
|
end
|
|
@@ -100,7 +100,7 @@ module Coradoc
|
|
|
100
100
|
def span
|
|
101
101
|
attribute_list >>
|
|
102
102
|
(str('#') >>
|
|
103
|
-
match('[
|
|
103
|
+
match('[^#\n]').repeat(1).as(:text) >>
|
|
104
104
|
str('#') >> str('#').absent?
|
|
105
105
|
).as(:span)
|
|
106
106
|
end
|
|
@@ -126,7 +126,7 @@ module Coradoc
|
|
|
126
126
|
def underline
|
|
127
127
|
(attribute_list >> match('\\[.underline\\]').as(:role) >>
|
|
128
128
|
str('#') >>
|
|
129
|
-
match('[
|
|
129
|
+
match('[^#\n]').repeat(1).as(:text) >>
|
|
130
130
|
str('#')
|
|
131
131
|
).as(:underline)
|
|
132
132
|
end
|
|
@@ -134,7 +134,7 @@ module Coradoc
|
|
|
134
134
|
def small
|
|
135
135
|
(attribute_list >> match('\\[.small\\]').as(:role) >>
|
|
136
136
|
str('#') >>
|
|
137
|
-
match('[
|
|
137
|
+
match('[^#\n]').repeat(1).as(:text) >>
|
|
138
138
|
str('#')
|
|
139
139
|
).as(:small)
|
|
140
140
|
end
|
|
@@ -55,7 +55,7 @@ module Coradoc
|
|
|
55
55
|
|
|
56
56
|
def olist_item(nesting_level = 1)
|
|
57
57
|
item = olist_marker(nesting_level).as(:marker) >>
|
|
58
|
-
match("\n").absent? >> space >> text_line(true)
|
|
58
|
+
match("\n").absent? >> space >> text_line(true, unguarded: true)
|
|
59
59
|
# >>
|
|
60
60
|
# (list_continuation.present? >> list_continuation >>
|
|
61
61
|
# paragraph #| example_block(n_deep: 1)
|
|
@@ -86,7 +86,7 @@ module Coradoc
|
|
|
86
86
|
def ulist_item(nesting_level = 1)
|
|
87
87
|
item = ulist_marker(nesting_level).as(:marker) >>
|
|
88
88
|
str(' [[[').absent? >>
|
|
89
|
-
match("\n").absent? >> space >> text_line(true)
|
|
89
|
+
match("\n").absent? >> space >> text_line(true, unguarded: true)
|
|
90
90
|
|
|
91
91
|
att = (list_continuation.present? >>
|
|
92
92
|
list_continuation >>
|
|
@@ -31,7 +31,10 @@ module Coradoc
|
|
|
31
31
|
end
|
|
32
32
|
|
|
33
33
|
# Only serialize document_attributes if it has data
|
|
34
|
-
|
|
34
|
+
if @model.document_attributes&.data && !@model.document_attributes.data.empty?
|
|
35
|
+
parts << serialize_child(@model.document_attributes,
|
|
36
|
+
@context)
|
|
37
|
+
end
|
|
35
38
|
|
|
36
39
|
# Serialize sections with last_element tracking
|
|
37
40
|
parts << serialize_sections_with_last_element if @model.sections && !@model.sections.empty?
|