0.01
The project is in a healthy, maintained state
Metanorma for UN documents. Formerly known as metanorma-unece
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 2.14
~> 13.0
~> 3.6
~> 1.5.2
= 2.4.0
~> 0.15
~> 0.9
>= 0

Runtime

 Project Readme

Metanorma processor for UN documents

(Formerly known as metanorma-unece)

THIS GEM IS NO LONGER MAINTAINED AS OF 20241009

Gem Version

Build Status Code Climate Pull Requests Commits since latest

Functionality

This gem processes Metanorma documents following a template for generating UN International Standards.

The gem currently inherits from the Metanorma-Standoc gem, and aligns closely to it. Refer to the ISO gem documentation for guidance, including the Authoring Guide.

The following outputs are generated.

  • an XML representation of the document, intended as a document model for UN International Standards.

  • The XML representation is processed in turn to generate the following outputs as end deliverable UN standard drafts.

    • HTML

    • Word

Note
AsciiMathML is to be used for mathematical formatting. The gem uses the Ruby AsciiMath parser, which is syntactically stricter than the common MathJax processor; if you do not get expected results, try bracketing terms your in AsciiMathML expressions.

Usage

The preferred way to invoke this gem is via the metanorma script:

$ metanorma --type un a.adoc                   # output HTML and PDF
$ metanorma --type un --extensions html a.adoc # output just HTML
$ metanorma --type un --extensions pdf a.adoc  # output just PDF
$ metanorma --type un --extensions xml a.adoc  # output UN Metanorma XML

The gem translates the document into UN Metanorma XML format, and then validates its output against the UN Metanorma XML document model; errors are reported to console against the XML, and are intended for users to check that they have provided all necessary components of the document.

The gem then converts the XML into HTML and PDF.

Installation

macOS

If you are using macOS, the https://github.com/metanorma/metanorma-macos-setup repository has instructions on setting up your machine to run Metanorma scripts such as this one. You need only run the following in a Terminal console:

$ bash <(curl -s https://raw.githubusercontent.com/metanorma/metanorma-macos-setup/master/metanorma-setup)
$ gem install metanorma-un
$ gem install metanorma-cli

Testing

Since this software is still in development it is not yet as mature as the other standards we support. We plan to fully complete support if there is interest.

The easiest way to try out is using a Mac. It takes a little bit more work on a Windows machine through the platform-independent Docker container (see the Metanorma Quickstart guide) , but it is doable.

The current examples of UN documents encoded using Metanorma is provided in https://github.com/metanorma/mn-samples-un

(Please run the 2-line macOS setup script prior to the following)

First, use Git to clone the code and documents:

git clone https://github.com/metanorma/mn-samples-un/

Then, install all dependencies with this command:

bundle

Next, run the compilation toolchain:

make all

Then you will see the files generated, including HTML and Word Doc.

The easiest way to start a new document is to copy one of the two samples and modify them.

Documentation

Data Models

The UN Standard Document format is an instance of the StandardDocument model. Details of this general model can be found on its page.

Details of the UN modifications to this general model can be found in the UN model repository.

Examples

  • Example documents are avalable at the mn-samples-un repository.