Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
b3f1317
Replace Jekyll site with Vite+Tailwind schema browser
ronaldtse Apr 27, 2026
3cbc463
CI: build lutaml-xsd frontend before SPA generation
ronaldtse Apr 27, 2026
10e459a
Use lutaml-xsd 1.0.9 from rubygems instead of GitHub
ronaldtse Apr 27, 2026
ef706e8
CI: use lutaml-xsd from GitHub ref v1.0.9 and build its frontend
ronaldtse Apr 27, 2026
7fe6da4
CI: use lutaml-xsd SVG fix branch until new gem release
ronaldtse Apr 27, 2026
8740dd7
Bump bundler cache version to force fresh gem resolution
ronaldtse Apr 27, 2026
8476d1c
Fix UnitsML v1.0 LXR build: map xml.xsd import to local file
ronaldtse Apr 27, 2026
8635a7b
Fix UnitsML v1.0 build: bundle xml.xsd in tracked schemas-external dir
ronaldtse Apr 27, 2026
292a8c3
Simplify LXR build: rely on config file build settings instead of CLI…
ronaldtse Apr 27, 2026
a7d4fb5
CI: add debug output for schemas-external and v1.0 config
ronaldtse Apr 27, 2026
3cf21fb
CI: add debug step to inspect v1.0 schema parsing
ronaldtse Apr 27, 2026
cd314a3
CI: use bundle exec for debug ruby step
ronaldtse Apr 27, 2026
5babe5e
CI: add more debug info for v1.0 parse failure
ronaldtse Apr 27, 2026
8333f6a
CI: list schemas directory to find v1.0 XSD
ronaldtse Apr 27, 2026
cf47cbd
Move xml.xsd into schemas submodule, remove schemas-external dir
ronaldtse Apr 27, 2026
478b5d5
Add empty .lycheeignore to fix link checker workflow
ronaldtse Apr 27, 2026
66f9caf
Fix link checker: add --root-dir for resolving local asset links
ronaldtse Apr 27, 2026
fa9282b
Switch to lutaml-xsd 1.1.0 from rubygems (SVG diagram fix released)
ronaldtse Apr 27, 2026
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
54 changes: 20 additions & 34 deletions .github/workflows/build_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,15 @@ name: build_deploy
on:
push:
branches:
- main
# - staging
- main
pull_request:
repository_dispatch:
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: false
Expand All @@ -25,53 +20,44 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Setup prerequisites
run: |
sudo apt-get update
sudo apt-get install -y curl make libxml2-dev libxslt-dev libnode-dev node-gyp npm openssl xsltproc

- name: Setup snaps
run: |
sudo snap install aws-cli --classic

- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: true

- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '2.7'
ruby-version: '3.3'
bundler-cache: true
cache-version: 0 # Increment this number if you need to re-download cached gems
cache-version: 3

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: '20'

- name: Update submodules
run: |
make update-init update-modules
run: make update-init update-modules

- name: Use Node
uses: actions/setup-node@v1
with:
node-version: '14.x'
- name: Install frontend deps
run: cd frontend && npm install

- name: Setup npm
run: |
npm install
- name: Build lutaml-xsd frontend
run: cd "$(bundle show lutaml-xsd)/frontend" && npm install && npm run build

- name: Setup Pages
id: pages
uses: actions/configure-pages@v3
uses: actions/configure-pages@v5

- name: Build site
run: |
make _site
run: make all

- name: Upload artifact
# Automatically uploads an artifact from the './_site' directory by default
uses: actions/upload-pages-artifact@v2
uses: actions/upload-pages-artifact@v3
with:
path: site

# Deployment job
deploy:
environment:
name: github-pages
Expand All @@ -82,4 +68,4 @@ jobs:
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
uses: actions/deploy-pages@v4
60 changes: 21 additions & 39 deletions .github/workflows/links.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,68 +3,50 @@ name: links
on:
push:
branches:
- main
- staging
- main
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
link_checker:
runs-on: ubuntu-latest
steps:
- name: Setup prerequisites
run: |
sudo apt-get update
sudo apt-get install -y curl make libxml2-dev libxslt-dev libnode-dev node-gyp npm openssl xsltproc

