diff --git a/src/main/java/com/metanorma/stepmod2mn.java b/src/main/java/com/metanorma/stepmod2mn.java index 4ab8483..06c46d2 100644 --- a/src/main/java/com/metanorma/stepmod2mn.java +++ b/src/main/java/com/metanorma/stepmod2mn.java @@ -46,7 +46,7 @@ */ public class stepmod2mn { - static final String CMD = "java -jar stepmod2mn.jar [options -o or -v]"; + static final String CMD = "java -jar stepmod2mn.jar [options -o, -v, -b ]"; static final String CMD_SVGscope = "java -jar stepmod2mn.jar --svg"; static final String CMD_SVG = "java -jar stepmod2mn.jar --xml --image [--svg ] [-v]"; @@ -121,7 +121,13 @@ public class stepmod2mn { .desc("output file name") .hasArg() .required(false) - .build()); + .build()); + addOption(Option.builder("b") + .longOpt("boilerplatepath") + .desc("path to boilerplate text storage folder") + .hasArg() + .required(false) + .build()); addOption(Option.builder("v") .longOpt("version") .desc("display application version") @@ -140,6 +146,8 @@ public class stepmod2mn { String resourcePath = ""; + String boilerplatePath = ""; + /** * Main method. * @@ -245,6 +253,11 @@ public static void main(String[] args) throws ParseException { outFileName = cmd.getOptionValue("output"); } + String boilerplatePath = ""; + if (cmd.hasOption("boilerplatepath")) { + boilerplatePath = cmd.getOptionValue("boilerplatepath") + File.separator; + } + // if remote file (http or https) if (argXMLin.toLowerCase().startsWith("http") || argXMLin.toLowerCase().startsWith("www.")) { @@ -300,6 +313,7 @@ public static void main(String[] args) throws ParseException { try { stepmod2mn app = new stepmod2mn(); app.setResourcePath(resourcePath); + app.setBoilerplatePath(boilerplatePath); app.convertstepmod2mn(argXMLin, fileOut); System.out.println("End!"); @@ -360,6 +374,7 @@ private void convertstepmod2mn(String xmlFilePath, File fileOut) throws IOExcept transformer.setParameter("docfile", bibdataFileName); transformer.setParameter("pathSeparator", File.separator); transformer.setParameter("path", resourcePath); + transformer.setParameter("boilerplate_path", boilerplatePath); transformer.setParameter("debug", DEBUG); @@ -425,7 +440,11 @@ private static void printVersion(boolean print) { public void setResourcePath(String resourcePath) { this.resourcePath = resourcePath; } - + + public void setBoilerplatePath(String boilerplatePath) { + this.boilerplatePath = boilerplatePath; + } + private String processLinearizedXML(String xmlFilePath){ try { InputStream xmlInputStream = null; diff --git a/src/main/resources/stepmod.base_xsl/res_doc/sect_4_express.xsl b/src/main/resources/stepmod.base_xsl/res_doc/sect_4_express.xsl index 880069d..2909b6f 100644 --- a/src/main/resources/stepmod.base_xsl/res_doc/sect_4_express.xsl +++ b/src/main/resources/stepmod.base_xsl/res_doc/sect_4_express.xsl @@ -873,7 +873,8 @@ - https://raw.githubusercontent.com/metanorma/stepmod2mn/master/src/main/resources/empty.adoc + + diff --git a/src/main/resources/stepmod2mn.adoc.xsl b/src/main/resources/stepmod2mn.adoc.xsl index 352261c..88fdc82 100644 --- a/src/main/resources/stepmod2mn.adoc.xsl +++ b/src/main/resources/stepmod2mn.adoc.xsl @@ -44,6 +44,8 @@ + + @@ -656,15 +658,23 @@ - [:] - - - - - - - [end_] - + + + [:] + + + + + + + [end_] + + + + Error: boilerplate text is empty. + + +