Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,4 @@ TODO*
!TODO.astro/
!TODO.improve-website/
src/content/library/api-reference-ruby.md
src/content/library/api-reference-ts.md
12 changes: 12 additions & 0 deletions scripts/fetch-api-reference.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,18 @@ description: "${description}"

`;

// the pubid version badge reads this at build time
mkdirSync("src/data", { recursive: true });
const versionUrl = "https://raw.githubusercontent.com/pubid/pubid/main/lib/pubid/version.rb";
const versionRes = await fetch(versionUrl);
const versionText = await versionRes.text();
const versionMatch = versionText.match(/VERSION\s*=\s*"([^"]+)"/);
writeFileSync(
"src/data/pubid-version.json",
JSON.stringify({ version: versionMatch ? versionMatch[1] : null, fetched_at: new Date().toISOString() }, null, 2) + "\n",
);
console.log("pubid version:", versionMatch ? versionMatch[1] : "NOT FOUND");

mkdirSync("src/content/library", { recursive: true });
for (const { repo, file, out, title, description } of SOURCES) {
const url = `https://raw.githubusercontent.com/${repo}/main/${file}`;
Expand Down
31 changes: 31 additions & 0 deletions src/components/VersionBadge.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
import data from '../data/pubid-version.json'

const { version, fetched_at } = data
const date = fetched_at ? new Date(fetched_at).toISOString().split('T')[0] : ''
---

<div class="version-badge" title={`Exported from pubid-ruby v${version ?? '?'} at ${date}`}>
<span class="vb-label">pubid-ruby</span>
{version && <span class="vb-version">v{version}</span>}
{date && <span class="vb-sep">&middot;</span>}
{date && <span class="vb-date">{date}</span>}
</div>

<style>
.version-badge {
display: inline-flex;
align-items: center;
gap: 0.5rem;
padding: 0.35rem 0.75rem;
border: 1px solid var(--color-border, #d4d4d8);
border-radius: 0.5rem;
font-size: 0.85rem;
color: var(--color-foreground, #3f3f46);
background: var(--color-background-muted, #fafafa);
}
.version-badge :global(.vb-label) { font-weight: 600; }
.version-badge :global(.vb-version) { font-family: var(--font-mono, monospace); }
.version-badge :global(.vb-sep) { opacity: 0.5; }
.version-badge :global(.vb-date) { opacity: 0.7; }
</style>
10 changes: 1 addition & 9 deletions src/content/about/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,7 @@ This pattern extends across all supported publishers: every PubID can render as
| **Reference Library** | Ruby gem implementing all schemas with parse/render/URN support |
| **This Website** | Documentation, interactive playground, and schema registry |

<script setup>
import VersionBadge from './.vitepress/theme/components/VersionBadge.vue'
</script>

**Data pipeline:** Publisher schema data on this site is exported directly from the [pubid-ruby](https://github.com/metanorma/pubid) reference implementation. The export version is:

<div style="margin:0.5rem 0;">
<VersionBadge />
</div>
**Data pipeline:** Publisher schema data on this site is exported directly from the [pubid-ruby](https://github.com/pubid/pubid) reference implementation, fetched at build time from its main branch — see the generated [API Reference — Ruby](/library/api-reference-ruby/) for exactly what the current export reflects.

## NIST: The First Adopter

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@ description: "PubID library documentation."

The PubID Ruby gem provides parsing, rendering, and URN generation for all supported publisher schemes.

<script setup>
import VersionBadge from '../.vitepress/theme/components/VersionBadge.vue'
</script>
import VersionBadge from '../../components/VersionBadge.astro'

<div style="margin-bottom:1.5rem;">
<VersionBadge />
Expand Down
4 changes: 2 additions & 2 deletions src/content/specs/iec-urn-specification.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ edition plus its amendments).
| Within a field (part numbers, date components, copublishers, languages)
| `urn:iec:std:iec-iso:60601-1-1`

| `||`
| `\|\|`
| Between base edition and adjunct (reference to adjunct itself)
| `urn:iec:std:iec:60601-1-1:2015-10:::fr\|\|amd:1:2017-01`

Expand Down Expand Up @@ -528,7 +528,7 @@ Global.

| Supplement model
| Appended with `:` separator
| Adjunct model with `||` (adjunct ref) and `_` (consolidation)
| Adjunct model with `\|\|` (adjunct ref) and `_` (consolidation)

| Relation marker
| Not applicable
Expand Down
3 changes: 0 additions & 3 deletions src/content/specs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
title: "URN Specifications"
---

<script setup>
</script>

# URN Specifications

Every PubID maps to a canonical URN (Uniform Resource Name) for machine interchange. These specifications define the URN namespaces for each standards publisher.
Expand Down
16 changes: 8 additions & 8 deletions src/content/specs/iso-urn-specification.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -243,9 +243,9 @@ project iteration.
stage-00.00:: Preliminary work item
stage-20.00:: New work item proposal
stage-30.00:: Committee draft
stage-40.00:: Draft (enquiry) -- DIS for an IS project, DAM for an
stage-40.00:: Draft (enquiry) -- DIS for an IS project, DAM for an +
amendment project, DTS for a TS project, ...
stage-50.00:: Final draft -- FDIS for an IS project, FDAM for an
stage-50.00:: Final draft -- FDIS for an IS project, FDAM for an +
amendment project, FDTS for a TS project, ...
stage-60.00:: Published (not emitted for published documents)

Expand Down Expand Up @@ -298,14 +298,14 @@ The slots after the type token, in order:

[horizontal]
supplnumber:: the supplement's own number (`Amd 1` carries 1)
supplyear:: the supplement's own publication year (`Amd 1:2007`) --
supplyear:: the supplement's own publication year (`Amd 1:2007`) -- +
added by this specification; RFC 5141 has no slot for it
supplversion:: the corrected version of the published supplement
(`v2` = version corrected once); omitted when not stated, where the
supplversion:: the corrected version of the published supplement +
(`v2` = version corrected once); omitted when not stated, where the +
reference is to the highest version per RFC 5141
stage:: optionally, the supplement's own stage immediately BEFORE the
type token (`stage-40.00:amd:1`) -- added by this specification; RFC
5141's single `status` slot cannot separate a draft amendment from its
stage:: optionally, the supplement's own stage immediately BEFORE the +
type token (`stage-40.00:amd:1`) -- added by this specification; RFC +
5141's single `status` slot cannot separate a draft amendment from its +
published base

==== addition
Expand Down
4 changes: 4 additions & 0 deletions src/data/pubid-version.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"version": "2.0.0.pre.alpha.53",
"fetched_at": "2026-10-24T00:46:13.344Z"
}
Loading