Skip to content

Commit

Permalink
blog post (part 2) about changes in mnconvert added, #647
Browse files Browse the repository at this point in the history
  • Loading branch information
Intelligent2013 authored and kwkwan committed Mar 5, 2024
1 parent dead7d2 commit 72ca784
Show file tree
Hide file tree
Showing 2 changed files with 254 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,254 @@
---
layout: post
title: "Changes in the mnconvert tool in accordance with NISO STS 1.0 – IEC/ISO Coding Guidelines (part 2)"
date: 2023-01-10
categories: documentation
authors:
-
name: Ronald Tse
email: [email protected]
social_links:
- https://github.com/ronaldtse
-
name: Alexander Dyuzhev
email: [email protected]
social_links:
- https://www.linkedin.com/in/alexander-dyuzhev/
- https://github.com/Intelligent2013/

excerpt: >-
Metanorma's mnconvert tool produces NISO STS XML in accordance with
NISO STS 1.0 – IEC/ISO Coding Guidelines.
---

== Introduction

This is a second part of the changes in the mnconvert tool. First part please see in
https://www.metanorma.org/blog/2023-01-08-mnconvert-supports-iec-iso-coding-guidelines-part1/[Changes in the mnconvert tool in accordance with NISO STS 1.0 – IEC/ISO Coding Guidelines (part 1)]

Metanorma software produces data in own Metanorma XML format.
The IEC/ISO members uses NISO STS XML format in the workflow processes for
standards-type documents in XML. Metanorma's https://github.com/metanorma/mnconvert[mnconvert tool] allows to convert
the data from Metanorma XML into NISO STS XML format.

Recently mnconvert's conversion rules updated for IEC/ISO documents conversion
in accordance with
https://www.iso.org/files/live/sites/isoorg/files/developing_standards/resources/docs/NISOSTS-guidelines-v1.0.pdf[NISO STS 1.0 – IEC/ISO Coding Guidelines]



== Abbreviation list determination

mnconvert recognizes abbreviation list if:

* preceding title contains the substring 'Abbrev'

or

* definition term `@id` starts with the prefix `abb-` or `abb_`

and sets the attribute `@list-type="abbreviation"`.

== Part of speech support

mnconvert now supports `tbx:partOfSpeech` conversion.

Metanorma XML example:
[source,xml]
----
<preferred><expression>
<name>date and time representation</name>
<grammar><isAdjective>true</isAdjective></grammar></expression>
</preferred>
----

Output NISO STS XML example:
[source,xml]
----
<tbx:term>date and time representation</tbx:term>
<tbx:partOfSpeech value="adj"/>
----

== Forms of the term support

mnconvert supports these forms of the term:

* acronym

* abbreviation

* fullForm

* symbol

The support for:

* formula

* equation

will be added later.


== 'See' note support

mnconvert updated for `tbx:see` processing. Now mnconvert:

* generates `NOTE` in adoc for the element `tbx:see`, and adds prefix `See ` and suffix ` for more information.` (prefix and suffix support in `en`, `fr` and `ru` languages, see below).

[example]
====
NISO STS XML:
[source,xml]
----
<tbx:see target="sec_A"/>
----
converts to Metanorma Adoc:
[source,xml]
----
NOTE: See <<sec_A>> for more information.
----
====

* generates `tbx:see` in Metanorma XML to NISO STS XML conversion for `termnote` with the prefix `See ` and suffix ` for more information.` (prefix and suffix support in `en`, `fr` and `ru` languages, see below).

[example]
====
Metanorma XML:
[source,xml]
----
<termnote id="_">
<p id="_">See <xref target="sec_A"/> for more information.</p>
</termnote>
----
converts to NISO STS XML:
[source,xml]
----
<tbx:see target="sec_A"/>
----
====

Supported strings for prefix:

en:: `See`

fr:: `Voir`

ru:: `См.`

Supported strings for suffix:

en:: ` for more information.`

fr:: ` pour plus d'informations.`

ru:: ` для дополнительной информации.`


== Refined support for `tbx:source`

mnconvert generates `tbx:source` for ISO documents without `std` inside.

[example]
====
Before:
[source,xml]
----
<tbx:source>
<std type="dated">
<std-ref>ISO 7301:2011</std-ref>, Clause 3.1</std>
</tbx:source>
----
After:
[source,xml]
----
<tbx:source>ISO 7301:2011, Clause 3.1</tbx:source>
----
====

== Subject field support


mnconvert now converts the NISO STS XML element `tbx:subjectField` into

Metanorma Adoc
[source,asciidoc]
----
domain:[dispute resolution]
----
and

Metanorma XML:
[source,xml]
----
<domain>dispute resolution</domain>
----

into NISO STS XML
[source,xml]
----
<tbx:subjectField>dispute resolution</tbx:subjectField>
----

== Refined support for `@ref-type` in `xref`

mnconvert supports the values `xref/@ref-type`:

* `app`,

* `bibr`,

* `disp-formula`,

* `fig`,

* `fn`,

* `list`,

* `sec`,

* `table`,

* `table-fn`,

* `other`.


== Refined processing of `sup`

The tag `<sup>` around footnote number removed for IEC documents.


== Figure key support

mnconvert encodes the figure key as:

ISO:: `fig/table-wrap/table` with an attribute `@content-type="fig-index"`.

IEC:: `fig/def-list` with an attribute `@list-content="figure"`.


== Refined processing of table header cell format

mnconvert updated for Metanorma XML to NISO STS XML conversion of ISO documents - table header cell's text enclosed now in the bold element.


== Table width processing

`table/@width` processing removed for IEC document.


== Conclusion

There are more changes in the mnconvert tool, and they will be noticed in the next blog posts.

If you have a questions or suggestions, feel free to file an issue at
https://github.com/metanorma/mnconvert[mnconvert repo].

0 comments on commit 72ca784

Please sign in to comment.