metanorma-iso 3.5.35 → 3.5.36
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/lib/isodoc/iso/docx/cover_renderer.rb +6 -2
- data/lib/metanorma/iso/cleanup.rb +16 -0
- data/lib/metanorma/iso/document/metadata/iso_bibliographic_item.rb +20 -4
- data/lib/metanorma/iso/html/renderer.rb +8 -1
- data/lib/metanorma/iso/sts/transformer/list_transformer.rb +14 -0
- data/lib/metanorma/iso/sts/validation_report.rb +2 -0
- data/lib/metanorma/iso/themes/iso/custom.css +261 -0
- data/lib/metanorma/iso/themes/iso/theme.yaml +69 -23
- data/lib/metanorma/iso/themes/iso-legacy/theme.yaml +69 -0
- data/lib/metanorma/iso/version.rb +1 -1
- data/metanorma-iso.gemspec +2 -1
- metadata +4 -3
- data/CLAUDE.md +0 -119
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b4f5efea7eb0e58f9eab14cc23a339287f60fe50b66946dc78f6c732a3ec5bd8
|
|
4
|
+
data.tar.gz: 3ce1e209d56f15dfc257e730ec484f5709fa6fb35cc14f35acde330482fa474a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a114759821b625e93702ea367449438e8d28e5ed6cdf4e03c17018ec4a1dd0fb7a95cf6944b54d2d86a503b127097103c3d7b8a0f9acb6faefd11b58ad2388e5
|
|
7
|
+
data.tar.gz: 251c73d110f00bb1822102fcc2943f1c55cfc84b4c8d6460d997639240501f47120aa532784fd6a91f2341ed55436752f6de3ca70b0111434eeee9cd2e2b6216
|
|
@@ -232,7 +232,11 @@ module IsoDoc
|
|
|
232
232
|
draft = extract_draft(bib)
|
|
233
233
|
return nil unless draft
|
|
234
234
|
|
|
235
|
-
" (
|
|
235
|
+
" (#{draft_word(bib)} #{draft})"
|
|
236
|
+
end
|
|
237
|
+
|
|
238
|
+
def draft_word(bib)
|
|
239
|
+
bib.respond_to?(:draft_label) ? bib.draft_label : "draft"
|
|
236
240
|
end
|
|
237
241
|
|
|
238
242
|
def extract_draft(bib)
|
|
@@ -410,7 +414,7 @@ module IsoDoc
|
|
|
410
414
|
return nil if id_text.nil? || id_text.empty?
|
|
411
415
|
|
|
412
416
|
draft_date = extract_draft_date(bib)
|
|
413
|
-
id_text + (draft_date ? " (
|
|
417
|
+
id_text + (draft_date ? " (#{draft_word(bib)} #{draft_date})" : "")
|
|
414
418
|
end
|
|
415
419
|
|
|
416
420
|
# Cover-large line: primary identifier with language tag, e.g.
|
|
@@ -7,6 +7,22 @@ module Metanorma
|
|
|
7
7
|
super + %i[amd vocab]
|
|
8
8
|
end
|
|
9
9
|
|
|
10
|
+
def cleanup(xmldoc)
|
|
11
|
+
super
|
|
12
|
+
example_collapsible_cleanup(xmldoc)
|
|
13
|
+
xmldoc
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
# ISO deliverables are print-oriented: the %collapsible example
|
|
17
|
+
# option exists for interactive HTML in the source flavor, and its
|
|
18
|
+
# <details> structure leaks confusingly into ISO DOCX/PDF
|
|
19
|
+
# (metanorma-iso#1920, metanorma-pdfa#117).
|
|
20
|
+
def example_collapsible_cleanup(xmldoc)
|
|
21
|
+
xmldoc.xpath("//example[@collapsible = 'true']").each do |x|
|
|
22
|
+
x.delete("collapsible")
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
|
|
10
26
|
PRE_NORMREF_FOOTNOTES = "//preface//fn | " \
|
|
11
27
|
"//clause[@type = 'scope']//fn".freeze
|
|
12
28
|
|
|
@@ -57,10 +57,13 @@ module Metanorma
|
|
|
57
57
|
ext&.stagename&.abbreviation.to_s
|
|
58
58
|
end
|
|
59
59
|
|
|
60
|
+
# isodoc parity: the cover "Date:" is the version revision-date,
|
|
61
|
+
# else the "updated" date. Published/created dates are not used.
|
|
60
62
|
def cover_published_date
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
63
|
+
revision = version&.revision_date.to_s
|
|
64
|
+
return revision unless revision.empty?
|
|
65
|
+
|
|
66
|
+
published = date.find { |d| d.type == "updated" }
|
|
64
67
|
return nil unless published
|
|
65
68
|
|
|
66
69
|
raw = published.on || published.text
|
|
@@ -77,12 +80,25 @@ module Metanorma
|
|
|
77
80
|
draft = version&.content.to_s
|
|
78
81
|
return nil if draft.empty?
|
|
79
82
|
|
|
80
|
-
info = " (
|
|
83
|
+
info = " (#{draft_label} #{draft}"
|
|
81
84
|
revdate = cover_published_date.to_s
|
|
82
85
|
info += ", #{revdate}" if !revdate.empty? && revdate != draft
|
|
83
86
|
"#{info})"
|
|
84
87
|
end
|
|
85
88
|
|
|
89
|
+
# The "draft" word is the document language's i18n label
|
|
90
|
+
# (isodoc draft_label: "brouillon" in French), not fixed English.
|
|
91
|
+
def draft_label
|
|
92
|
+
langs = Array(language)
|
|
93
|
+
lang = (langs.find { |l| l.current.to_s == "true" } || langs.first)&.value.to_s
|
|
94
|
+
lang = "en" if lang.empty?
|
|
95
|
+
(@draft_labels ||= {})[lang] ||= begin
|
|
96
|
+
IsoDoc::Iso::I18n.new(lang, "Latn").get["draft_label"] || "draft"
|
|
97
|
+
rescue LoadError, NameError, Errno::ENOENT
|
|
98
|
+
"draft"
|
|
99
|
+
end
|
|
100
|
+
end
|
|
101
|
+
|
|
86
102
|
def cover_edition_display
|
|
87
103
|
# isodoc renders edition[@language=en] verbatim (spelled out,
|
|
88
104
|
# e.g. "one thousand nine hundred seventy-ninth edition");
|
|
@@ -501,8 +501,11 @@ module Metanorma
|
|
|
501
501
|
|
|
502
502
|
if doc.sections
|
|
503
503
|
section_children = collect_ordered_children(doc.sections)
|
|
504
|
+
title_rendered = !render_doc_title(doc).to_s.empty?
|
|
504
505
|
section_children.reject! do |node|
|
|
505
|
-
node.is_a?(Metanorma::Document::Components::Paragraphs::ParagraphBlock)
|
|
506
|
+
next false unless node.is_a?(Metanorma::Document::Components::Paragraphs::ParagraphBlock)
|
|
507
|
+
|
|
508
|
+
title_rendered || !title_paragraph?(node)
|
|
506
509
|
end
|
|
507
510
|
items.concat(section_children)
|
|
508
511
|
end
|
|
@@ -514,6 +517,10 @@ module Metanorma
|
|
|
514
517
|
sort_by_displayorder(items)
|
|
515
518
|
end
|
|
516
519
|
|
|
520
|
+
def title_paragraph?(node)
|
|
521
|
+
safe_attr(node, :class_attr).to_s.start_with?("zzSTDTitle")
|
|
522
|
+
end
|
|
523
|
+
|
|
517
524
|
def publisher_logos_html(_doc)
|
|
518
525
|
publishers = flavor_publishers(extract_primary_doc_id)
|
|
519
526
|
logo_map = publisher_logo_map
|
|
@@ -46,7 +46,21 @@ module Metanorma
|
|
|
46
46
|
source_list.type
|
|
47
47
|
end
|
|
48
48
|
|
|
49
|
+
# Items are cited by id from xrefs elsewhere in the document, so
|
|
50
|
+
# the item keeps its source id (claimed against the document's ids)
|
|
51
|
+
# for the xref rid to resolve.
|
|
49
52
|
def build_list_item(li, ordered, fallback_marker = nil)
|
|
53
|
+
item = build_list_item_content(li, ordered, fallback_marker)
|
|
54
|
+
source_id = li.respond_to?(:id) ? li.id : nil
|
|
55
|
+
return item if source_id.nil? || source_id.to_s.empty?
|
|
56
|
+
|
|
57
|
+
id = id_generator.claim(source_id)
|
|
58
|
+
id_generator.register(source_id, id)
|
|
59
|
+
item.id = id
|
|
60
|
+
item
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
def build_list_item_content(li, ordered, fallback_marker)
|
|
50
64
|
nested_lists = build_nested_lists(li)
|
|
51
65
|
|
|
52
66
|
::Sts::NisoSts::ListItem.new do |item|
|
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
/* ==========================================================================
|
|
2
|
+
ISO default HTML: document body in the house style of the consolidated
|
|
3
|
+
ISO/IEC Directives online edition. Scoped to .main-section so the reader
|
|
4
|
+
chrome (header, sidebar, cover) keeps the shared component styles.
|
|
5
|
+
Sizes are in em so the reader's font-size control still scales the body.
|
|
6
|
+
========================================================================== */
|
|
7
|
+
|
|
8
|
+
/* Body tokens follow the theme palette, so the reader's light, sepia and
|
|
9
|
+
dark modes recolour the body; only the accents need dark-mode values. */
|
|
10
|
+
:root {
|
|
11
|
+
--iso-ink: var(--color-text);
|
|
12
|
+
--iso-ink-soft: var(--color-text-light);
|
|
13
|
+
--iso-muted: var(--color-text-muted);
|
|
14
|
+
--iso-line: var(--color-border);
|
|
15
|
+
--iso-line-soft: var(--color-bg-light);
|
|
16
|
+
--iso-link: var(--mn-primary);
|
|
17
|
+
--iso-link-soft: var(--mn-primary-light);
|
|
18
|
+
--iso-marker: var(--mn-warm);
|
|
19
|
+
--iso-table-bg: var(--color-bg);
|
|
20
|
+
}
|
|
21
|
+
[data-theme="dark"], [data-theme="oled"] {
|
|
22
|
+
--iso-link: #6fb3f0;
|
|
23
|
+
--iso-marker: #ff7a8a;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/* --- Body text --- */
|
|
27
|
+
.main-section {
|
|
28
|
+
font-family: var(--font-body);
|
|
29
|
+
font-size: 1em;
|
|
30
|
+
font-weight: 400;
|
|
31
|
+
line-height: 1.62;
|
|
32
|
+
color: var(--iso-ink);
|
|
33
|
+
}
|
|
34
|
+
.main-section p { margin: 0 0 0.875em; }
|
|
35
|
+
.main-section a { color: var(--iso-link); text-decoration: none; }
|
|
36
|
+
.main-section a:hover { text-decoration: underline; }
|
|
37
|
+
.main-section a.xref {
|
|
38
|
+
border-bottom: 1px dotted currentColor;
|
|
39
|
+
text-decoration: none;
|
|
40
|
+
}
|
|
41
|
+
.main-section a.xref:hover { background: var(--iso-link-soft); border-bottom-style: solid; }
|
|
42
|
+
|
|
43
|
+
/* --- Clause headings: number in the accent colour, then the title --- */
|
|
44
|
+
.main-section h1, .main-section h2, .main-section h3,
|
|
45
|
+
.main-section h4, .main-section h5, .main-section h6,
|
|
46
|
+
.main-section .foreword-title, .main-section .intro-title {
|
|
47
|
+
font-family: var(--font-sans);
|
|
48
|
+
font-weight: 700;
|
|
49
|
+
color: var(--iso-ink);
|
|
50
|
+
padding: 0;
|
|
51
|
+
border: 0;
|
|
52
|
+
letter-spacing: normal;
|
|
53
|
+
scroll-margin-top: calc(var(--header-height) + 20px);
|
|
54
|
+
}
|
|
55
|
+
.main-section h1, .main-section .foreword-title, .main-section .intro-title {
|
|
56
|
+
font-size: 1.5em;
|
|
57
|
+
line-height: 1.2;
|
|
58
|
+
letter-spacing: -0.01em;
|
|
59
|
+
margin: 3.25rem 0 1rem;
|
|
60
|
+
}
|
|
61
|
+
.main-section h1::after { content: none; }
|
|
62
|
+
.main-section h2 { font-size: 1.15625em; line-height: 1.3; margin: 2.125rem 0 0.75rem; }
|
|
63
|
+
.main-section h3, .main-section h4, .main-section h5, .main-section h6 {
|
|
64
|
+
font-size: 0.96875em;
|
|
65
|
+
line-height: 1.4;
|
|
66
|
+
margin: 1.5rem 0 0.625rem;
|
|
67
|
+
color: var(--iso-ink-soft);
|
|
68
|
+
}
|
|
69
|
+
.main-section :is(h1, h2, h3, h4, h5, h6) > .caption-label {
|
|
70
|
+
color: var(--iso-link);
|
|
71
|
+
font-variant-numeric: tabular-nums;
|
|
72
|
+
margin-right: 0.5em;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/* --- Annexes: "Annex A", obligation and title on separate lines --- */
|
|
76
|
+
.main-section .annex-title {
|
|
77
|
+
font-size: 1.5em;
|
|
78
|
+
line-height: 1.3;
|
|
79
|
+
color: var(--iso-link);
|
|
80
|
+
border-top: 1px solid var(--iso-line);
|
|
81
|
+
padding-top: 2.5rem;
|
|
82
|
+
margin-top: 3.75rem;
|
|
83
|
+
}
|
|
84
|
+
.main-section .annex-title .obligation-text { font-weight: 400; font-size: 0.75em; }
|
|
85
|
+
|
|
86
|
+
/* --- Captions: "Table 1 — Title", "Figure 1 — Title" with a visible dash --- */
|
|
87
|
+
.main-section .caption-delim { opacity: 1; }
|
|
88
|
+
.main-section .caption-label,
|
|
89
|
+
.main-section .element-label { font-weight: 700; font-variant: normal; text-transform: none; }
|
|
90
|
+
.main-section :is(figcaption, .table-caption) :is(.caption-label, .element-label) { color: inherit; }
|
|
91
|
+
|
|
92
|
+
/* --- Terms: entry number on its own line, preferred term in bold --- */
|
|
93
|
+
.main-section div[id^="term-"] {
|
|
94
|
+
margin: 1.125em 0 0.125em;
|
|
95
|
+
padding: 0;
|
|
96
|
+
border: 0;
|
|
97
|
+
}
|
|
98
|
+
.main-section div[id^="term-"] + div[id^="term-"] { margin-top: 1.125em; }
|
|
99
|
+
.main-section .TermNum {
|
|
100
|
+
font-family: var(--font-sans);
|
|
101
|
+
font-variant: normal;
|
|
102
|
+
font-size: 1em;
|
|
103
|
+
font-weight: 700;
|
|
104
|
+
line-height: 1.62;
|
|
105
|
+
color: var(--iso-link);
|
|
106
|
+
font-variant-numeric: tabular-nums;
|
|
107
|
+
margin: 0;
|
|
108
|
+
}
|
|
109
|
+
.main-section .TermNum > .caption-label { margin-right: 0; }
|
|
110
|
+
.main-section div[id^="term-"] > p { margin: 0 0 0.25em; }
|
|
111
|
+
.main-section div[id^="term-"] > p > strong:only-child { color: var(--iso-ink); }
|
|
112
|
+
.main-section .term-name { font-size: 1em; color: var(--iso-ink); font-weight: 700; }
|
|
113
|
+
.main-section .term-domain { color: var(--iso-ink-soft); font-size: 1em; }
|
|
114
|
+
.main-section p.term-source {
|
|
115
|
+
font-size: 1em;
|
|
116
|
+
color: var(--iso-ink);
|
|
117
|
+
line-height: 1.62;
|
|
118
|
+
margin: 0.375em 0 0.75em;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/* --- Notes and examples: small muted text, label in capitals --- */
|
|
122
|
+
.main-section .note-block,
|
|
123
|
+
.main-section .example,
|
|
124
|
+
.main-section div[id^="term-"] .note-block,
|
|
125
|
+
.main-section div[id^="term-"] .example {
|
|
126
|
+
background: none;
|
|
127
|
+
border: 0;
|
|
128
|
+
border-radius: 0;
|
|
129
|
+
padding: 0;
|
|
130
|
+
margin: 0.125rem 0 0.375rem;
|
|
131
|
+
font-size: 0.78125em;
|
|
132
|
+
line-height: 1.5;
|
|
133
|
+
color: var(--iso-muted);
|
|
134
|
+
}
|
|
135
|
+
.main-section .note-block::before,
|
|
136
|
+
.main-section .example::before { content: none; }
|
|
137
|
+
.main-section .note-block p,
|
|
138
|
+
.main-section .example p { margin: 0 0 0.375em; }
|
|
139
|
+
.main-section .note-label,
|
|
140
|
+
.main-section .term-note-label,
|
|
141
|
+
.main-section .example-label {
|
|
142
|
+
font-family: inherit;
|
|
143
|
+
font-weight: 700;
|
|
144
|
+
letter-spacing: 0.04em;
|
|
145
|
+
color: var(--iso-muted);
|
|
146
|
+
margin-right: 0.5em;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
/* --- Lists: dash and a) 1) labels in the marker colour --- */
|
|
150
|
+
.main-section .mn-labeled-list { padding-left: 2.2em; margin: 0.25em 0 1em; }
|
|
151
|
+
.main-section .mn-labeled-list .li-label {
|
|
152
|
+
float: left;
|
|
153
|
+
width: 2.2em;
|
|
154
|
+
margin-left: -2.2em;
|
|
155
|
+
color: var(--iso-marker);
|
|
156
|
+
font-weight: 600;
|
|
157
|
+
font-variant-numeric: tabular-nums;
|
|
158
|
+
}
|
|
159
|
+
.main-section li { margin: 0 0 0.375em; }
|
|
160
|
+
.main-section li::marker { color: var(--iso-marker); }
|
|
161
|
+
|
|
162
|
+
/* --- Tables: title above, centred; notes and footnotes inside the frame --- */
|
|
163
|
+
.main-section .table-scroll-wrapper { margin: 1em auto 1.25em; overflow-x: auto; text-align: center; }
|
|
164
|
+
.main-section .table-caption {
|
|
165
|
+
position: static;
|
|
166
|
+
display: block;
|
|
167
|
+
background: none;
|
|
168
|
+
border: 0;
|
|
169
|
+
padding: 0 0 0.5em;
|
|
170
|
+
text-align: center;
|
|
171
|
+
font-family: var(--font-sans);
|
|
172
|
+
font-size: 1em;
|
|
173
|
+
font-weight: 700;
|
|
174
|
+
color: var(--iso-ink);
|
|
175
|
+
}
|
|
176
|
+
.main-section table.table-block {
|
|
177
|
+
border-collapse: collapse;
|
|
178
|
+
width: auto;
|
|
179
|
+
min-width: 60%;
|
|
180
|
+
margin: 0 auto;
|
|
181
|
+
font-size: 0.90625em;
|
|
182
|
+
background: var(--iso-table-bg);
|
|
183
|
+
text-align: left;
|
|
184
|
+
}
|
|
185
|
+
.main-section table.table-block th,
|
|
186
|
+
.main-section table.table-block td {
|
|
187
|
+
border: 1px solid var(--iso-line);
|
|
188
|
+
padding: 0.4375em 0.75em;
|
|
189
|
+
text-align: left;
|
|
190
|
+
vertical-align: top;
|
|
191
|
+
}
|
|
192
|
+
.main-section table.table-block thead th {
|
|
193
|
+
background: var(--iso-link-soft);
|
|
194
|
+
color: var(--iso-ink);
|
|
195
|
+
font-weight: 700;
|
|
196
|
+
}
|
|
197
|
+
.main-section td.table-footnotes {
|
|
198
|
+
font-size: 0.9em;
|
|
199
|
+
color: var(--iso-ink-soft);
|
|
200
|
+
}
|
|
201
|
+
.main-section .TableFootnoteRef {
|
|
202
|
+
vertical-align: super;
|
|
203
|
+
font-size: 0.75em;
|
|
204
|
+
line-height: 0;
|
|
205
|
+
margin-right: 0.35em;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
/* --- Figures: title below the figure, bold and centred --- */
|
|
209
|
+
.main-section figure { margin: 1.5em 0; padding: 0; text-align: center; }
|
|
210
|
+
.main-section figure img {
|
|
211
|
+
max-width: 100%;
|
|
212
|
+
height: auto;
|
|
213
|
+
border: 1px solid var(--iso-line);
|
|
214
|
+
border-radius: 6px;
|
|
215
|
+
background: #fff;
|
|
216
|
+
padding: 8px;
|
|
217
|
+
}
|
|
218
|
+
.main-section figcaption {
|
|
219
|
+
margin-top: 0.5em;
|
|
220
|
+
font-family: var(--font-sans);
|
|
221
|
+
font-size: 1em;
|
|
222
|
+
font-style: normal;
|
|
223
|
+
font-weight: 700;
|
|
224
|
+
color: var(--iso-ink);
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
/* --- Formulae: number in parentheses at the right margin --- */
|
|
228
|
+
.main-section .formula-number { color: var(--iso-ink); font-weight: 400; font-family: inherit; }
|
|
229
|
+
|
|
230
|
+
/* --- Footnotes and bibliography --- */
|
|
231
|
+
.main-section .fn-marker .fn-link,
|
|
232
|
+
.main-section a.fn-link { color: var(--iso-link); }
|
|
233
|
+
.main-section .footnotes .footnote {
|
|
234
|
+
font-size: 0.8125em;
|
|
235
|
+
color: var(--iso-ink-soft);
|
|
236
|
+
border-top: 1px solid var(--iso-line-soft);
|
|
237
|
+
padding-top: 0.5em;
|
|
238
|
+
}
|
|
239
|
+
.main-section .biblio-entry {
|
|
240
|
+
border: 0;
|
|
241
|
+
font-size: 1em;
|
|
242
|
+
line-height: 1.62;
|
|
243
|
+
margin: 0 0 0.75em;
|
|
244
|
+
padding: 0 0 0 2.6em;
|
|
245
|
+
text-indent: -2.6em;
|
|
246
|
+
}
|
|
247
|
+
.main-section .biblio-ordinal {
|
|
248
|
+
display: inline-block;
|
|
249
|
+
min-width: 2.6em;
|
|
250
|
+
text-indent: 0;
|
|
251
|
+
color: var(--iso-link);
|
|
252
|
+
font-weight: 700;
|
|
253
|
+
font-variant-numeric: tabular-nums;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
@media (max-width: 760px) {
|
|
257
|
+
.main-section table.table-block { min-width: 0; font-size: 0.84375em; }
|
|
258
|
+
.main-section table.table-block th,
|
|
259
|
+
.main-section table.table-block td { padding: 0.375em 0.5625em; }
|
|
260
|
+
.main-section .mn-labeled-list { padding-left: 1.4em; }
|
|
261
|
+
}
|
|
@@ -1,26 +1,72 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
1
|
+
# Default ISO HTML theme: the house style of the consolidated ISO/IEC
|
|
2
|
+
# Directives online edition (iso.org/sites/directives). ISO/IEC Directives,
|
|
3
|
+
# Part 2, Clause 1 leaves typography and layout to the publisher's house
|
|
4
|
+
# style; the structural rules (numbering, labels, caption placement) come
|
|
5
|
+
# from the presentation XML. Element styles for the document body are in
|
|
6
|
+
# custom.css next to this file. The previous default is ../iso-legacy.
|
|
7
|
+
|
|
8
|
+
# Palette
|
|
9
|
+
primary: "#0b5aa2"
|
|
10
|
+
accent: "#0b5aa2"
|
|
11
|
+
accent_deep: "#094a86"
|
|
12
|
+
gradient: "linear-gradient(135deg, #094a86 0%, #0b5aa2 100%)"
|
|
13
|
+
primary_light: "#eaf2f9"
|
|
14
|
+
accent_light: "#eaf2f9"
|
|
15
|
+
primary_dark: "#094a86"
|
|
16
|
+
warm: "#c8102e"
|
|
17
|
+
warm_light: "#fdf3f4"
|
|
18
|
+
|
|
19
|
+
# Text and backgrounds
|
|
20
|
+
text_color: "#1a1d21"
|
|
21
|
+
text_light: "#454b52"
|
|
22
|
+
text_muted: "#6b7280"
|
|
23
|
+
bg: "#ffffff"
|
|
24
|
+
bg_light: "#f6f8fa"
|
|
25
|
+
border: "#e3e6ea"
|
|
26
|
+
sidebar_bg: "#fbfcfd"
|
|
27
|
+
|
|
28
|
+
# Typography: one sans-serif stack for body and headings, as on the
|
|
29
|
+
# Directives site. Roboto is loaded as the fallback where Segoe UI is absent.
|
|
30
|
+
font_body: '"Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif'
|
|
31
|
+
font_sans: '"Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif'
|
|
32
|
+
font_url: "https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,400;0,700;1,400;1,700&family=JetBrains+Mono:wght@400;500&display=swap"
|
|
33
|
+
|
|
34
|
+
# Layout
|
|
35
|
+
content_max_width: "60em"
|
|
36
|
+
sidebar_width: "340px"
|
|
37
|
+
|
|
38
|
+
# Blocks: notes and examples are plain small text (see custom.css)
|
|
39
|
+
note_color: "#6b7280"
|
|
40
|
+
note_bg: "transparent"
|
|
41
|
+
note_border: "transparent"
|
|
42
|
+
example_color: "#6b7280"
|
|
43
|
+
example_bg: "transparent"
|
|
44
|
+
example_border: "transparent"
|
|
45
|
+
admonition_color: "#c8102e"
|
|
46
|
+
admonition_bg: "#fdf3f4"
|
|
47
|
+
admonition_border: "#c8102e"
|
|
48
|
+
|
|
49
|
+
# Reader chrome and cover
|
|
50
|
+
header_background: "linear-gradient(135deg, #094a86 0%, #0b5aa2 100%)"
|
|
51
|
+
cover_background: "linear-gradient(175deg, #073a6b 0%, #094a86 45%, #0b5aa2 100%)"
|
|
52
|
+
cover_after_bg: "height: 3px; background: #c8102e"
|
|
53
|
+
progress_bar_color: "#0b5aa2"
|
|
54
|
+
footer_border_color: "#0b5aa2"
|
|
55
|
+
cover_separator_color: "rgba(255,255,255,0.25)"
|
|
56
|
+
|
|
57
|
+
# Dark mode (Directives site dark palette)
|
|
58
|
+
dark_bg: "#15181d"
|
|
59
|
+
dark_bg_light: "#1a1e24"
|
|
60
|
+
dark_border: "#333a44"
|
|
61
|
+
dark_sidebar: "#1a1e24"
|
|
62
|
+
dark_text: "#e6e9ee"
|
|
63
|
+
dark_text_light: "#c2c8d0"
|
|
64
|
+
dark_text_muted: "#9aa3ae"
|
|
65
|
+
dark_primary_light: "#21303f"
|
|
66
|
+
dark_accent_light: "#21303f"
|
|
67
|
+
dark_note_bg: "transparent"
|
|
68
|
+
dark_example_bg: "transparent"
|
|
69
|
+
dark_admonition_bg: "#2a1d21"
|
|
24
70
|
|
|
25
71
|
# Publisher metadata
|
|
26
72
|
publishers:
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# Legacy ISO HTML theme: the previous default, kept so documents can still be
|
|
2
|
+
# rendered with the body typography of the legacy isodoc HTML output.
|
|
3
|
+
# Select it explicitly with Theme.load("iso-legacy"); the default ISO theme
|
|
4
|
+
# is the ISO Directives style in ../iso.
|
|
5
|
+
primary: "#b3000c"
|
|
6
|
+
accent: "#e3000f"
|
|
7
|
+
accent_deep: "#b3000c"
|
|
8
|
+
gradient: "linear-gradient(135deg, #8a0009 0%, #b3000c 50%, #e3000f 100%)"
|
|
9
|
+
primary_light: "#fef0f1"
|
|
10
|
+
accent_light: "#fde8ea"
|
|
11
|
+
warm: "#1a1a1a"
|
|
12
|
+
warm_light: "#f5f5f5"
|
|
13
|
+
header_background: "linear-gradient(135deg, #8a0009 0%, #b3000c 40%, #e3000f 100%)"
|
|
14
|
+
cover_background: "linear-gradient(175deg, #5a0006 0%, #8a0009 25%, #b3000c 50%, #e3000f 80%, #ff4d4d 100%)"
|
|
15
|
+
cover_before_bg: "background: radial-gradient(ellipse at 25% 20%, rgba(255,77,77,0.15) 0%, transparent 50%), radial-gradient(ellipse at 75% 80%, rgba(26,26,26,0.1) 0%, transparent 40%)"
|
|
16
|
+
cover_after_bg: "height: 3px; background: linear-gradient(90deg, transparent, #e3000f, #1a1a1a, transparent)"
|
|
17
|
+
progress_bar_color: "#e3000f"
|
|
18
|
+
note_border: "#e3000f"
|
|
19
|
+
note_bg: "#fde8ea"
|
|
20
|
+
note_color: "#e3000f"
|
|
21
|
+
example_border: "#b3000c"
|
|
22
|
+
example_bg: "#fef0f1"
|
|
23
|
+
example_color: "#b3000c"
|
|
24
|
+
admonition_border: "#1a1a1a"
|
|
25
|
+
admonition_color: "#1a1a1a"
|
|
26
|
+
footer_border_color: "#e3000f"
|
|
27
|
+
cover_separator_color: "rgba(227,0,15,0.25)"
|
|
28
|
+
|
|
29
|
+
# Publisher metadata
|
|
30
|
+
publishers:
|
|
31
|
+
- "ISO"
|
|
32
|
+
publisher_name: "ISO"
|
|
33
|
+
logos_light:
|
|
34
|
+
"ISO": "iso-logo.svg"
|
|
35
|
+
|
|
36
|
+
# Section ordering
|
|
37
|
+
preface_order:
|
|
38
|
+
- foreword
|
|
39
|
+
- introduction
|
|
40
|
+
- abstract
|
|
41
|
+
- clause
|
|
42
|
+
- acknowledgements
|
|
43
|
+
- executivesummary
|
|
44
|
+
toc_filter_types: []
|
|
45
|
+
|
|
46
|
+
# Reading-body typography follows the legacy default (non-alt) HTML output.
|
|
47
|
+
# Reader chrome and publisher cover branding retain the theme palette.
|
|
48
|
+
extra_css: |
|
|
49
|
+
.main-section {
|
|
50
|
+
font-family: Cambria, serif;
|
|
51
|
+
font-weight: 300;
|
|
52
|
+
line-height: 1.3;
|
|
53
|
+
}
|
|
54
|
+
:root:not([data-theme="dark"]) .main-section { color: #000; }
|
|
55
|
+
.main-section p { margin: 1em 0; }
|
|
56
|
+
.main-section h1, .main-section h2, .main-section h3,
|
|
57
|
+
.main-section h4, .main-section h5, .main-section h6 {
|
|
58
|
+
font-family: Cambria, serif;
|
|
59
|
+
font-weight: 700;
|
|
60
|
+
line-height: 1.2;
|
|
61
|
+
color: inherit;
|
|
62
|
+
margin: 2em 0 1em;
|
|
63
|
+
padding: 0;
|
|
64
|
+
border: 0;
|
|
65
|
+
letter-spacing: normal;
|
|
66
|
+
}
|
|
67
|
+
.main-section h1 { font-size: 1.5em; }
|
|
68
|
+
.main-section h2 { font-size: 1.2em; }
|
|
69
|
+
.main-section h1::after { content: none; }
|
data/metanorma-iso.gemspec
CHANGED
|
@@ -28,7 +28,8 @@ Gem::Specification.new do |spec|
|
|
|
28
28
|
spec.executables = %w[metanorma-iso-validate]
|
|
29
29
|
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
|
30
30
|
f.match(%r{^(test|spec|features|bin|.github)/}) \
|
|
31
|
-
|| f.match(%r{Rakefile|bin/rspec})
|
|
31
|
+
|| f.match(%r{Rakefile|bin/rspec}) \
|
|
32
|
+
|| f == "CLAUDE.md"
|
|
32
33
|
end
|
|
33
34
|
spec.required_ruby_version = Gem::Requirement.new(">= 3.3.0")
|
|
34
35
|
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: metanorma-iso
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 3.5.
|
|
4
|
+
version: 3.5.36
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ribose Inc.
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-11-
|
|
11
|
+
date: 2026-11-29 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: isodoc
|
|
@@ -386,7 +386,6 @@ files:
|
|
|
386
386
|
- ".rubocop.tb.yml"
|
|
387
387
|
- ".rubocop.yml"
|
|
388
388
|
- ".rubocop_todo.yml"
|
|
389
|
-
- CLAUDE.md
|
|
390
389
|
- CODE_OF_CONDUCT.md
|
|
391
390
|
- Gemfile
|
|
392
391
|
- LICENSE
|
|
@@ -844,8 +843,10 @@ files:
|
|
|
844
843
|
- lib/metanorma/iso/sts/transformer/term_transformer.rb
|
|
845
844
|
- lib/metanorma/iso/sts/validation_report.rb
|
|
846
845
|
- lib/metanorma/iso/sts/validator.rb
|
|
846
|
+
- lib/metanorma/iso/themes/iso-legacy/theme.yaml
|
|
847
847
|
- lib/metanorma/iso/themes/iso/assets/iso-logo.svg
|
|
848
848
|
- lib/metanorma/iso/themes/iso/assets/registry.css
|
|
849
|
+
- lib/metanorma/iso/themes/iso/custom.css
|
|
849
850
|
- lib/metanorma/iso/themes/iso/templates/index.html.liquid
|
|
850
851
|
- lib/metanorma/iso/themes/iso/theme.yaml
|
|
851
852
|
- lib/metanorma/iso/validate.rb
|
data/CLAUDE.md
DELETED
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
# CLAUDE.md
|
|
2
|
-
|
|
3
|
-
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
|
|
4
|
-
|
|
5
|
-
## Tools
|
|
6
|
-
|
|
7
|
-
- Use `canon diff FILE1 FILE2` for semantic XML diffs. NEVER use `xmldiff` (it is broken — produces false structural diffs).
|
|
8
|
-
Canon is at `/Users/mulgogi/.local/share/mise/installs/ruby/3.4.8/bin/canon`. See `~/src/lutaml/canon/README.adoc` for full options.
|
|
9
|
-
Key flags: `--verbose` (detailed output), `--show-diffs normative` (only equivalence-affecting diffs),
|
|
10
|
-
`--diff-algorithm semantic`, `--text-content normalize`, `--structural-whitespace ignore`.
|
|
11
|
-
- **NEVER use Python.** Use Ruby for all scripting, analysis, and validation tasks.
|
|
12
|
-
|
|
13
|
-
## Overview
|
|
14
|
-
|
|
15
|
-
metanorma-iso is a Ruby gem that processes Metanorma AsciiDoc documents following ISO International Standard templates. It generates XML, HTML (standard + alt), Word (.doc), PDF, and STS output formats. It builds on top of metanorma-standoc and isodoc.
|
|
16
|
-
|
|
17
|
-
## Spec Safety Rules
|
|
18
|
-
|
|
19
|
-
- **NEVER run `bundle exec rake` or `bundle exec rspec` (full suite).** The full test suite causes memory leaks that crash the machine (Killed: 9). No exceptions.
|
|
20
|
-
- **NEVER run multiple spec files in one session.** Run ONE targeted spec file at a time, then wait for the process to fully exit before running another.
|
|
21
|
-
- **ALWAYS run a single spec file with a specific line number when possible.** Example: `bundle exec rspec spec/isodoc/docx/adapter_spec.rb:42`
|
|
22
|
-
- **NEVER run specs in parallel or in background tasks.** No `&` backgrounding, no multiple shell invocations.
|
|
23
|
-
- **If a spec process hangs or uses excessive memory, kill it immediately.** Do not let it run to completion.
|
|
24
|
-
- **For verification, prefer reading code over running specs.** Specs are for confirming a specific change works, not for broad exploration.
|
|
25
|
-
|
|
26
|
-
## Build and Test Commands
|
|
27
|
-
|
|
28
|
-
```bash
|
|
29
|
-
bundle install # install dependencies
|
|
30
|
-
# ONLY run individual spec files — NEVER the full suite:
|
|
31
|
-
bundle exec rspec spec/isodoc/docx/adapter_spec.rb:42 # single test by line number
|
|
32
|
-
bundle exec rspec spec/isodoc/docx/adapter_spec.rb # single file
|
|
33
|
-
bundle exec rubocop # lint
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
Tests use VCR cassettes (in `spec/vcr_cassettes/`) for external HTTP interactions.
|
|
37
|
-
|
|
38
|
-
## Architecture
|
|
39
|
-
|
|
40
|
-
### Two-layer design: AsciiDoc parsing → Document rendering
|
|
41
|
-
|
|
42
|
-
**Layer 1: AsciiDoc → ISO XML** (`lib/metanorma/iso/`)
|
|
43
|
-
- `converter.rb` — Entry point. `Metanorma::Iso::Converter` extends `Standoc::Converter`, registered as the `:iso` backend
|
|
44
|
-
- `base.rb` — Output pipeline: generates `.xml`, then chains to presentation XML, HTML, Word, PDF converters
|
|
45
|
-
- `front.rb`, `front_id.rb`, `front_contributor.rb` — Metadata/bibliographic data extraction from AsciiDoc attributes (titles, stage, document ID via `pubid` gem)
|
|
46
|
-
- `cleanup.rb`, `cleanup_biblio.rb` — Post-processing of generated XML (footnote renumbering, ordered list cleanup, editorial group defaults, unpublished reference footnotes)
|
|
47
|
-
- `section.rb` — ISO-specific section parsing (scope, terms, patent notice)
|
|
48
|
-
- `validate.rb` + `validate_*.rb` — ISO-specific document validation (doctype, titles, section sequencing, cross-references, list formatting, style rules). Errors are logged via `log.rb` using keyed messages (ISO_1 through ISO_52)
|
|
49
|
-
- `processor.rb` — `Metanorma::Processor` subclass registering output formats (html, html_alt, doc, pdf, sts, isosts, presentation)
|
|
50
|
-
|
|
51
|
-
**Layer 2: ISO XML → Rendered output** (`lib/isodoc/iso/`)
|
|
52
|
-
- `base_convert.rb` — Shared rendering mixins (examples, tables, figures, admonitions) used by HTML and Word converters
|
|
53
|
-
- `html_convert.rb` — HTML output
|
|
54
|
-
- `word_convert.rb` — Word (.doc) output; `word_dis_convert.rb` handles distributed Word format
|
|
55
|
-
- `pdf_convert.rb` — PDF output
|
|
56
|
-
- `sts_convert.rb`, `isosts_convert.rb` — STS (ISO Standards Tag Set) XML output
|
|
57
|
-
- `presentation_xml_convert.rb` — Presentation XML (intermediate format); delegates to `presentation_*.rb` modules for bibdata, sections, terms, xrefs
|
|
58
|
-
- `xref.rb`, `xref_section.rb`, `xref_figure.rb` — Cross-reference generation
|
|
59
|
-
- `metadata.rb` — Document metadata extraction for rendering
|
|
60
|
-
- `i18n.rb` + `i18n-*.yaml` — Internationalization (en, fr, ru, de, ja, zh-Hans)
|
|
61
|
-
- `init.rb` — Factory methods for metadata, xref, i18n, and bib renderer instances
|
|
62
|
-
|
|
63
|
-
### Supporting modules
|
|
64
|
-
- `lib/metanorma/requirements/` — Requirements processing (modspec type)
|
|
65
|
-
- `lib/relaton/render/` — Bibliographic reference rendering with ISO-specific formatting and selective capitalization
|
|
66
|
-
- `lib/html2doc/lists.rb` — HTML-to-Word list conversion helper
|
|
67
|
-
|
|
68
|
-
### Document model ownership
|
|
69
|
-
|
|
70
|
-
The document model is split across three gems, each owning its own layer:
|
|
71
|
-
|
|
72
|
-
```
|
|
73
|
-
metanorma-document → Metanorma::Document (components), Metanorma::BasicDocument
|
|
74
|
-
metanorma-standoc → Metanorma::StandardDocument (generic standard document)
|
|
75
|
-
metanorma-iso → Metanorma::IsoDocument (ISO-specific extensions)
|
|
76
|
-
```
|
|
77
|
-
|
|
78
|
-
`Metanorma::IsoDocument` (Root, Sections, Metadata, Terms, Blocks, Boilerplate under `lib/metanorma/iso_document/`) is **canonical to this repository** — it lives here, not in metanorma-document. Flavor gems iterate on their own document model without waiting for upstream releases. Same pattern as metanorma-oiml owning its own document Root.
|
|
79
|
-
|
|
80
|
-
- `lib/metanorma/iso_document.rb` is the entry point: it requires `metanorma/document`, declares all autoloads with absolute `#{__dir__}` paths, and calls `Metanorma::Registers::Setup.setup_iso_register`.
|
|
81
|
-
- This gem's `lib/` precedes metanorma-document's `lib/` in `$LOAD_PATH`. metanorma-document still ships its own (older) IsoDocument tree for backwards compatibility — it is shadowed by this gem's canonical copy at runtime.
|
|
82
|
-
- Base classes (`Metanorma::StandardDocument`, `Metanorma::BasicDocument`, `Metanorma::Document::Components`) come from the metanorma-document gem at **released 0.4.0** (gemspec `~> 0.4.0`). That chain requires pubid 2.0.0.pre.alpha + relaton-bib 2.2.0.pre; the pubid-2 migration of the converter is DONE (see "pubid 2 migration" below).
|
|
83
|
-
- **Planned cleanup** (tracked in TODO.validate/): StandardDocument moves to metanorma-standoc, and metanorma-document shrinks to Document components only. IsoDocument disappears from metanorma-document entirely once StandardDocument lands in metanorma-standoc. Each step is a separate PR.
|
|
84
|
-
- Notable model changes vs the old 0.2.6 gem: `RawParagraph` removed (terms `<p>` parses directly into `ParagraphBlock`), `AmendContentBlock`/`Boilerplate`/`AnnotationContainer` are structured (no raw `content` string), several attributes went string→boolean (`docidentifier/@primary`, `references/@normative`, `clause/@inline_header` — compare with `.to_s == "true"` in code), and 0.4.0's `IsoPreface` no longer inherits `StandardDocument::Preface` (no `acknowledgements`/`executivesummary` mappings — guard consumers with `class.attributes.key?`).
|
|
85
|
-
|
|
86
|
-
### pubid 2 migration (pubid 2.0.0.pre.alpha)
|
|
87
|
-
pubid 2 is a rewrite: flavor modules with typed-component models, no `Identifier.create`, no universal `Registry.parse`, no `Pubid::Core::Errors`. Key API used here (`lib/metanorma/iso/front_id.rb`):
|
|
88
|
-
- Construction: flavor classes, e.g. `Pubid::Iso::Identifiers::InternationalStandard.new(number:, part:, date:, publisher:, copublishers:, languages:, typed_stage:)`. Type class via `Pubid::Iso.locate_type(code)`; typed stage via `Pubid::Iso.all_typed_stages.find { harmonized_stages.include?(code) && type_code == tc }` (60.60 = published: abbr "IS"/"TR"/...; visible abbreviation is the FIRST NON-EMPTY variant, e.g. published IS is `["", "IS"]`).
|
|
89
|
-
- Rendering: `id.to_s` (typed stages always shown; language form comes from the Language component's `original_code` — single char "E" for ref_num_short, ISO code "en" for ref_num_long); `id.to_urn` (2.x URN grammar: stage ABBR like `WD.3`/`FDIS`/`FDTS`, published stages omitted, versions as `v1.3`, explicit `:en`).
|
|
90
|
-
- `id.stage` is COMPUTED from `typed_stage` (`typed_stage.to_stage`) — never assign it.
|
|
91
|
-
- Errors: `Parslet::ParseFailed` (+ `ArgumentError` for over-long input); the 1.x `Pubid::Core::Errors` hierarchy is gone. Illegal stage codes must be raised explicitly (ISO_9 warning depends on it).
|
|
92
|
-
- CEN: `Pubid::CenCenelec` (e.g. `Identifiers::EuropeanNorm`, `AdoptedEuropeanNorm` with `adopted_identifier`).
|
|
93
|
-
- Known upstream gaps: pubid 2's grammar rejects the undated `:--` form (isodoc's `std_docid_semantic` regex-fallback covers annotation for those); `Pubid::Iso::Parser::ParseError` and `Pubid::Errors::ParseError` are referenced but not defined in pubid 2.0.0.pre.alpha.8.
|
|
94
|
-
|
|
95
|
-
### RNG Schemas
|
|
96
|
-
`lib/metanorma/iso/*.rng` — RelaxNG schemas for validating ISO XML. `isostandard-compile.rng` is the main schema; `isostandard-amd.rng` is used for amendments/technical corrigenda.
|
|
97
|
-
|
|
98
|
-
### Templates
|
|
99
|
-
- `lib/metanorma/iso/boilerplate*.adoc` — Boilerplate text (en, fr, ru) injected into documents
|
|
100
|
-
- `lib/isodoc/iso/html/` — HTML/SCSS templates and stylesheets for rendering
|
|
101
|
-
|
|
102
|
-
## DOCX Debugging Rules
|
|
103
|
-
|
|
104
|
-
- **The ZIP packaging is NEVER the problem.** The rubyzip output is proven correct (resaving a working DOCX through rubyzip produces a working DOCX). NEVER debug, investigate, or modify ZIP format code (zip_packager.rb, compression methods, ZIP version, Zip64, entry ordering). The bug is ALWAYS in the XML content.
|
|
105
|
-
- **NEVER use "shell swapping" or "part swapping" tests.** Replacing one DOCX file's XML parts with another's never fixes anything — the supporting files (styles, numbering, settings) are cross-referenced and must be consistent. Instead, audit and fix the actual XML content that the adapter generates.
|
|
106
|
-
- When a DOCX won't open, the bug is in the XML content, not the ZIP packaging. Audit the XML schemas, cross-references, and structural validity.
|
|
107
|
-
- Use `canon diff` or `uniword diff compare` to compare against the Word-repaired output (`*-repaired.docx`). The repaired file shows what Word considers correct.
|
|
108
|
-
- Compare against the known-working output (`data/iso-rice-sample-output.docx`) to find regressions.
|
|
109
|
-
- **NEVER run `bundle exec ruby` scripts that load the rice presentation XML model in background tasks.** Parsing the large XML causes memory exhaustion and process kills (Killed: 9). Use small targeted scripts or read the XML file directly instead.
|
|
110
|
-
|
|
111
|
-
## Key Patterns
|
|
112
|
-
|
|
113
|
-
- The converter class hierarchy is: `Standoc::Converter` → `Metanorma::Iso::Converter` (in `converter.rb` + `base.rb`). Validation and cleanup are in separate subclass modules (`Validate`, `Cleanup`) that extend their Standoc counterparts.
|
|
114
|
-
- ISO XML root tag is `iso-standard` with namespace `https://www.metanorma.org/ns/iso`.
|
|
115
|
-
- Document types: `international-standard`, `technical-specification`, `technical-report`, `publicly-available-specification`, `international-workshop-agreement`, `guide`, `amendment`, `technical-corrigendum`, `committee-document`, `addendum`, `recommendation`.
|
|
116
|
-
- Document schemes (1951, 1972, 1979, 1987, 1989, 2012, 2013, 2024) affect rendering rules; default is 2024.
|
|
117
|
-
- Amendments and technical corrigenda (`@amd`) skip many validations and have different processing paths.
|
|
118
|
-
- Vocabulary documents (`@vocab`, set via `docsubtype == "vocabulary"`) also have special handling.
|
|
119
|
-
- The `Gemfile.devel` file can override gem sources for local development (e.g., pointing to a local branch of isodoc).
|