- name: Setup snaps
run: |
sudo snap install aws-cli --classic

- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: true

- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '2.7'
ruby-version: '3.3'
bundler-cache: true
cache-version: 0 # Increment this number if you need to re-download cached gems

- name: Update submodules
run: |
make update-init update-modules
cache-version: 3

- name: Use Node
uses: actions/setup-node@v1
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: '14.x'
node-version: '20'

- name: Setup npm
run: |
npm install
- name: Update submodules
run: make update-init update-modules

- name: Install frontend deps
run: cd frontend && npm install

- name: Setup Pages
id: pages
uses: actions/configure-pages@v3
- name: Build lutaml-xsd frontend
run: cd "$(bundle show lutaml-xsd)/frontend" && npm install && npm run build

- name: Build site
run: |
make _site
run: make all

- name: Link Checker
uses: lycheeverse/lychee-action@v1.2.0
uses: lycheeverse/lychee-action@v2
with:
args: --verbose --no-progress --exclude-file .lycheeignore -- _site/**/*.html
args: --verbose --no-progress --exclude-file .lycheeignore --root-dir site -- site/**/*.html
fail: true
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

# - name: Create Issue From File
# uses: peter-evans/create-issue-from-file@v2
# with:
# title: Link Checker Report
# content-filepath: ./lychee/out.md
# labels: report, automated issue
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8 changes: 6 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
_site
.DS_Store
build_source
Gemfile.lock
build/
site/
node_modules/
frontend/node_modules/
schemas_index.json
unitsml.lxr
1 change: 1 addition & 0 deletions .lycheeignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Patterns to exclude from link checking
68 changes: 68 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

## Project Overview

**schema.unitsml.org** — an interactive schema browser site for UnitsML XML schemas (OASIS standard for units of measure in XML). The site consists of:
- A custom **index page** (Vite + Tailwind CSS) listing all available schema versions
- Per-schema **interactive SPA browsers** generated by lutaml-xsd

Architecture: **1 schema → 1 LXR package → 1 SPA HTML file**, all listed on the index page.

## Build Commands

```bash
# Full build (index page + all schema SPAs)
make all

# Build just the index page
make site/index.html

# Build a single schema SPA
make site/unitsml-v1.0.html

# Local dev server on http://localhost:4000
make serve

# Clean all build artifacts
make clean

# Initialize/update git submodules (schemas)
make update-init update-modules
```

## Architecture

```
schemas/ → Git submodule (unitsml/schemas), contains XSD files
unitsml/*.xsd → UnitsML schema versions (v0.9 through v1.0)
unitsmllite/*.xsd → UnitsML-Lite schema

configs/ → Auto-generated per-schema lutaml-xsd configs (from generate_configs.rb)
build/ → Intermediate LXR packages
site/ → Final deployable output
index.html → Custom index page (Vite + Tailwind)
assets/ → JS/CSS for index page
logo-unitsml.svg → UnitsML logo
unitsml-*.html → Per-schema SPA browsers (self-contained)
unitsmllite-*.html

frontend/ → Vite + Tailwind CSS project for the index page
src/main.js → Schema data + card rendering
src/style.css → Tailwind config + custom animations
vite.config.js → Builds to ../site/

generate_configs.rb → Generates per-schema config YAML files + schemas_index.json
Gemfile → Ruby deps (lutaml-xsd, lutaml-model from GitHub main, moxml, canon)
Makefile → Build orchestration
```

## Key Details

