Skip to content

Repository files navigation

OIML Encoding Guidelines for Publications in NISO STS

OIML X 999:2026 — the OIML profile of NISO STS, defining how OIML publications (R/B/D/G/E) are encoded in NISO STS.

Build

bundle install
bundle exec metanorma compile sources/sts-guidelines/document.adoc

Outputs (in sources/sts-guidelines/): document.xml, document.presentation.xml, document.pdf, document.rxl.

The :mn-document-class: oiml flavor is provided by the released metanorma-taste gem (a metanorma-core dependency), so the document compiles with the standard Metanorma toolchain — no unreleased gems needed.

Site HTML (metanorma-document)

The HTML for the site is generated from the presentation XML with the metanorma-document typed-model renderer (not the isodoc HTML). metanorma-document >= 0.2.11 is required (earlier releases render an empty body). It runs on the pubid 2.0 / relaton prerelease line, which cannot share a bundle with the released metanorma-cli stack (metanorma-standoc pins relaton-cli ~> 2.1.0, and RubyGems never satisfies a non-prerelease requirement with a prerelease version) — so it has its own Gemfile, Gemfile.renderer (used by CI the same way):

git clone --depth 1 https://github.com/metanorma/metanorma-oiml vendor/metanorma-oiml
BUNDLE_GEMFILE=Gemfile.renderer bundle install
BUNDLE_GEMFILE=Gemfile.renderer bundle exec ruby -e \
  'require "metanorma/document"; doc = Metanorma::OimlDocument::Root.from_xml(File.read(ARGV[0])); File.write(ARGV[1], Metanorma::Html::Generator.generate(doc))' \
  sources/sts-guidelines/document.presentation.xml sources/sts-guidelines/document.html

Generating STS from Metanorma Presentation XML

The metanorma-oiml gem provides a converter that transforms OIML Metanorma presentation XML into OIML NISO STS XML.

API

require "metanorma/oiml/sts"

# Convert presentation XML string to STS XML
sts_xml = Metanorma::Oiml::Sts.convert(presentation_xml_string)

# Render STS XML to HTML (Liquid-based, OIML-branded, self-contained)
sts_html = Metanorma::Oiml::Sts::HtmlRenderer.render(sts_xml)

CLI

# From metanorma-oiml gem
oiml-sts convert sources/sts-guidelines/document.presentation.xml output.sts.xml
# Add --validate to check the OIML X 999 Clause 6 rules

STS HTML Rendering

The Liquid renderer converts STS XML to a self-contained branded HTML page (inline CSS and logo, no external assets). Templates and the stylesheet can be overridden without code changes: HtmlRenderer::Ruby.new(templates_dir:, assets_dir:).

About

OIML encoding specifications for publications in NISO STS

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages