Gem Version Build Status Code Climate Pull Requests Commits since latest

Purpose

The sts2mn Ruby gem is a wrapper around the Java sts2mn which converts NISO STS and ISOSTS into Metanorma XML and AsciiDoc files.

This gem is used to provide sts2mn.jar with mirrored version numbers, to allow Ruby code to easily refer to the desired sts2mn version as dependencies.

Installation

gem install sts2mn

Or include it in your gemspec.

Usage

require 'sts2mn'
Sts2mn.convert(input: 'test/sts.xml')
# => generates 'test/sts.adoc', in Metanorma AsciiDoc

Sts2mn.convert(input: 'test/sts.xml', output: 'another/path/mn.xml', format: 'xml')
# => generates 'another/path/mn.xml' in Metanorma XML

Sts2mn.convert(input: 'test/sts.xml', output: 'another/path/mn.adoc', format: 'adoc')
# => generates 'another/path/mn.adoc' in Metanorma AsciiDoc

Sts2mn.split_bibdata('test/sts.xml')
# => generates 'test/sts.rxl' (Relaton XML) and 'test/mn.adoc' (Metanorma AsciiDoc)

Updating the gem

Update lib/sts2mn/version.rb to the desired version of sts2mn.

Run rake to download the bin/sts2mn.jar file:

rm -f bin/sts2mn.jar
rake bin/sts2mn.jar

Then release the gem with rake release.