0.01
No release in over 3 years
asciidoctor-gb lets you write GB standards (Chinese national standards) in AsciiDoc syntax. This gem is in active development.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.15
~> 9.1
~> 2.14
~> 12.0
~> 3.6
~> 0.50
~> 0.15
~> 0.9

Runtime

~> 0.0.1
~> 0.2.2
~> 0.8.8
 Project Readme

metanorma-gb: Authoring Chinese standards (GuoBiao, sector…​) in AsciiDoc

Gem Version Build Status Code Climate Pull Requests Commits since latest

THIS GEM IS FROZEN AND WILL NO LONGER BE ACTIVELY MAINTAINED

Functionality

This gem processes Metanorma documents following the Metanorma model for generating Guobiao standards (Chinese national standards).

This gem implements the GbDoc data model, which inherits from StandardDocument document model.

The code of this gem inherits from metanorma-iso, a gem used to generate ISO standards using Asciidoc.

The two standards formats are closely aligned. Refer to the ISO gem for guidance, including IsoDoc: Guidance for authoring

The gem can also be used to generate Chinese local or sector standards, which have the same format; the gem formats the title page to have the correct metadata displayed.

The following outputs are generated.

  • (Optional) An HTML preview generated directly from the Asciidoctor document, using native Asciidoc formatting.

    • 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 bracketting terms your in AsciiMathML expressions.

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

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

    • HTML

    • Word

The Word output of the gem is strictly aligned to the GB/T 1.1 specification, including the fonts and font sizes prescribed, and the measurements for element positioning on the page.

Usage

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

$ metanorma --type gb a.adoc                   # output HTML and DOC
$ metanorma --type gb --extensions html a.adoc # output just HTML
$ metanorma --type gb --extensions doc a.adoc  # output just DOC
$ metanorma --type gb --extensions xml a.adoc  # output GB XML

The gem translates the document into GB XML format, and then validates its output against the GB 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 DOC.

The gem can also be invoked directly within asciidoctor, though this is deprecated:

$ asciidoctor -b gb -r 'metanorma-gb' a.adoc

Installation

If you are using a Mac, 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-gb

Examples

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