Skip to content

Commit

Permalink
Merge pull request #152 from metanorma/updates
Browse files Browse the repository at this point in the history
Updates
  • Loading branch information
Intelligent2013 authored Apr 4, 2024
2 parents 0da2ee8 + 7935c0a commit 4bbcd29
Show file tree
Hide file tree
Showing 7 changed files with 64 additions and 42 deletions.
56 changes: 28 additions & 28 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ You will need the `maven` build tool and `make`.

[source,sh]
----
java -Xss5m -jar target/stepmod2mn-1.38.jar <XML-FileName>
java -Xss5m -jar target/stepmod2mn-1.39.jar <XML-FileName>
----

e.g.

[source,sh]
----
java -Xss5m -jar target/stepmod2mn-1.38.jar data/resource_docs/draughting_elements/resource.xml
java -Xss5m -jar target/stepmod2mn-1.39.jar data/resource_docs/draughting_elements/resource.xml
----

NOTE: resulted AsciiDoc found in data/resource_docs/draughting_elements/document.adoc
Expand All @@ -34,28 +34,28 @@ NOTE: resulted AsciiDoc found in data/resource_docs/draughting_elements/document

[source,sh]
----
java -Xss5m -jar target/stepmod2mn-1.38.jar <XML-FileName> [--output <AsciiDoc-FileName>]
java -Xss5m -jar target/stepmod2mn-1.39.jar <XML-FileName> [--output <AsciiDoc-FileName>]
----

e.g.

[source,sh]
----
java -Xss5m -jar target/stepmod2mn-1.38.jar data/resource_docs/draughting_elements/resource.xml --output result_dir/draughting_elements/document.adoc
java -Xss5m -jar target/stepmod2mn-1.39.jar data/resource_docs/draughting_elements/resource.xml --output result_dir/draughting_elements/document.adoc
----

=== Convert all resource.xml and module.xml in the specified folder and sub-folders into the Metanorma AsciiDoc format:

[source,sh]
----
java -Xss5m -jar target/stepmod2mn-1.38.jar <Input-folder>
java -Xss5m -jar target/stepmod2mn-1.39.jar <Input-folder>
----

e.g.

[source,sh]
----
java -Xss5m -jar target/stepmod2mn-1.38.jar data/
java -Xss5m -jar target/stepmod2mn-1.39.jar data/
----

NOTE: the result AsciiDocs will be saved in the folder with the source resource.xml and module.xml files.
Expand All @@ -65,57 +65,57 @@ NOTE: the result AsciiDocs will be saved in the folder with the source resource.

[source,sh]
----
java -Xss5m -jar target/stepmod2mn-1.38.jar <Input-folder> [--output <Output-folder>]
java -Xss5m -jar target/stepmod2mn-1.39.jar <Input-folder> [--output <Output-folder>]
----

e.g.

[source,sh]
----
java -Xss5m -jar target/stepmod2mn-1.38.jar data/ --output documents/
java -Xss5m -jar target/stepmod2mn-1.39.jar data/ --output documents/
----


=== Convert all resource.xml and module.xml in the specified folder and sub-folders into the Metanorma AsciiDoc format, except specified documents:

[source,sh]
----
java -Xss5m -jar target/stepmod2mn-1.38.jar <Input-folder> [--exclude <documents list>]
java -Xss5m -jar target/stepmod2mn-1.39.jar <Input-folder> [--exclude <documents list>]
----

e.g.

[source,sh]
----
java -Xss5m -jar target/stepmod2mn-1.38.jar data/ --exclude "machining_features"
java -Xss5m -jar target/stepmod2mn-1.39.jar data/ --exclude "machining_features"
----

=== Convert only specified documents resource.xml and module.xml in the specified folder and sub-folders into the Metanorma AsciiDoc format:

[source,sh]
----
java -Xss5m -jar target/stepmod2mn-1.38.jar <Input-folder> [--include-only <documents list>]
java -Xss5m -jar target/stepmod2mn-1.39.jar <Input-folder> [--include-only <documents list>]
----

