diff --git a/scripts/validate-register.rb b/scripts/validate-register.rb index fb61b47..4e3a68f 100644 --- a/scripts/validate-register.rb +++ b/scripts/validate-register.rb @@ -94,6 +94,50 @@ end end +# ---- pass 2b: bibliography markup (renders empty when malformed) ------------- +# Metanorma drops bibliography entries without a [[[id,text]]] anchor and +# renders only the first anchor of a multi-anchor entry, so a malformed +# section silently produces an empty trailing "Bibliography" heading. +ROOTS.each do |root| + key = root + all_dirs[root].each do |d| + name = File.basename(d) + next if FROZEN_V1.include?(name) + Dir.glob(File.join(d, "sections", "*.adoc")).each do |f| + lines = File.readlines(f) + lines.each_with_index do |line, i| + next unless line =~ /^== (Bibliography|Normative references)\s*$/ + + prior = lines[0...i].reverse.find { |l| !l.strip.empty? } + unless prior && prior =~ /^\[bibliography\]\s*$/ + report.call(key, "#{name}:#{File.basename(f)}:#{i + 1}: " \ + "heading `#{line.strip}` lacks the [bibliography] marker") + end + + lines[(i + 1)..].each_with_index do |entry, j| + break if entry =~ /^== / + next unless entry =~ /^\* / + + ln = i + 1 + j + 1 + anchors = entry.scan(/\[\[\[([^\],]+),/).flatten + if anchors.empty? + report.call(key, "#{name}:#{File.basename(f)}:#{ln}: " \ + "bibliography entry without an anchor") + elsif anchors.size > 1 + report.call(key, "#{name}:#{File.basename(f)}:#{ln}: " \ + "multi-anchor entry (renders later anchors empty): " \ + "#{anchors.join(", ")}") + end + if entry =~ /\nofetch\([^)]*\z/ + report.call(key, "#{name}:#{File.basename(f)}:#{ln}: " \ + "unbalanced nofetch( parenthesis") + end + end + end + end + end +end + # ---- pass 3: cross-part citations resolve ------------------------------------ all_names = all_dirs.values.flatten.map { |d| File.basename(d) } # Only check citations to series visible in the scanned registers; a sibling diff --git a/sources/asciiunits/sections/99-bibliography.adoc b/sources/asciiunits/sections/99-bibliography.adoc index f494396..ec75fb0 100644 --- a/sources/asciiunits/sections/99-bibliography.adoc +++ b/sources/asciiunits/sections/99-bibliography.adoc @@ -1,2 +1,5 @@ [bibliography] == Bibliography + +* [[[unitsml-ruby,nofetch(unitsml/unitsml-ruby)]]] — the Ruby implementation of AsciiUnits from which the grammar was extracted, and the reference parser validated against it +* [[[asciiunits-repo,nofetch(unitsml/asciiunits)]]] — the PARG grammar artifact and conformance corpus repository diff --git a/sources/unitsdb/sections/02-normrefs.adoc b/sources/unitsdb/sections/02-normrefs.adoc index 1290407..3253b92 100644 --- a/sources/unitsdb/sections/02-normrefs.adoc +++ b/sources/unitsdb/sections/02-normrefs.adoc @@ -1,4 +1,4 @@ [bibliography] == Normative references -* [[SI_Brochure,BIPM SI Brochure]], SI Brochure: The International System of Units (SI), 9th edition, 2019, BIPM +* [[[SI_Brochure,BIPM SI Brochure]]], SI Brochure: The International System of Units (SI), 9th edition, 2019, BIPM diff --git a/sources/unitsml-36814-unitsdb/sections/02-normrefs.adoc b/sources/unitsml-36814-unitsdb/sections/02-normrefs.adoc index f187165..de2754f 100644 --- a/sources/unitsml-36814-unitsdb/sections/02-normrefs.adoc +++ b/sources/unitsml-36814-unitsdb/sections/02-normrefs.adoc @@ -2,7 +2,7 @@ == Normative references * [[[unitsml-36812,nofetch(CalConnect 36812)]]] -* [[[unitsml-3682,nofetch(CalConnect 36813]]] +* [[[unitsml-36813,nofetch(CalConnect 36813)]]] * [[[iso4217,ISO 4217]]] (currency codes) * [[[iec62720,nofetch(IEC 62720)]]] (units dictionary; source corpus only — no IEC backing of this register is implied) * [[[cc36811,nofetch(CalConnect 36811)]]], _UnitsML — UnitsDB specification_ (v1 base standard, frozen 2025-03; historical) diff --git a/sources/unitsml-36815-units-model/sections/02-normrefs.adoc b/sources/unitsml-36815-units-model/sections/02-normrefs.adoc index 530924a..2c4692d 100644 --- a/sources/unitsml-36815-units-model/sections/02-normrefs.adoc +++ b/sources/unitsml-36815-units-model/sections/02-normrefs.adoc @@ -2,8 +2,8 @@ == Normative references * [[[unitsml-36812,nofetch(CalConnect 36812)]]] -* [[[unitsml-3682,nofetch(CalConnect 36813]]] -* [[[unitsml-3683,nofetch(CalConnect 36814]]] +* [[[unitsml-36813,nofetch(CalConnect 36813)]]] +* [[[unitsml-36814,nofetch(CalConnect 36814)]]] * [[[jcgm200,JCGM 200:2012]]] (VIM), entries 1.1–1.5, 2.30–2.38 * [[[iso80000-1,ISO 80000-1]]] (quantities and units; scales) * [[[pendrill2024,nofetch(Pendrill 2024)]]] (L0–L3 concept levels; isq-smart concept system) diff --git a/sources/unitsml-36816-conversions/sections/02-normrefs.adoc b/sources/unitsml-36816-conversions/sections/02-normrefs.adoc index 3667a36..a597812 100644 --- a/sources/unitsml-36816-conversions/sections/02-normrefs.adoc +++ b/sources/unitsml-36816-conversions/sections/02-normrefs.adoc @@ -2,8 +2,8 @@ == Normative references * [[[unitsml-36812,nofetch(CalConnect 36812)]]] -* [[[unitsml-3682,nofetch(CalConnect 36813]]] -* [[[unitsml-3683,nofetch(CalConnect 36814]]] -* [[[unitsml-3684,nofetch(CalConnect 36815]]] +* [[[unitsml-36813,nofetch(CalConnect 36813)]]] +* [[[unitsml-36814,nofetch(CalConnect 36814)]]] +* [[[unitsml-36815,nofetch(CalConnect 36815)]]] * [[[xsd-float64,nofetch(UnitsML 1.0 XSD Float64ConversionFromType)]]] (the data syntax) * [[[jcgm100,JCGM 100:2008]]] (exactness discipline analogy) diff --git a/sources/unitsml-36817-asciiunits/sections/02-normrefs.adoc b/sources/unitsml-36817-asciiunits/sections/02-normrefs.adoc index 68cfaa6..946792d 100644 --- a/sources/unitsml-36817-asciiunits/sections/02-normrefs.adoc +++ b/sources/unitsml-36817-asciiunits/sections/02-normrefs.adoc @@ -2,6 +2,6 @@ == Normative references * [[[unitsml-36812,nofetch(CalConnect 36812)]]] -* [[[unitsml-3683,nofetch(CalConnect 36814]]] +* [[[unitsml-36814,nofetch(CalConnect 36814)]]] * [[[parg,nofetch(PARG grammar language and artifact format)]]] (parsanol/docs) * [[[cc36810,nofetch(CalConnect 36810)]]], _AsciiUnits syntax specification_ (v1 base standard, frozen 2025-03; historical) diff --git a/sources/unitsml-36818-xml-usage/sections/02-normrefs.adoc b/sources/unitsml-36818-xml-usage/sections/02-normrefs.adoc index e497b0a..745a80f 100644 --- a/sources/unitsml-36818-xml-usage/sections/02-normrefs.adoc +++ b/sources/unitsml-36818-xml-usage/sections/02-normrefs.adoc @@ -2,8 +2,8 @@ == Normative references * [[[unitsml-36812,nofetch(CalConnect 36812)]]] -* [[[unitsml-3683,nofetch(CalConnect 36814]]] -* [[[unitsml-3684,nofetch(CalConnect 36815]]] -* [[[unitsml-3685,nofetch(CalConnect 36816]]] +* [[[unitsml-36814,nofetch(CalConnect 36814)]]] +* [[[unitsml-36815,nofetch(CalConnect 36815)]]] +* [[[unitsml-36816,nofetch(CalConnect 36816)]]] * [[[xsd-spec,nofetch(generated XSD specification)]]] (base document) * [[[unitsml-xsd,nofetch(UnitsML 1.0 XSD)]]] (unitsml-v1.0.xsd) diff --git a/sources/unitsml-36819-conformance/sections/02-normrefs.adoc b/sources/unitsml-36819-conformance/sections/02-normrefs.adoc index a870164..ff4556d 100644 --- a/sources/unitsml-36819-conformance/sections/02-normrefs.adoc +++ b/sources/unitsml-36819-conformance/sections/02-normrefs.adoc @@ -2,7 +2,7 @@ == Normative references * [[[unitsml-36812,nofetch(CalConnect 36812)]]] -* [[[unitsml-3682,nofetch(CalConnect 36813]]] +* [[[unitsml-36813,nofetch(CalConnect 36813)]]] * [[[tested-parts,nofetch(tested parts)]]] — CalConnect 36814–7 and the Plurimath series parts under test * [[[jcgm101,JCGM 101:2008]]], Clause 7.9 (adaptive procedure) * [[[jcgm106,JCGM 106:2012]]] (decision vectors) diff --git a/sources/unitsml-36819-conformance/sections/98-bibliography.adoc b/sources/unitsml-36819-conformance/sections/98-bibliography.adoc index 04581e6..7643178 100644 --- a/sources/unitsml-36819-conformance/sections/98-bibliography.adoc +++ b/sources/unitsml-36819-conformance/sections/98-bibliography.adoc @@ -4,4 +4,4 @@ * [[[jcgm101-t10,JCGM 101:2008]]], Table 10 (§9.5 results) * [[[jcgm106-t1,JCGM 106:2012]]], Table 1 * [[[gum5,nofetch(GUM-5:2026)]]], Examples -* [[[testsuite,nofetch(unitsml/unitsml-testsuite#1)]]] +* [[[testsuite-1,nofetch(unitsml/unitsml-testsuite pull 1)]]], the shared render corpus