metanorma-iso 3.5.9 → 3.5.23
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/.gitignore +1 -0
- data/.rubocop.yml +0 -1
- data/Gemfile +3 -1
- data/data/iso-dis/styles.yml +110 -25
- data/data/iso-dis/template.docx +0 -0
- data/data/iso-simple/document_metadata.yml +33 -0
- data/docs/validation-baselines.md +98 -0
- data/docs/validation-rule-kinds.md +80 -0
- data/docs/validation-suppression-authoring.md +119 -0
- data/lib/isodoc/iso/docx/adapter.rb +61 -1
- data/lib/isodoc/iso/docx/box_wrapper.rb +147 -8
- data/lib/isodoc/iso/docx/context.rb +15 -1
- data/lib/isodoc/iso/docx/cover_renderer.rb +253 -7
- data/lib/isodoc/iso/docx/document_properties.rb +6 -1
- data/lib/isodoc/iso/docx/formula_renderer.rb +55 -81
- data/lib/isodoc/iso/docx/inline.rb +139 -9
- data/lib/isodoc/iso/docx/inline_renderers/stem_renderer.rb +30 -7
- data/lib/isodoc/iso/docx/math_conversion.rb +132 -0
- data/lib/isodoc/iso/docx/mhtml_parity.rb +267 -0
- data/lib/isodoc/iso/docx/renderers/bibliography_renderer.rb +18 -0
- data/lib/isodoc/iso/docx/renderers/definition_list_renderer.rb +45 -4
- data/lib/isodoc/iso/docx/renderers/definition_section_renderer.rb +33 -0
- data/lib/isodoc/iso/docx/renderers/example_renderer.rb +18 -11
- data/lib/isodoc/iso/docx/renderers/list_attachments.rb +29 -0
- data/lib/isodoc/iso/docx/renderers/note_renderer.rb +14 -12
- data/lib/isodoc/iso/docx/renderers/ordered_list_renderer.rb +2 -0
- data/lib/isodoc/iso/docx/renderers/unordered_list_renderer.rb +2 -0
- data/lib/isodoc/iso/docx/renderers/walker.rb +12 -2
- data/lib/isodoc/iso/docx/renderers.rb +3 -0
- data/lib/isodoc/iso/docx/toc_builder.rb +120 -36
- data/lib/isodoc/iso/docx.rb +1 -0
- data/lib/isodoc/iso/html/style-human.css +10 -0
- data/lib/isodoc/iso/html/style-iso.css +10 -0
- data/lib/isodoc/iso/html_convert.rb +2 -2
- data/lib/isodoc/iso/isosts_convert.rb +4 -3
- data/lib/isodoc/iso/sts_convert.rb +32 -3
- data/lib/isodoc/iso/word_convert.rb +3 -3
- data/lib/isodoc/iso/word_dis_convert.rb +2 -2
- data/lib/metanorma/iso/base.rb +4 -3
- data/lib/metanorma/iso/cleanup_biblio.rb +1 -1
- data/lib/metanorma/iso/document/sections/iso_terms_section.rb +5 -0
- data/lib/metanorma/iso/log.rb +206 -2
- data/lib/metanorma/iso/processor.rb +33 -33
- data/lib/metanorma/iso/sts/html_renderer/ruby.rb +21 -4
- data/lib/metanorma/iso/sts/output_sanitizer/front_leak_sanitizer.rb +89 -0
- data/lib/metanorma/iso/sts/output_sanitizer/inline_identifier_sanitizer.rb +44 -0
- data/lib/metanorma/iso/sts/output_sanitizer/unique_id_sanitizer.rb +50 -0
- data/lib/metanorma/iso/sts/output_sanitizer.rb +61 -0
- data/lib/metanorma/iso/sts/transformer/block_dispatcher.rb +1 -1
- data/lib/metanorma/iso/sts/transformer/content_text.rb +5 -0
- data/lib/metanorma/iso/sts/transformer/inline_transformer.rb +10 -4
- data/lib/metanorma/iso/sts/transformer/list_transformer.rb +8 -6
- data/lib/metanorma/iso/sts/transformer/source_document.rb +6 -0
- data/lib/metanorma/iso/sts/transformer/term_transformer.rb +29 -16
- data/lib/metanorma/iso/sts.rb +10 -7
- data/lib/metanorma/iso/validate.rb +84 -46
- data/lib/metanorma/iso/validation/citation.rb +50 -0
- data/lib/metanorma/iso/validation/composed_registry.rb +321 -0
- data/lib/metanorma/iso/validation/context.rb +18 -2
- data/lib/metanorma/iso/validation/converter_state.rb +1 -1
- data/lib/metanorma/iso/validation/legacy_policy.rb +248 -0
- data/lib/metanorma/iso/validation/model_validator.rb +16 -2
- data/lib/metanorma/iso/validation/policy_doc.rb +378 -0
- data/lib/metanorma/iso/validation/profile.rb +162 -1
- data/lib/metanorma/iso/validation/profiles/directives.yml +13 -0
- data/lib/metanorma/iso/validation/profiles/house-style-core.yml +11 -0
- data/lib/metanorma/iso/validation/profiles/house-style.yml +18 -0
- data/lib/metanorma/iso/validation/profiles/lists.yml +10 -0
- data/lib/metanorma/iso/validation/profiles/oxford-spelling.yml +11 -0
- data/lib/metanorma/iso/validation/profiles/quality-english.yml +30 -0
- data/lib/metanorma/iso/validation/profiles/referencing.yml +11 -0
- data/lib/metanorma/iso/validation/rules/abbrev_first_use_rule.rb +324 -0
- data/lib/metanorma/iso/validation/rules/asset_cited_first_rule.rb +131 -0
- data/lib/metanorma/iso/validation/rules/base.rb +113 -5
- data/lib/metanorma/iso/validation/rules/broken_xref_rule.rb +9 -5
- data/lib/metanorma/iso/validation/rules/doctype_rule.rb +5 -0
- data/lib/metanorma/iso/validation/rules/document_order_walk.rb +204 -0
- data/lib/metanorma/iso/validation/rules/foreword_presence_rule.rb +6 -1
- data/lib/metanorma/iso/validation/rules/foreword_structure_rule.rb +5 -0
- data/lib/metanorma/iso/validation/rules/iteration_rule.rb +4 -0
- data/lib/metanorma/iso/validation/rules/list_count_rule.rb +5 -2
- data/lib/metanorma/iso/validation/rules/list_depth_rule.rb +5 -2
- data/lib/metanorma/iso/validation/rules/list_punctuation_rule.rb +10 -3
- data/lib/metanorma/iso/validation/rules/locality_erefs_rule.rb +5 -0
- data/lib/metanorma/iso/validation/rules/modal_in_clause_rule.rb +7 -0
- data/lib/metanorma/iso/validation/rules/normative_bibitem_rule.rb +5 -0
- data/lib/metanorma/iso/validation/rules/normative_references_presence_rule.rb +5 -0
- data/lib/metanorma/iso/validation/rules/only_child_clause_rule.rb +5 -0
- data/lib/metanorma/iso/validation/rules/scope_presence_rule.rb +5 -0
- data/lib/metanorma/iso/validation/rules/scope_subclauses_rule.rb +5 -0
- data/lib/metanorma/iso/validation/rules/section_sequence_rule.rb +15 -1
- data/lib/metanorma/iso/validation/rules/see_xrefs_rule.rb +11 -4
- data/lib/metanorma/iso/validation/rules/stem_math.rb +87 -0
- data/lib/metanorma/iso/validation/rules/style_a_or_an_rule.rb +54 -0
- data/lib/metanorma/iso/validation/rules/style_abbrev_articles_rule.rb +44 -0
- data/lib/metanorma/iso/validation/rules/style_abbrev_plural_rule.rb +34 -0
- data/lib/metanorma/iso/validation/rules/style_abbrev_tables_only_rule.rb +36 -0
- data/lib/metanorma/iso/validation/rules/style_abbrev_uppercase_rule.rb +137 -0
- data/lib/metanorma/iso/validation/rules/style_ac_dc_rf_rule.rb +42 -0
- data/lib/metanorma/iso/validation/rules/style_affect_effect_rule.rb +53 -0
- data/lib/metanorma/iso/validation/rules/style_ambig_words_rule.rb +9 -0
- data/lib/metanorma/iso/validation/rules/style_apostrophe_plurals_rule.rb +60 -0
- data/lib/metanorma/iso/validation/rules/style_assure_ensure_rule.rb +82 -0
- data/lib/metanorma/iso/validation/rules/style_bar_knot_footnote_rule.rb +105 -0
- data/lib/metanorma/iso/validation/rules/style_bare_slash_rule.rb +58 -0
- data/lib/metanorma/iso/validation/rules/style_boxed_values_rule.rb +68 -0
- data/lib/metanorma/iso/validation/rules/style_ca_cf_rule.rb +35 -0
- data/lib/metanorma/iso/validation/rules/style_chem_prefix_rule.rb +167 -0
- data/lib/metanorma/iso/validation/rules/style_compliance_rule.rb +32 -0
- data/lib/metanorma/iso/validation/rules/style_contractions_rule.rb +39 -0
- data/lib/metanorma/iso/validation/rules/style_country_names_rule.rb +48 -0
- data/lib/metanorma/iso/validation/rules/style_currency_code_order_rule.rb +65 -0
- data/lib/metanorma/iso/validation/rules/style_currency_symbols_rule.rb +53 -0
- data/lib/metanorma/iso/validation/rules/style_cv_not_rsd_rule.rb +33 -0
- data/lib/metanorma/iso/validation/rules/style_date_duration_rule.rb +66 -0
- data/lib/metanorma/iso/validation/rules/style_date_formats_rule.rb +59 -0
- data/lib/metanorma/iso/validation/rules/style_decimal_comma_rule.rb +81 -0
- data/lib/metanorma/iso/validation/rules/style_directives_refs_rule.rb +78 -0
- data/lib/metanorma/iso/validation/rules/style_eg_etc_rule.rb +73 -0
- data/lib/metanorma/iso/validation/rules/style_eg_placement_rule.rb +73 -0
- data/lib/metanorma/iso/validation/rules/style_empty_clause_rule.rb +95 -0
- data/lib/metanorma/iso/validation/rules/style_en_dash_ranges_rule.rb +66 -0
- data/lib/metanorma/iso/validation/rules/style_family_suite_rule.rb +31 -0
- data/lib/metanorma/iso/validation/rules/style_fewer_less_rule.rb +60 -0
- data/lib/metanorma/iso/validation/rules/style_formulae_rule.rb +30 -0
- data/lib/metanorma/iso/validation/rules/style_guidelines_rule.rb +91 -0
- data/lib/metanorma/iso/validation/rules/style_impersonal_rule.rb +35 -0
- data/lib/metanorma/iso/validation/rules/style_imprecise_refs_rule.rb +37 -0
- data/lib/metanorma/iso/validation/rules/style_in_accordance_rule.rb +69 -0
- data/lib/metanorma/iso/validation/rules/style_inclusive_language_rule.rb +67 -0
- data/lib/metanorma/iso/validation/rules/style_informative_normative_rule.rb +39 -0
- data/lib/metanorma/iso/validation/rules/style_interlab_rule.rb +29 -0
- data/lib/metanorma/iso/validation/rules/style_iso_dates_rule.rb +67 -0
- data/lib/metanorma/iso/validation/rules/style_latin_plurals_rule.rb +62 -0
- data/lib/metanorma/iso/validation/rules/style_mixed_lists_rule.rb +68 -0
- data/lib/metanorma/iso/validation/rules/style_nested_parens_rule.rb +75 -0
- data/lib/metanorma/iso/validation/rules/style_no_boxes_rule.rb +50 -0
- data/lib/metanorma/iso/validation/rules/style_no_nos_rule.rb +37 -0
- data/lib/metanorma/iso/validation/rules/style_non_si_order_rule.rb +129 -0
- data/lib/metanorma/iso/validation/rules/style_number_rule.rb +28 -4
- data/lib/metanorma/iso/validation/rules/style_ordinals_rule.rb +29 -0
- data/lib/metanorma/iso/validation/rules/style_oxford_spelling_rule.rb +156 -0
- data/lib/metanorma/iso/validation/rules/style_penultimate_list_rule.rb +69 -0
- data/lib/metanorma/iso/validation/rules/style_per_cent_rule.rb +30 -0
- data/lib/metanorma/iso/validation/rules/style_plural_s_term_rule.rb +31 -0
- data/lib/metanorma/iso/validation/rules/style_quotation_punctuation_rule.rb +52 -0
- data/lib/metanorma/iso/validation/rules/style_respectively_rule.rb +58 -0
- data/lib/metanorma/iso/validation/rules/style_rule.rb +18 -6
- data/lib/metanorma/iso/validation/rules/style_self_reference_rule.rb +34 -0
- data/lib/metanorma/iso/validation/rules/style_sentence_start_number_rule.rb +62 -0
- data/lib/metanorma/iso/validation/rules/style_stem_symbol_rule.rb +283 -0
- data/lib/metanorma/iso/validation/rules/style_that_which_rule.rb +70 -0
- data/lib/metanorma/iso/validation/rules/style_units_rule.rb +7 -0
- data/lib/metanorma/iso/validation/rules/style_vague_time_rule.rb +42 -0
- data/lib/metanorma/iso/validation/rules/style_verbal_forms_rule.rb +37 -0
- data/lib/metanorma/iso/validation/rules/style_vocab_title_rule.rb +97 -0
- data/lib/metanorma/iso/validation/rules/style_wikipedia_rule.rb +55 -0
- data/lib/metanorma/iso/validation/rules/style_words_digits_rule.rb +168 -0
- data/lib/metanorma/iso/validation/rules/subcommittee_type_rule.rb +5 -0
- data/lib/metanorma/iso/validation/rules/subpart_iec_rule.rb +5 -0
- data/lib/metanorma/iso/validation/rules/symbols_in_annex_rule.rb +4 -0
- data/lib/metanorma/iso/validation/rules/symbols_section_content_rule.rb +5 -0
- data/lib/metanorma/iso/validation/rules/symbols_section_count_rule.rb +5 -0
- data/lib/metanorma/iso/validation/rules/technical_committee_type_rule.rb +5 -0
- data/lib/metanorma/iso/validation/rules/term_source_complete_rule.rb +117 -0
- data/lib/metanorma/iso/validation/rules/term_xrefs_rule.rb +6 -1
- data/lib/metanorma/iso/validation/rules/termdef_style_rule.rb +38 -11
- data/lib/metanorma/iso/validation/rules/terms_presence_rule.rb +5 -0
- data/lib/metanorma/iso/validation/rules/title_first_level_rule.rb +5 -0
- data/lib/metanorma/iso/validation/rules/title_names_doctype_rule.rb +5 -0
- data/lib/metanorma/iso/validation/rules/title_pairing_rule.rb +5 -0
- data/lib/metanorma/iso/validation/rules/title_siblings_consistency_rule.rb +5 -0
- data/lib/metanorma/iso/validation/rules/tree_traversal.rb +90 -9
- data/lib/metanorma/iso/validation/rules/unique_id_rule.rb +9 -4
- data/lib/metanorma/iso/validation/rules/unreferenced_assets_rule.rb +8 -3
- data/lib/metanorma/iso/validation/rules/vocab_terms_titles_rule.rb +4 -0
- data/lib/metanorma/iso/validation/rules.rb +154 -2
- data/lib/metanorma/iso/validation/sentence_scan.rb +159 -0
- data/lib/metanorma/iso/validation/walk_cache.rb +81 -0
- data/lib/metanorma/iso/validation.rb +7 -0
- data/lib/metanorma/iso/validation_policy/metanorma.yml +268 -0
- data/lib/metanorma/iso/version.rb +1 -1
- data/lib/tasks/docx_parity.rake +42 -0
- data/metanorma-iso.gemspec +2 -1
- metadata +111 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 4cb19df1ed23c40d1f49351a7db560dadcc1305392ea6dd2962833848e2ebfec
|
|
4
|
+
data.tar.gz: 496d0be723e36f00267a197cf8315f118568fc36dcf1d6b0e22e4ed8f8f04134
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4e2e4af7d68ed9bb325d1382fd27421fab45c2a0995737ee77d1401a5160210d4600ad24b040503f3e193f1c1d51ef2ca9bfbb1838076d51b24465f36159fb69
|
|
7
|
+
data.tar.gz: d9049780c92eae394019a6014d982fcbd510733d1ac8a17c216d5b8f2e5b7036039be406d3edb857bb9646fe08750ca1478d3bcf1a846934cf54cbdce655f74b
|
data/.gitignore
CHANGED
data/.rubocop.yml
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
# Auto-generated by Cimas: Do not edit it manually!
|
|
2
2
|
# See https://github.com/metanorma/cimas
|
|
3
3
|
inherit_from:
|
|
4
|
-
- .rubocop_todo.yml
|
|
5
4
|
- https://raw.githubusercontent.com/riboseinc/oss-guides/main/ci/rubocop.yml
|
|
6
5
|
# .rubocop_todo.yml MUST be the last entry. inherit_from is last-wins:
|
|
7
6
|
# if listed before oss-guides, the shared config's stricter Metrics/
|
data/Gemfile
CHANGED
|
@@ -15,6 +15,8 @@ gem "rake"
|
|
|
15
15
|
gem "rspec"
|
|
16
16
|
gem "rubocop"
|
|
17
17
|
gem "rubocop-performance"
|
|
18
|
+
gem "rubocop-rspec"
|
|
19
|
+
gem "rubocop-rake"
|
|
18
20
|
gem "simplecov"
|
|
19
21
|
gem "timecop"
|
|
20
22
|
gem "webmock"
|
|
@@ -23,6 +25,6 @@ gem "lutaml-model", "~> 0.8"
|
|
|
23
25
|
# html2doc >= 1.12 is required for correct OMML math handling in Word output
|
|
24
26
|
# (isodoc main also pins ~> 1.12).
|
|
25
27
|
gem "html2doc", "~> 1.12.0"
|
|
26
|
-
gem "omml", "~> 0.2.
|
|
28
|
+
gem "omml", "~> 0.2.11" # 0.2.7+ carries the moxml-0.6 range (omml => moxml ~> 0.6.1)
|
|
27
29
|
|
|
28
30
|
eval_gemfile("Gemfile.devel") rescue nil
|
data/data/iso-dis/styles.yml
CHANGED
|
@@ -18,8 +18,9 @@ style_library:
|
|
|
18
18
|
unhide_when_used: false
|
|
19
19
|
paragraph_properties:
|
|
20
20
|
spacing:
|
|
21
|
-
after: '
|
|
22
|
-
line: '
|
|
21
|
+
after: '160'
|
|
22
|
+
line: '249'
|
|
23
|
+
line_rule: 'exact'
|
|
23
24
|
alignment: both
|
|
24
25
|
keep_next: false
|
|
25
26
|
keep_lines: false
|
|
@@ -51,8 +52,10 @@ style_library:
|
|
|
51
52
|
numbering:
|
|
52
53
|
num_id: '4'
|
|
53
54
|
spacing:
|
|
54
|
-
before: '
|
|
55
|
-
|
|
55
|
+
before: '360'
|
|
56
|
+
after: '160'
|
|
57
|
+
line: '312'
|
|
58
|
+
line_rule: 'exact'
|
|
56
59
|
indent:
|
|
57
60
|
left: '0'
|
|
58
61
|
firstLine: '0'
|
|
@@ -89,8 +92,10 @@ style_library:
|
|
|
89
92
|
numbering:
|
|
90
93
|
ilvl: '1'
|
|
91
94
|
spacing:
|
|
92
|
-
before: '
|
|
93
|
-
|
|
95
|
+
before: '240'
|
|
96
|
+
after: '160'
|
|
97
|
+
line: '312'
|
|
98
|
+
line_rule: 'exact'
|
|
94
99
|
indent:
|
|
95
100
|
left: '0'
|
|
96
101
|
firstLine: '0'
|
|
@@ -127,8 +132,10 @@ style_library:
|
|
|
127
132
|
numbering:
|
|
128
133
|
ilvl: '2'
|
|
129
134
|
spacing:
|
|
130
|
-
before: '
|
|
131
|
-
|
|
135
|
+
before: '280'
|
|
136
|
+
after: '180'
|
|
137
|
+
line: '288'
|
|
138
|
+
line_rule: 'exact'
|
|
132
139
|
indent:
|
|
133
140
|
left: '0'
|
|
134
141
|
firstLine: '0'
|
|
@@ -160,6 +167,11 @@ style_library:
|
|
|
160
167
|
semi_hidden: false
|
|
161
168
|
unhide_when_used: false
|
|
162
169
|
paragraph_properties:
|
|
170
|
+
spacing:
|
|
171
|
+
before: '60'
|
|
172
|
+
after: '160'
|
|
173
|
+
line: '288'
|
|
174
|
+
line_rule: 'exact'
|
|
163
175
|
numbering:
|
|
164
176
|
ilvl: '3'
|
|
165
177
|
indent:
|
|
@@ -189,6 +201,11 @@ style_library:
|
|
|
189
201
|
semi_hidden: false
|
|
190
202
|
unhide_when_used: false
|
|
191
203
|
paragraph_properties:
|
|
204
|
+
spacing:
|
|
205
|
+
before: '60'
|
|
206
|
+
after: '160'
|
|
207
|
+
line: '288'
|
|
208
|
+
line_rule: 'exact'
|
|
192
209
|
numbering:
|
|
193
210
|
ilvl: '4'
|
|
194
211
|
indent:
|
|
@@ -216,6 +233,11 @@ style_library:
|
|
|
216
233
|
semi_hidden: false
|
|
217
234
|
unhide_when_used: false
|
|
218
235
|
paragraph_properties:
|
|
236
|
+
spacing:
|
|
237
|
+
before: '60'
|
|
238
|
+
after: '160'
|
|
239
|
+
line: '288'
|
|
240
|
+
line_rule: 'exact'
|
|
219
241
|
numbering:
|
|
220
242
|
ilvl: '5'
|
|
221
243
|
outline_level: '5'
|
|
@@ -570,8 +592,9 @@ style_library:
|
|
|
570
592
|
unhide_when_used: false
|
|
571
593
|
paragraph_properties:
|
|
572
594
|
spacing:
|
|
573
|
-
after: '
|
|
574
|
-
line: '
|
|
595
|
+
after: '160'
|
|
596
|
+
line: '312'
|
|
597
|
+
line_rule: 'exact'
|
|
575
598
|
outline_level: '0'
|
|
576
599
|
keep_next: false
|
|
577
600
|
keep_lines: false
|
|
@@ -598,8 +621,9 @@ style_library:
|
|
|
598
621
|
unhide_when_used: false
|
|
599
622
|
paragraph_properties:
|
|
600
623
|
spacing:
|
|
601
|
-
after: '
|
|
602
|
-
line: '
|
|
624
|
+
after: '160'
|
|
625
|
+
line: '249'
|
|
626
|
+
line_rule: 'exact'
|
|
603
627
|
alignment: both
|
|
604
628
|
keep_next: false
|
|
605
629
|
keep_lines: false
|
|
@@ -1256,7 +1280,10 @@ style_library:
|
|
|
1256
1280
|
unhide_when_used: false
|
|
1257
1281
|
paragraph_properties:
|
|
1258
1282
|
spacing:
|
|
1259
|
-
|
|
1283
|
+
before: '0'
|
|
1284
|
+
after: '160'
|
|
1285
|
+
line: '240'
|
|
1286
|
+
line_rule: 'exact'
|
|
1260
1287
|
tabs:
|
|
1261
1288
|
- type: left
|
|
1262
1289
|
position: '1354'
|
|
@@ -1286,8 +1313,14 @@ style_library:
|
|
|
1286
1313
|
semi_hidden: false
|
|
1287
1314
|
unhide_when_used: false
|
|
1288
1315
|
paragraph_properties:
|
|
1316
|
+
spacing:
|
|
1317
|
+
before: '0'
|
|
1318
|
+
after: '160'
|
|
1319
|
+
line: '240'
|
|
1320
|
+
line_rule: 'exact'
|
|
1289
1321
|
indent:
|
|
1290
|
-
left: '
|
|
1322
|
+
left: '397'
|
|
1323
|
+
right: '397'
|
|
1291
1324
|
tabs:
|
|
1292
1325
|
- type: clear
|
|
1293
1326
|
position: '1354'
|
|
@@ -1304,6 +1337,12 @@ style_library:
|
|
|
1304
1337
|
hidden: false
|
|
1305
1338
|
semi_hidden: false
|
|
1306
1339
|
unhide_when_used: false
|
|
1340
|
+
paragraph_properties:
|
|
1341
|
+
spacing:
|
|
1342
|
+
before: '0'
|
|
1343
|
+
after: '160'
|
|
1344
|
+
line: '240'
|
|
1345
|
+
line_rule: 'exact'
|
|
1307
1346
|
Figureexample:
|
|
1308
1347
|
id: Figureexample
|
|
1309
1348
|
type: paragraph
|
|
@@ -1338,7 +1377,10 @@ style_library:
|
|
|
1338
1377
|
unhide_when_used: false
|
|
1339
1378
|
paragraph_properties:
|
|
1340
1379
|
spacing:
|
|
1341
|
-
|
|
1380
|
+
before: '0'
|
|
1381
|
+
after: '240'
|
|
1382
|
+
line: '240'
|
|
1383
|
+
line_rule: 'exact'
|
|
1342
1384
|
tabs:
|
|
1343
1385
|
- type: left
|
|
1344
1386
|
position: '965'
|
|
@@ -2176,8 +2218,11 @@ style_library:
|
|
|
2176
2218
|
semi_hidden: false
|
|
2177
2219
|
unhide_when_used: false
|
|
2178
2220
|
paragraph_properties:
|
|
2179
|
-
|
|
2180
|
-
|
|
2221
|
+
spacing:
|
|
2222
|
+
before: '0'
|
|
2223
|
+
after: '240'
|
|
2224
|
+
line: '240'
|
|
2225
|
+
line_rule: 'exact'
|
|
2181
2226
|
tabs:
|
|
2182
2227
|
- type: clear
|
|
2183
2228
|
position: '965'
|
|
@@ -2195,6 +2240,12 @@ style_library:
|
|
|
2195
2240
|
hidden: false
|
|
2196
2241
|
semi_hidden: false
|
|
2197
2242
|
unhide_when_used: false
|
|
2243
|
+
paragraph_properties:
|
|
2244
|
+
spacing:
|
|
2245
|
+
before: '0'
|
|
2246
|
+
after: '240'
|
|
2247
|
+
line: '240'
|
|
2248
|
+
line_rule: 'exact'
|
|
2198
2249
|
MainTitle1:
|
|
2199
2250
|
id: MainTitle1
|
|
2200
2251
|
type: paragraph
|
|
@@ -2205,7 +2256,8 @@ style_library:
|
|
|
2205
2256
|
unhide_when_used: false
|
|
2206
2257
|
paragraph_properties:
|
|
2207
2258
|
spacing:
|
|
2208
|
-
|
|
2259
|
+
line: '240'
|
|
2260
|
+
line_rule: 'auto'
|
|
2209
2261
|
keep_next: false
|
|
2210
2262
|
keep_lines: false
|
|
2211
2263
|
page_break_before: false
|
|
@@ -2224,6 +2276,9 @@ style_library:
|
|
|
2224
2276
|
semi_hidden: false
|
|
2225
2277
|
unhide_when_used: false
|
|
2226
2278
|
paragraph_properties:
|
|
2279
|
+
spacing:
|
|
2280
|
+
line: '240'
|
|
2281
|
+
line_rule: 'auto'
|
|
2227
2282
|
outline_level: '1'
|
|
2228
2283
|
keep_next: false
|
|
2229
2284
|
keep_lines: false
|
|
@@ -2243,6 +2298,9 @@ style_library:
|
|
|
2243
2298
|
semi_hidden: false
|
|
2244
2299
|
unhide_when_used: false
|
|
2245
2300
|
paragraph_properties:
|
|
2301
|
+
spacing:
|
|
2302
|
+
line: '240'
|
|
2303
|
+
line_rule: 'auto'
|
|
2246
2304
|
outline_level: '2'
|
|
2247
2305
|
keep_next: false
|
|
2248
2306
|
keep_lines: false
|
|
@@ -2620,6 +2678,9 @@ style_library:
|
|
|
2620
2678
|
semi_hidden: false
|
|
2621
2679
|
unhide_when_used: false
|
|
2622
2680
|
paragraph_properties:
|
|
2681
|
+
spacing:
|
|
2682
|
+
line: '240'
|
|
2683
|
+
line_rule: 'auto'
|
|
2623
2684
|
keep_next: false
|
|
2624
2685
|
keep_lines: false
|
|
2625
2686
|
page_break_before: false
|
|
@@ -2670,6 +2731,9 @@ style_library:
|
|
|
2670
2731
|
semi_hidden: false
|
|
2671
2732
|
unhide_when_used: false
|
|
2672
2733
|
paragraph_properties:
|
|
2734
|
+
spacing:
|
|
2735
|
+
line: '240'
|
|
2736
|
+
line_rule: 'auto'
|
|
2673
2737
|
alignment: right
|
|
2674
2738
|
keep_next: false
|
|
2675
2739
|
keep_lines: false
|
|
@@ -2735,7 +2799,8 @@ style_library:
|
|
|
2735
2799
|
unhide_when_used: false
|
|
2736
2800
|
paragraph_properties:
|
|
2737
2801
|
spacing:
|
|
2738
|
-
|
|
2802
|
+
line: '240'
|
|
2803
|
+
line_rule: 'auto'
|
|
2739
2804
|
alignment: center
|
|
2740
2805
|
keep_next: false
|
|
2741
2806
|
keep_lines: false
|
|
@@ -2758,7 +2823,8 @@ style_library:
|
|
|
2758
2823
|
unhide_when_used: false
|
|
2759
2824
|
paragraph_properties:
|
|
2760
2825
|
spacing:
|
|
2761
|
-
|
|
2826
|
+
line: '240'
|
|
2827
|
+
line_rule: 'auto'
|
|
2762
2828
|
indent:
|
|
2763
2829
|
left: '85'
|
|
2764
2830
|
right: '85'
|
|
@@ -2783,7 +2849,8 @@ style_library:
|
|
|
2783
2849
|
unhide_when_used: false
|
|
2784
2850
|
paragraph_properties:
|
|
2785
2851
|
spacing:
|
|
2786
|
-
|
|
2852
|
+
line: '240'
|
|
2853
|
+
line_rule: 'auto'
|
|
2787
2854
|
indent:
|
|
2788
2855
|
left: '85'
|
|
2789
2856
|
right: '85'
|
|
@@ -2926,16 +2993,14 @@ style_library:
|
|
|
2926
2993
|
hanging: '720'
|
|
2927
2994
|
alignment: left
|
|
2928
2995
|
tabs:
|
|
2929
|
-
- type: left
|
|
2930
|
-
position: '720'
|
|
2931
2996
|
- type: right
|
|
2932
|
-
position: '
|
|
2997
|
+
position: '9704'
|
|
2933
2998
|
leader: dot
|
|
2934
2999
|
keep_next: false
|
|
2935
3000
|
keep_lines: false
|
|
2936
3001
|
page_break_before: false
|
|
2937
3002
|
run_properties:
|
|
2938
|
-
bold:
|
|
3003
|
+
bold: false
|
|
2939
3004
|
italic: false
|
|
2940
3005
|
small_caps: false
|
|
2941
3006
|
all_caps: false
|
|
@@ -3513,8 +3578,16 @@ style_library:
|
|
|
3513
3578
|
semi_hidden: false
|
|
3514
3579
|
unhide_when_used: false
|
|
3515
3580
|
paragraph_properties:
|
|
3581
|
+
tabs:
|
|
3582
|
+
- type: right
|
|
3583
|
+
position: '9704'
|
|
3584
|
+
leader: dot
|
|
3516
3585
|
spacing:
|
|
3517
3586
|
before: '0'
|
|
3587
|
+
indent:
|
|
3588
|
+
left: '1080'
|
|
3589
|
+
right: '500'
|
|
3590
|
+
hanging: '360'
|
|
3518
3591
|
keep_next: false
|
|
3519
3592
|
keep_lines: false
|
|
3520
3593
|
page_break_before: false
|
|
@@ -3528,6 +3601,18 @@ style_library:
|
|
|
3528
3601
|
hidden: false
|
|
3529
3602
|
semi_hidden: true
|
|
3530
3603
|
unhide_when_used: false
|
|
3604
|
+
paragraph_properties:
|
|
3605
|
+
tabs:
|
|
3606
|
+
- type: right
|
|
3607
|
+
position: '9704'
|
|
3608
|
+
leader: dot
|
|
3609
|
+
indent:
|
|
3610
|
+
left: '1440'
|
|
3611
|
+
right: '500'
|
|
3612
|
+
hanging: '360'
|
|
3613
|
+
keep_next: false
|
|
3614
|
+
keep_lines: false
|
|
3615
|
+
page_break_before: false
|
|
3531
3616
|
TOC4:
|
|
3532
3617
|
id: TOC4
|
|
3533
3618
|
type: paragraph
|
data/data/iso-dis/template.docx
CHANGED
|
Binary file
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# ISO Simple document metadata
|
|
2
|
+
#
|
|
3
|
+
# Values come from data/iso-dis/document_metadata.yml: ISO stage and doctype
|
|
4
|
+
# codes do not depend on the template. The Simple template has no reference
|
|
5
|
+
# DOCX to extract them from.
|
|
6
|
+
#
|
|
7
|
+
# Loaded by: IsoDoc::Iso::Docx::DocumentProperties
|
|
8
|
+
|
|
9
|
+
doctype_abbreviations:
|
|
10
|
+
international-standard: IS
|
|
11
|
+
technical-specification: TS
|
|
12
|
+
technical-report: TR
|
|
13
|
+
publicly-available-specification: PAS
|
|
14
|
+
international-workshop-agreement: IWA
|
|
15
|
+
guide: Guide
|
|
16
|
+
amendment: AMD
|
|
17
|
+
technical-corrigendum: COR
|
|
18
|
+
|
|
19
|
+
stage_abbreviations:
|
|
20
|
+
# Note: DocumentProperties.release_version buckets the stage value via
|
|
21
|
+
# `stage / 10 * 10`, so only decile-bucketed entries (0, 10, ..., 60, 90)
|
|
22
|
+
# are reachable through lookup. The 95 => "COR" entry is preserved for
|
|
23
|
+
# documentation — it reflects the ISO stage code for technical
|
|
24
|
+
# corrigenda, but is unreachable because stage 95 buckets to 90 ("AMD").
|
|
25
|
+
0: PWI
|
|
26
|
+
10: NP
|
|
27
|
+
20: WD
|
|
28
|
+
30: CD
|
|
29
|
+
40: DIS
|
|
30
|
+
50: FDIS
|
|
31
|
+
60: IS
|
|
32
|
+
90: AMD
|
|
33
|
+
95: COR
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
# Flavor and taste validation baselines
|
|
2
|
+
|
|
3
|
+
A validation baseline is a data file that a flavour or a taste gem ships,
|
|
4
|
+
declaring the default severity of every validation rule code the flavour
|
|
5
|
+
emits. The declarative suppression mechanism
|
|
6
|
+
(metanorma/metanorma-standoc#1369) reads the baseline as the flavour layer
|
|
7
|
+
of its resolution chain; documents and tastes override it per rule code.
|
|
8
|
+
This page documents the format, the discovery paths, the ownership rules
|
|
9
|
+
and the generation of the baseline that metanorma-iso ships.
|
|
10
|
+
|
|
11
|
+
Per the conform-profile ownership ruling, the owner of the policy declares
|
|
12
|
+
what is active: flavours and tastes own their baselines, and the engine
|
|
13
|
+
never dictates policy to them.
|
|
14
|
+
|
|
15
|
+
## Format
|
|
16
|
+
|
|
17
|
+
The baseline lives at `lib/metanorma/<flavor>/validation_policy/metanorma.yml`
|
|
18
|
+
inside the flavour gem. The schema is `metanorma-validation-suppression/1`
|
|
19
|
+
and is frozen for the v1 mechanism, which is type-only: each rule code
|
|
20
|
+
carries a single `severity` action, and the vocabulary is `off`, `info`,
|
|
21
|
+
`warning` and `error`.
|
|
22
|
+
|
|
23
|
+
```yaml
|
|
24
|
+
schema: metanorma-validation-suppression/1
|
|
25
|
+
flavor: iso
|
|
26
|
+
rules:
|
|
27
|
+
ISO_21:
|
|
28
|
+
severity: warning
|
|
29
|
+
STANDOC_48:
|
|
30
|
+
severity: error
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
The `flavor` key names the flavour the file belongs to. The default state
|
|
34
|
+
of a flavour is declared explicitly rather than left implicit: the
|
|
35
|
+
metanorma-iso baseline places every code at its natural registry severity,
|
|
36
|
+
so the flavour suppresses nothing and downstream layers have a declared
|
|
37
|
+
starting point to deviate from.
|
|
38
|
+
|
|
39
|
+
## Discovery
|
|
40
|
+
|
|
41
|
+
The engine discovers the flavour baseline through
|
|
42
|
+
`Gem::Specification.find_by_name("metanorma-<flavor>")`, reading
|
|
43
|
+
`lib/metanorma/<flavor>/validation_policy/metanorma.yml` from the resolved
|
|
44
|
+
gem. This is the same discovery pattern as the `<type>_conform_profile/`
|
|
45
|
+
directories.
|
|
46
|
+
|
|
47
|
+
A taste layer applies on top of the flavour baseline when a taste is
|
|
48
|
+
active. The taste baseline lives at the same relative path inside the taste
|
|
49
|
+
gem (`metanorma-taste-<name>`, or a taste gem such as metanorma-pdfa), and
|
|
50
|
+
the taste becomes active through the document `:taste:` attribute, the
|
|
51
|
+
`METANORMA_TASTE` environment variable or the CLI taste selection. A
|
|
52
|
+
document that activates no taste resolves only the flavour and document
|
|
53
|
+
layers.
|
|
54
|
+
|
|
55
|
+
## Override precedence
|
|
56
|
+
|
|
57
|
+
The resolution order, from weakest to strongest, is:
|
|
58
|
+
|
|
59
|
+
1. engine default — every rule at its registered severity;
|
|
60
|
+
2. flavour baseline — `validation_policy/metanorma.yml` in the flavour gem;
|
|
61
|
+
3. taste overlay — `validation_policy/metanorma.yml` in the active taste
|
|
62
|
+
gem;
|
|
63
|
+
4. document configuration — `:validation-config:` and the
|
|
64
|
+
`:validation-off:` / `:validation-warning:` attributes.
|
|
65
|
+
|
|
66
|
+
Each layer overrides the previous one per rule code, and inline anchors
|
|
67
|
+
take the position above the document layer when the mechanism's second
|
|
68
|
+
phase lands. The resolved effective configuration is dumped into the log
|
|
69
|
+
with every conversion.
|
|
70
|
+
|
|
71
|
+
## Generation from rule metadata
|
|
72
|
+
|
|
73
|
+
The metanorma-iso baseline is generated, not hand-written. The source of
|
|
74
|
+
truth is the rule metadata of the validation-policy generator
|
|
75
|
+
(metanorma/metanorma-iso#1709): the `code` and `policy` declarations on the
|
|
76
|
+
rule classes discovered by `Metanorma::Iso::Validation::RuleRegistry`, and
|
|
77
|
+
the `LEGACY_POLICY` sidecar of the legacy checks. `Metanorma::Iso::Validation::PolicyDoc.baseline_yaml`
|
|
78
|
+
renders the file, ordering the entries in the canonical policy order (model
|
|
79
|
+
rules by class name, then the legacy sidecar order) and resolving each
|
|
80
|
+
severity from the ISO and standoc log registries. A code that neither
|
|
81
|
+
registry knows takes the registry default, `severity: error`, which the
|
|
82
|
+
file header documents.
|
|
83
|
+
|
|
84
|
+
The regeneration command is documented in the file header:
|
|
85
|
+
|
|
86
|
+
```
|
|
87
|
+
bundle exec ruby -I lib -r metanorma-iso \
|
|
88
|
+
-e 'puts Metanorma::Iso::Validation::PolicyDoc.baseline_yaml' \
|
|
89
|
+
> lib/metanorma/iso/validation_policy/metanorma.yml
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
Two specifications keep the shipped file honest:
|
|
93
|
+
`spec/metanorma/validation/validation_baseline_spec.rb` fails when the
|
|
94
|
+
committed file differs from what `baseline_yaml` generates, and its
|
|
95
|
+
coverage checks are bidirectional, so a new rule without a baseline entry,
|
|
96
|
+
or a baseline entry without a rule, fails the suite. Adding a rule to the
|
|
97
|
+
flavour is therefore followed by one regeneration, and the baseline never
|
|
98
|
+
silently misses a rule.
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
# Validation rule kinds
|
|
2
|
+
|
|
3
|
+
A validation finding reaches the document through one of four
|
|
4
|
+
implementation kinds. The kinds matter to the rule author, who implements
|
|
5
|
+
one of them; they do not matter to the document author, because suppression
|
|
6
|
+
matches the emission of a finding — its rule code — and never its
|
|
7
|
+
implementation. The suppression configuration keys are log codes, so one
|
|
8
|
+
vocabulary covers all four kinds, and an author silencing `ISO_39` does not
|
|
9
|
+
need to know which kind emits it.
|
|
10
|
+
|
|
11
|
+
This page describes the four kinds as implemented in the metanorma-iso
|
|
12
|
+
flavour, how each kind emits, and why the code is the interface that
|
|
13
|
+
suppression relies on.
|
|
14
|
+
|
|
15
|
+
## The four kinds
|
|
16
|
+
|
|
17
|
+
### Model-traversal rules
|
|
18
|
+
|
|
19
|
+
Model-traversal rules are `Metanorma::Iso::Validation::Rules::Base`
|
|
20
|
+
subclasses in `lib/metanorma/iso/validation/rules/`. A rule declares its
|
|
21
|
+
log key with `code "ISO_N"`, walks the Lutaml document model — often
|
|
22
|
+
through the `TreeTraversal` helpers — and returns an array of issues built
|
|
23
|
+
by `build_issue`, each carrying the code, the model location and the
|
|
24
|
+
message parameters. The registry
|
|
25
|
+
(`Metanorma::Iso::Validation::RuleRegistry`) discovers every concrete rule
|
|
26
|
+
class automatically, so a new rule file plus one autoload line is the whole
|
|
27
|
+
registration.
|
|
28
|
+
|
|
29
|
+
### Legacy regex checks
|
|
30
|
+
|
|
31
|
+
Legacy regex checks are the `LegacyChecks` methods in
|
|
32
|
+
`lib/metanorma/iso/validate.rb`, which test extracted text against regular
|
|
33
|
+
expressions and report through the shared log. Most of them share the
|
|
34
|
+
generic style-warning sink `STANDOC_48`. Their policy metadata lives in the
|
|
35
|
+
`LEGACY_POLICY` sidecar until they migrate into rule classes, and the
|
|
36
|
+
coverage specification `legacy_policy_spec` keeps the sidecar complete
|
|
37
|
+
against the source.
|
|
38
|
+
|
|
39
|
+
### Structural walkers
|
|
40
|
+
|
|
41
|
+
Structural walkers traverse the document order rather than single nodes:
|
|
42
|
+
the section-sequence check, the term-ordering and cross-reference-family
|
|
43
|
+
checks, and the unreferenced-asset sweep all walk ordered structures and
|
|
44
|
+
emit one finding per misplaced or unreferenced element, each under the
|
|
45
|
+
element's own code.
|
|
46
|
+
|
|
47
|
+
### Engine-profile verdicts
|
|
48
|
+
|
|
49
|
+
Engine-profile verdicts are the results reported by the conformance
|
|
50
|
+
engines, `svg_conform` and `png_conform`. These profiles own their policy
|
|
51
|
+
and their reporting, and their verdicts are not part of the suppression
|
|
52
|
+
configuration: a document does not silence them through
|
|
53
|
+
`metanorma-validation-suppression` files, in the same way that the
|
|
54
|
+
conform-profile ownership ruling keeps profile policy with the profile.
|
|
55
|
+
|
|
56
|
+
## How a finding is emitted
|
|
57
|
+
|
|
58
|
+
Every kind funnels into the shared log with the same anatomy: a rule code
|
|
59
|
+
(`ISO_N` or `STANDOC_N`), a severity, a category, a message template and an
|
|
60
|
+
element or location label. The code is registered in a log registry —
|
|
61
|
+
`ISO_LOG_MESSAGES` in `lib/metanorma/iso/log.rb`, `STANDOC_LOG_MESSAGES` in
|
|
62
|
+
metanorma-standoc — which holds the category, the message template and the
|
|
63
|
+
numeric severity (0 for aborts and 2 for serious findings map to `error`, 1
|
|
64
|
+
to `warning`, 3 to `info`). The registries are the single source of
|
|
65
|
+
severity: the rule classes read them, the policy page renders them, and the
|
|
66
|
+
flavour baseline carries them forward as declared defaults.
|
|
67
|
+
|
|
68
|
+
## Why suppression matches the emission
|
|
69
|
+
|
|
70
|
+
Because every kind emits through the shared log under a code, the
|
|
71
|
+
suppression filter of the log intercepts all kinds uniformly, and the
|
|
72
|
+
document-facing vocabulary stays implementation-free. The policy metadata
|
|
73
|
+
DSL (`policy` and `directives` on `Rules::Base`) documents each rule's
|
|
74
|
+
category, cited wording and functional tag; the generator
|
|
75
|
+
(`Metanorma::Iso::Validation::PolicyDoc`) renders it into the
|
|
76
|
+
validation-policy page and into the flavour baseline; and the coverage
|
|
77
|
+
specifications — `policy_metadata_spec`, `legacy_policy_spec`,
|
|
78
|
+
`policy_doc_spec` and `validation_baseline_spec` — enforce that a rule
|
|
79
|
+
declared, a rule documented and a baseline entry shipped are the same set
|
|
80
|
+
of codes.
|