- **lutaml-xsd** generates interactive Vue SPAs from XSD files via LXR packages
- The lutaml-xsd frontend must be pre-built (`frontend/dist/` in the gem) — the published gem may not include it; build manually if needed: `cd $(bundle show lutaml-xsd)/frontend && npm install && npm run build`
- **xsdvi** gem generates SVG diagrams for the SPA (may show "SVG is empty!" warnings — non-blocking)
- The `schemas` git submodule must be initialized before building
- lutaml-xsd depends on `lutaml-model` from GitHub main (not compatible with Jekyll's liquid ~> 4.0)
- Brand colors: navy `#2d2c69`, teal `#30dfc0`, light blue `#57a0fe`
46 changes: 4 additions & 42 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,44 +1,6 @@
source "https://rubygems.org"

# gem "metanorma-cli"
# gem "metanorma-csd", path: "~/src/relaton-cli"
# gem "metanorma-cli", path: "~/src/metanorma-cli"
# gem "relaton-cli", git: "https://github.com/riboseinc/relaton-cli"
# gem "relaton-cli", path: "~/src/relaton-cli"

# __________________ JEKYLL BELOW __________________

# Hello! This is where you manage which Jekyll version is used to run.
# When you want to use a different version, change it below, save the
# file and run `bundle install`. Run Jekyll with `bundle exec`, like so:
#
# bundle exec jekyll serve
#
# This will help ensure the proper Jekyll version is running.
# Happy Jekylling!
gem "jekyll", "~> 4.1"

# This is the default theme for new Jekyll sites. You may change this to anything you like.
gem "jekyll-theme-isotc211"

# If you want to use GitHub Pages, remove the "gem "jekyll"" above and
# uncomment the line below. To upgrade, run `bundle update github-pages`.
# gem "github-pages", group: :jekyll_plugins

# If you have any plugins, put them here!
group :jekyll_plugins do
gem "jekyll-feed"
gem "jekyll-data"
gem "jekyll-plugin-frontend-build"
gem "jekyll-theme-isotc211-helpers"
gem "jekyll-asciidoc"
end

# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem "tzinfo-data", platforms: [:mingw, :mswin, :x64_mingw, :jruby]

# Performance-booster for watching directories on Windows
gem "wdm", "~> 0.1.0" if Gem.win_platform?

gem "webrick"

gem "lutaml-xsd", "~> 1.1"
gem "lutaml-model", github: "lutaml/lutaml-model", branch: "main"
gem "moxml"
gem "canon"
54 changes: 38 additions & 16 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,26 +1,48 @@
SHELL := /bin/bash

all: _site
CONFIGS := $(wildcard configs/*.yml)
LXR_FILES := $(patsubst configs/%.yml,build/%.lxr,$(CONFIGS))
SPA_FILES := $(patsubst configs/%.yml,site/%.html,$(CONFIGS))

clean:
rm -rf _site build_source
all: site/index.html site/logo-unitsml.svg $(SPA_FILES)

# Generate per-schema config files and index JSON
configs: generate_configs.rb
ruby generate_configs.rb

# Build a single LXR package from a config
build/%.lxr: configs/%.yml
mkdir -p build
bundle exec lutaml-xsd build from-config $< \
--output $@

distclean: clean
$(MAKE) -C schemas distclean
# Generate a single SPA HTML from an LXR package
site/%.html: build/%.lxr
mkdir -p site
bundle exec lutaml-xsd spa $< \
--mode inlined \
--output $@

docs/unitsml/unitsml-v1.0/index.html:
$(MAKE) -C schemas
# Build the custom index page (Vite + Tailwind)
site/index.html: frontend/src/main.js frontend/src/style.css frontend/index.html frontend/package.json
cd frontend && npm install --silent && npm run build

build_source: docs/unitsml/unitsml-v1.0/index.html
mkdir -p $@; \
cp -a source/* build_source; \
cp -a schemas/* build_source;
# Copy logo to site
site/logo-unitsml.svg: source/assets/logo-unitsml-noninverted.svg
mkdir -p site
cp $< $@

_site: build_source
bundle exec jekyll build
serve: all
cd site && python3 -m http.server 4000

stop:
lsof -ti:4000 | xargs kill -9 2>/dev/null || true

clean:
rm -rf build site schemas_index.json

serve: _site
bundle exec jekyll serve --trace
clean-spa:
rm -f site/unitsml-*.html site/unitsmllite-*.html

update-init:
git submodule update --init
Expand All @@ -29,4 +51,4 @@ update-modules:
git submodule foreach git checkout main; \
git submodule foreach git pull origin main

.PHONY: all clean distclean serve update-init update-modules
.PHONY: all configs clean clean-spa serve stop update-init update-modules
Loading
Loading