From ff233fedba97e46b1f3669231e482970ada47af9 Mon Sep 17 00:00:00 2001 From: Alexander Dyuzhev Date: Wed, 8 May 2024 18:05:38 +0300 Subject: [PATCH 1/6] collection.yml format updated, #186 --- README.adoc | 56 +++++++++++++------------- pom.xml | 2 +- src/main/resources/stepmod2mn.adoc.xsl | 14 ++++--- 3 files changed, 37 insertions(+), 35 deletions(-) diff --git a/README.adoc b/README.adoc index 244ae78..4af8d44 100644 --- a/README.adoc +++ b/README.adoc @@ -17,14 +17,14 @@ You will need the `maven` build tool and `make`. [source,sh] ---- -java -Xss5m -jar target/stepmod2mn-1.55.jar +java -Xss5m -jar target/stepmod2mn-1.56.jar ---- e.g. [source,sh] ---- -java -Xss5m -jar target/stepmod2mn-1.55.jar data/resource_docs/draughting_elements/resource.xml +java -Xss5m -jar target/stepmod2mn-1.56.jar data/resource_docs/draughting_elements/resource.xml ---- NOTE: resulted AsciiDoc found in data/resource_docs/draughting_elements/document.adoc @@ -34,28 +34,28 @@ NOTE: resulted AsciiDoc found in data/resource_docs/draughting_elements/document [source,sh] ---- -java -Xss5m -jar target/stepmod2mn-1.55.jar [--output ] +java -Xss5m -jar target/stepmod2mn-1.56.jar [--output ] ---- e.g. [source,sh] ---- -java -Xss5m -jar target/stepmod2mn-1.55.jar data/resource_docs/draughting_elements/resource.xml --output result_dir/draughting_elements/document.adoc +java -Xss5m -jar target/stepmod2mn-1.56.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.55.jar +java -Xss5m -jar target/stepmod2mn-1.56.jar ---- e.g. [source,sh] ---- -java -Xss5m -jar target/stepmod2mn-1.55.jar data/ +java -Xss5m -jar target/stepmod2mn-1.56.jar data/ ---- NOTE: the result AsciiDocs will be saved in the folder with the source resource.xml and module.xml files. @@ -65,14 +65,14 @@ NOTE: the result AsciiDocs will be saved in the folder with the source resource. [source,sh] ---- -java -Xss5m -jar target/stepmod2mn-1.55.jar [--output ] +java -Xss5m -jar target/stepmod2mn-1.56.jar [--output ] ---- e.g. [source,sh] ---- -java -Xss5m -jar target/stepmod2mn-1.55.jar data/ --output documents/ +java -Xss5m -jar target/stepmod2mn-1.56.jar data/ --output documents/ ---- @@ -80,42 +80,42 @@ java -Xss5m -jar target/stepmod2mn-1.55.jar data/ --output documents/ [source,sh] ---- -java -Xss5m -jar target/stepmod2mn-1.55.jar [--exclude ] +java -Xss5m -jar target/stepmod2mn-1.56.jar [--exclude ] ---- e.g. [source,sh] ---- -java -Xss5m -jar target/stepmod2mn-1.55.jar data/ --exclude "machining_features 104" +java -Xss5m -jar target/stepmod2mn-1.56.jar data/ --exclude "machining_features 104" ---- === 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.55.jar [--include-only ] +java -Xss5m -jar target/stepmod2mn-1.56.jar [--include-only ] ---- e.g. [source,sh] ---- -java -Xss5m -jar target/stepmod2mn-1.55.jar data/ --include-only "fundamentals_of_product_description_and_support kinematics" +java -Xss5m -jar target/stepmod2mn-1.56.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.55.jar +java -Xss5m -jar target/stepmod2mn-1.56.jar ---- e.g. [source,sh] ---- -java -Xss5m -jar target/stepmod2mn-1.55.jar publication/part1000/CR_PMI_5/publication_index.xml +java -Xss5m -jar target/stepmod2mn-1.56.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). @@ -125,14 +125,14 @@ and save them into the output folder: [source,sh] ---- -java -Xss5m -jar target/stepmod2mn-1.55.jar [--output ] +java -Xss5m -jar target/stepmod2mn-1.56.jar [--output ] ---- e.g. [source,sh] ---- -java -Xss5m -jar target/stepmod2mn-1.55.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.56.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': @@ -141,7 +141,7 @@ e.g. [source,sh] ---- -java -Xss5m -jar target/stepmod2mn-1.55.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.56.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. @@ -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.55.jar [--type ] +java -Xss5m -jar target/stepmod2mn-1.56.jar [--type ] ---- e.g. [source,sh] ---- -java -Xss5m -jar target/stepmod2mn-1.55.jar publication/part1000/CR_PMI_5/publication_index.xml --type resource_docs +java -Xss5m -jar target/stepmod2mn-1.56.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). @@ -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.55.jar --svg +java -jar target/stepmod2mn-1.56.jar --svg ---- e.g. [source,sh] ---- -java -jar target/stepmod2mn-1.55.jar data/resources --svg +java -jar target/stepmod2mn-1.56.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.55.jar --svg [--output ] +java -jar target/stepmod2mn-1.56.jar --svg [--output ] ---- e.g. [source,sh] ---- -java -jar target/stepmod2mn-1.55.jar data/resources --svg --output schemas/ +java -jar target/stepmod2mn-1.56.jar data/resources --svg --output schemas/ ---- === Generate SVG image for Express Imagemap XML and Image: [source,sh] ---- -java -jar stepmod2mn-1.55.jar --xml --image [--svg ] +java -jar stepmod2mn-1.56.jar --xml --image [--svg ] ---- e.g. [source,sh] ---- -java -jar stepmod2mn-1.55.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.56.jar --xml data\resource_docs\fundamentals_of_product_description_and_support\schema_diagexpg1.xml --image schema_diagexpg1.gif --svg schema_diagexpg1.svg ---- @@ -223,7 +223,7 @@ Update version in `pom.xml`, e.g.: ---- org.metanorma stepmod2mn -1.55 +1.56 STEPmod XML to Metanorma AsciiDoc converter ---- @@ -234,8 +234,8 @@ Tag the same version in Git: [source,xml] ---- -git tag v1.55 -git push origin v1.55 +git tag v1.56 +git push origin v1.56 ---- Then the corresponding GitHub release will be automatically created at: diff --git a/pom.xml b/pom.xml index ff1b313..b6e7b49 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ 4.0.0 org.metanorma stepmod2mn - 1.55 + 1.56 STEPmod XML to Metanorma AsciiDoc converter jar https://www.metanorma.org diff --git a/src/main/resources/stepmod2mn.adoc.xsl b/src/main/resources/stepmod2mn.adoc.xsl index 822f907..27ebcfa 100644 --- a/src/main/resources/stepmod2mn.adoc.xsl +++ b/src/main/resources/stepmod2mn.adoc.xsl @@ -1110,10 +1110,9 @@ manifest: - level: document title: Document + sectionsplit: true docref: - - fileref: document.xml - identifier: iso10303-41 - sectionsplit: true + - fileref: document.adoc - level: attachments title: Attachments docref: @@ -1173,15 +1172,18 @@ title: Document + sectionsplit: true + docref: - - fileref: document.xml + + - fileref: document.adoc - identifier: iso + - level: attachments title: Attachments From 6fc91f48169a716aaaef338aaca3717e9e663e7b Mon Sep 17 00:00:00 2001 From: Alexander Dyuzhev Date: Wed, 8 May 2024 18:34:42 +0300 Subject: [PATCH 2/6] collection.yml generation refactoring, #186 --- src/main/resources/stepmod2mn.adoc.xsl | 182 +++++++----------- .../resources/stepmod2mn.resource.adoc.xsl | 64 ++++++ 2 files changed, 129 insertions(+), 117 deletions(-) diff --git a/src/main/resources/stepmod2mn.adoc.xsl b/src/main/resources/stepmod2mn.adoc.xsl index 27ebcfa..1c171aa 100644 --- a/src/main/resources/stepmod2mn.adoc.xsl +++ b/src/main/resources/stepmod2mn.adoc.xsl @@ -1121,128 +1121,76 @@ attachment: true ... --> - + + - [INFO] Generation collection.yaml ... - - directives: - - - documents-inline - - bibdata: - - title: - - - - language: - - content: "" - - - type: collection - - docid: - - type: iso - - id: - - edition: - - copyright: - - owner: - - name: International Standards Organization - - abbreviation: ISO - - from: - - manifest: - - level: collection - - title: ISO Collection - - manifest: - - - level: document - - title: Document - - sectionsplit: true - - docref: - - - - fileref: document.adoc - - - - - level: attachments - - title: Attachments + directives: + + - documents-inline + + bibdata: + + title: + + + - language: - docref: + content: "" - - - - fileref: - - - - - - - [ERROR] File '' does not exist. - - [INFO] Repository index path: - - - - - - - - - - - - - - - - - - - - - - - - - - identifier: .exp - - attachment: true - - - - - fileref: - - identifier: .html - - attachment: true - - - + + type: collection + + docid: + + type: iso + + id: + + edition: + + copyright: + + owner: + + name: International Standards Organization + + abbreviation: ISO + + from: + + manifest: + + level: collection + + title: ISO Collection + + manifest: + + - level: document + + title: Document + + sectionsplit: true + + docref: + + + - fileref: document.adoc + + + + - level: attachments + + title: Attachments + + docref: + - + [INFO] Generation html_attachments.sh ... diff --git a/src/main/resources/stepmod2mn.resource.adoc.xsl b/src/main/resources/stepmod2mn.resource.adoc.xsl index ab33e79..51fb0a0 100644 --- a/src/main/resources/stepmod2mn.resource.adoc.xsl +++ b/src/main/resources/stepmod2mn.resource.adoc.xsl @@ -679,4 +679,68 @@ + + + [INFO] Generation collection.yaml ... + + + + + + + + + + + - fileref: + + + + + + + [ERROR] File '' does not exist. + + [INFO] Repository index path: + + + + + + + + + + + + + + + + + + + + + + + + + + identifier: .exp + + attachment: true + + + + - fileref: + + identifier: .html + + attachment: true + + + + + \ No newline at end of file From ae4a483a05a4c794fa02230ed7742d07cb3c2bd6 Mon Sep 17 00:00:00 2001 From: Alexander Dyuzhev Date: Wed, 8 May 2024 19:08:48 +0300 Subject: [PATCH 3/6] collection.yml generation added for modules, #186 --- src/main/resources/stepmod2mn.module.adoc.xsl | 125 ++++++++++++++++-- .../resources/stepmod2mn.resource.adoc.xsl | 4 +- 2 files changed, 112 insertions(+), 17 deletions(-) diff --git a/src/main/resources/stepmod2mn.module.adoc.xsl b/src/main/resources/stepmod2mn.module.adoc.xsl index 1d43a88..47dccd4 100644 --- a/src/main/resources/stepmod2mn.module.adoc.xsl +++ b/src/main/resources/stepmod2mn.module.adoc.xsl @@ -382,19 +382,23 @@ + + - + + + @@ -637,6 +641,13 @@ + + + + + + + - + From f33dca9f0e65dd1d30228042d814eef55b63b103 Mon Sep 17 00:00:00 2001 From: Alexander Dyuzhev Date: Wed, 8 May 2024 20:10:43 +0300 Subject: [PATCH 4/6] fixing issue with source document for terms, #185 --- .../stepmod.base_xsl/sect_2_refs.xsl | 26 ++++++++++++++++--- .../stepmod.base_xsl/sect_3_defs.xsl | 13 +++++++++- 2 files changed, 34 insertions(+), 5 deletions(-) diff --git a/src/main/resources/stepmod.base_xsl/sect_2_refs.xsl b/src/main/resources/stepmod.base_xsl/sect_2_refs.xsl index 17cf3b1..afcfb5f 100644 --- a/src/main/resources/stepmod.base_xsl/sect_2_refs.xsl +++ b/src/main/resources/stepmod.base_xsl/sect_2_refs.xsl @@ -638,10 +638,28 @@ $Id: sect_2_refs.xsl,v 1.22 2019/03/09 01:29:01 tom Exp $ node set. The normrefs are sorted on output --> - - - - + + + + + + + + + + + + + + + + + + + + + + - source=ref10303-2 + + + + + + + + + + From 4b5a305515e41c1e885b3e8b88cd945f590a6a2e Mon Sep 17 00:00:00 2001 From: Alexander Dyuzhev Date: Wed, 8 May 2024 20:58:34 +0300 Subject: [PATCH 5/6] updated path to schemas.yaml, #187 --- src/main/resources/stepmod2mn.module.adoc.xsl | 2 +- src/main/resources/stepmod2mn.resource.adoc.xsl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/resources/stepmod2mn.module.adoc.xsl b/src/main/resources/stepmod2mn.module.adoc.xsl index 47dccd4..d98b993 100644 --- a/src/main/resources/stepmod2mn.module.adoc.xsl +++ b/src/main/resources/stepmod2mn.module.adoc.xsl @@ -359,7 +359,7 @@ :data-uri-image: - :lutaml-express-index: schemas; schemas.yaml; + :lutaml-express-index: schemas; ../../schemas_all.yaml; diff --git a/src/main/resources/stepmod2mn.resource.adoc.xsl b/src/main/resources/stepmod2mn.resource.adoc.xsl index 727fdb6..43bb0f1 100644 --- a/src/main/resources/stepmod2mn.resource.adoc.xsl +++ b/src/main/resources/stepmod2mn.resource.adoc.xsl @@ -343,7 +343,7 @@ :data-uri-image: - :lutaml-express-index: schemas; schemas.yaml; + :lutaml-express-index: schemas; ../../schemas_all.yaml; From 9b7fe8108336b79335f43613d4bfff060cd86dd8 Mon Sep 17 00:00:00 2001 From: Alexander Dyuzhev Date: Wed, 8 May 2024 21:09:08 +0300 Subject: [PATCH 6/6] introduction for resource docs updated, #189 --- .../stepmod.base_xsl/res_doc/sect_introduction.xsl | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/main/resources/stepmod.base_xsl/res_doc/sect_introduction.xsl b/src/main/resources/stepmod.base_xsl/res_doc/sect_introduction.xsl index 0077ec1..f127fbd 100644 --- a/src/main/resources/stepmod.base_xsl/res_doc/sect_introduction.xsl +++ b/src/main/resources/stepmod.base_xsl/res_doc/sect_introduction.xsl @@ -110,9 +110,9 @@ $Id: sect_introduction.xsl,v 1.15 2020/03/02 14:39:21 tom Exp $ --> - [lutaml_express, schemas, context, leveloffset=+1] + + + + + include::../templates/resources/resource_introduction_subdivisions.adoc[]