e.g.

[source,sh]
----
java -Xss5m -jar target/stepmod2mn-1.38.jar data/ --include-only "fundamentals_of_product_description_and_support kinematics"
java -Xss5m -jar target/stepmod2mn-1.39.jar data/ --include-only "fundamentals_of_product_description_and_support kinematics"
----

=== Generate Metanorma collection files (metanorma.yml and collection.yml) for the documents specified in the publication index xml file in the tags 'resource_docs' and 'modules':

[source,sh]
----
java -Xss5m -jar target/stepmod2mn-1.38.jar <Publication-Index-XML-FileName>
java -Xss5m -jar target/stepmod2mn-1.39.jar <Publication-Index-XML-FileName>
----

e.g.

[source,sh]
----
java -Xss5m -jar target/stepmod2mn-1.38.jar publication/part1000/CR_PMI_5/publication_index.xml
java -Xss5m -jar target/stepmod2mn-1.39.jar publication/part1000/CR_PMI_5/publication_index.xml
----

NOTE: the Metanorma collection files .yml will be saved in the 3 level up folder (usually, source repository's root folder).
Expand All @@ -125,14 +125,14 @@ and save them into the output folder:

[source,sh]
----
java -Xss5m -jar target/stepmod2mn-1.38.jar <Publication-Index-XML-FileName> [--output <Output-folder>]
java -Xss5m -jar target/stepmod2mn-1.39.jar <Publication-Index-XML-FileName> [--output <Output-folder>]
----

e.g.

[source,sh]
----
java -Xss5m -jar target/stepmod2mn-1.38.jar iso-10303-srl/iso-10303-stepmod-wg12/publication/part1000/CR_PMI_5/publication_index.xml --output iso-10303-srl/
java -Xss5m -jar target/stepmod2mn-1.39.jar iso-10303-srl/iso-10303-stepmod-wg12/publication/part1000/CR_PMI_5/publication_index.xml --output iso-10303-srl/
----

NOTE: the output folder should contains the folder with the generated .adoc (usually, 'documents'). You can specify this folder obviously by the parameter '--input-documents':
Expand All @@ -141,7 +141,7 @@ e.g.

[source,sh]
----
java -Xss5m -jar target/stepmod2mn-1.38.jar iso-10303-srl/iso-10303-stepmod-wg12/publication/part1000/CR_PMI_5/publication_index.xml --output iso-10303-srl/CR_PMI_5 --input-documents iso-10303-srl/documents
java -Xss5m -jar target/stepmod2mn-1.39.jar iso-10303-srl/iso-10303-stepmod-wg12/publication/part1000/CR_PMI_5/publication_index.xml --output iso-10303-srl/CR_PMI_5 --input-documents iso-10303-srl/documents
----

NOTE: the Metanorma collection files (.yml) will be saved in the folder 'iso-10303-srl/CR_PMI_5' and the references point to the documents in the folder iso-10303-srl/documents.
Expand All @@ -151,14 +151,14 @@ NOTE: the Metanorma collection files (.yml) will be saved in the folder 'iso-103

[source,sh]
----
java -Xss5m -jar target/stepmod2mn-1.38.jar <Publication-Index-XML-FileName> [--type <resource_docs or modules>]
java -Xss5m -jar target/stepmod2mn-1.39.jar <Publication-Index-XML-FileName> [--type <resource_docs or modules>]
----

e.g.

[source,sh]
----
java -Xss5m -jar target/stepmod2mn-1.38.jar publication/part1000/CR_PMI_5/publication_index.xml --type resource_docs
java -Xss5m -jar target/stepmod2mn-1.39.jar publication/part1000/CR_PMI_5/publication_index.xml --type resource_docs
----

NOTE: the Metanorma collection file 'metanorma.yml' will be saved in the 3 level up folder (usually, source repository's root folder).
Expand All @@ -168,42 +168,42 @@ NOTE: the Metanorma collection file 'metanorma.yml' will be saved in the 3 level

[source,sh]
----
java -jar target/stepmod2mn-1.38.jar <start folder to process xml maps files> --svg
java -jar target/stepmod2mn-1.39.jar <start folder to process xml maps files> --svg
----

e.g.

[source,sh]
----
java -jar target/stepmod2mn-1.38.jar data/resources --svg
java -jar target/stepmod2mn-1.39.jar data/resources --svg
----

=== Generate SVG images for the XML in the specified folder and sub-folders, and save them in the output folder:

[source,sh]
----
java -jar target/stepmod2mn-1.38.jar <start folder to process xml maps files> --svg [--output <Output-folder>]
java -jar target/stepmod2mn-1.39.jar <start folder to process xml maps files> --svg [--output <Output-folder>]
----

e.g.

[source,sh]
----
java -jar target/stepmod2mn-1.38.jar data/resources --svg --output schemas/
java -jar target/stepmod2mn-1.39.jar data/resources --svg --output schemas/
----

=== Generate SVG image for Express Imagemap XML and Image:

[source,sh]
----
java -jar stepmod2mn-1.38.jar --xml <Express Imagemap XML file path> --image <Image file name> [--svg <resulted SVG map file or folder>]
java -jar stepmod2mn-1.39.jar --xml <Express Imagemap XML file path> --image <Image file name> [--svg <resulted SVG map file or folder>]
----

e.g.

[source,sh]
----
java -jar stepmod2mn-1.38.jar --xml data\resource_docs\fundamentals_of_product_description_and_support\schema_diagexpg1.xml --image schema_diagexpg1.gif --svg schema_diagexpg1.svg
java -jar stepmod2mn-1.39.jar --xml data\resource_docs\fundamentals_of_product_description_and_support\schema_diagexpg1.xml --image schema_diagexpg1.gif --svg schema_diagexpg1.svg
----


Expand All @@ -223,7 +223,7 @@ Update version in `pom.xml`, e.g.:
----
<groupId>org.metanorma</groupId>
<artifactId>stepmod2mn</artifactId>
<version>1.38</version>
<version>1.39</version>
<name>STEPmod XML to Metanorma AsciiDoc converter</name>
----

Expand All @@ -234,8 +234,8 @@ Tag the same version in Git:

[source,xml]
----
git tag v1.38
git push origin v1.38
git tag v1.39
git push origin v1.39
----

Then the corresponding GitHub release will be automatically created at:
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.metanorma</groupId>
<artifactId>stepmod2mn</artifactId>
<version>1.38</version>
<version>1.39</version>
<name>STEPmod XML to Metanorma AsciiDoc converter</name>
<packaging>jar</packaging>
<url>https://www.metanorma.org</url>
Expand Down
16 changes: 15 additions & 1 deletion src/main/resources/stepmod.base_xsl/common/biblio.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,21 @@
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="frag" select="concat('bibitem_',@id)"/>
<xsl:variable name="number">
<xsl:choose>
<xsl:when test="stdnumber"><xsl:value-of select="stdnumber"/></xsl:when>
<xsl:when test="number"><xsl:value-of select="number"/></xsl:when>
</xsl:choose>
</xsl:variable>
<xsl:variable name="id">
<xsl:choose>
<xsl:when test="@id"><xsl:value-of select="@id"/></xsl:when>
<xsl:otherwise>
<xsl:value-of select="translate($number, '/  ', '___')"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="frag" select="concat('bibitem_',$id)"/>
<!-- <xsl:apply-templates select="." mode="print_as_xml"/> -->
<!-- <p>
<A NAME="{$frag}"/>
Expand Down
6 changes: 3 additions & 3 deletions src/main/resources/stepmod.base_xsl/module.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -718,12 +718,12 @@ TT remove since locke is no longer available.
</xsl:otherwise>
</xsl:choose>
<xsl:if test="./changes">
<xsl:variable name="annex_letter">
<xsl:choose>
<xsl:variable name="annex_letter">G</xsl:variable>
<!-- <xsl:choose>
<xsl:when test="./changes and ./usage_guide">G</xsl:when>
<xsl:when test="./changes">F</xsl:when>
</xsl:choose>
</xsl:variable>
</xsl:variable> -->
<!-- <br/><br/>A detailed description of the changes is provided in Annex <a
href="g_change{$FILE_EXT}">
<xsl:value-of select="$annex_letter"/>
Expand Down
10 changes: 9 additions & 1 deletion src/main/resources/stepmod.base_xsl/sect_6_refdata.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ $Id: sect_6_refdata.xsl,v 1.1 2006/05/18 16:17:23 dmprice Exp $
<xsl:choose>
<xsl:when test="refdata">


<xsl:if test="1 = 2"> <!-- skip, replaced by template, see below https://github.com/metanorma/stepmod2mn/issues/142 -->

<!-- <p> -->
<xsl:call-template name="insertParagraph">
<xsl:with-param name="text">Implementations of this part of ISO 10303 shall make use of the capability to classify an
Expand Down Expand Up @@ -103,7 +106,12 @@ and from the http://www.iso.org[ISO]<!-- <a href="http://www.iso.org">ISO</a>-->
<!-- <li> --><xsl:text>* </xsl:text>no other UML, EXPRESS or OWL concepts appear in these diagrams.<xsl:text>&#xa;&#xa;</xsl:text><!-- </li> -->
<!-- </ul> -->
<xsl:text>&#xa;&#xa;</xsl:text>


</xsl:if> <!-- 1 = 2 -->

<xsl:text>include::../../../templates/module_refdata.adoc[]</xsl:text>
<xsl:text>&#xa;&#xa;</xsl:text>

<xsl:apply-templates select="refdata"/>
</xsl:when>
<xsl:otherwise>
Expand Down
12 changes: 6 additions & 6 deletions src/main/resources/stepmod.base_xsl/sect_g_change.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ $Id: sect_g_change.xsl,v 1.17 2017/09/29 06:01:47 mikeward Exp $

<!-- overwrites the template declared in module.xsl -->
<xsl:template match="module" mode="change_history">
<xsl:variable name="annex_letter">
<xsl:choose>
<xsl:variable name="annex_letter">G</xsl:variable>
<!-- <xsl:choose>
<xsl:when test="//changes and //usage_guide">G</xsl:when>
<xsl:when test="//changes">F</xsl:when>
<xsl:otherwise>G</xsl:otherwise>
</xsl:choose>
</xsl:variable>
</xsl:variable> -->
<xsl:call-template name="annex_header">
<xsl:with-param name="annex_no" select="$annex_letter"/>
<xsl:with-param name="heading"
Expand Down Expand Up @@ -101,12 +101,12 @@ $Id: sect_g_change.xsl,v 1.17 2017/09/29 06:01:47 mikeward Exp $

<xsl:template match="changes">

<xsl:variable name="annex_letter">
<xsl:choose>
<xsl:variable name="annex_letter">G</xsl:variable>
<!-- <xsl:choose>
<xsl:when test="//changes and //usage_guide">G</xsl:when>
<xsl:when test="//changes">F</xsl:when>
</xsl:choose>
</xsl:variable>
</xsl:variable> -->

<xsl:for-each select="change">
<xsl:sort data-type="number" select="@version"/>
Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/stepmod2mn.module.adoc.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -400,12 +400,12 @@

<!-- Annex F Application module implementation and usage guide -->
<!-- sys/f_guide.xml -->
<xsl:if test="module/usage_guide">
<!-- <xsl:if test="module/usage_guide"> --> <!-- always create Annex F , https://github.com/metanorma/stepmod2mn/issues/143 -->
<xsl:message>[INFO] Processing Annex F Application module implementation and usage guide ...</xsl:message>
<file path="sections/96-usage_guide.adoc">
<xsl:apply-templates select="module" mode="annex_f"/> <!-- sect_f_guide.xsl -->
</file>
</xsl:if>
<!-- </xsl:if> -->

<!-- Annex F/G Change history -->
<!-- sys/g_change -->
Expand Down

0 comments on commit 4bbcd29

Please sign in to comment.