From 25a9fa59ee11b4cc0b84cdd48d47614afd334c92 Mon Sep 17 00:00:00 2001 From: Wendell Piez Date: Thu, 10 Aug 2023 12:32:14 -0400 Subject: [PATCH] Added test site generator script; added to `make`; corrected broken README --- bin/metaschema-xslt | 5 +++++ src/document/README.md | 12 +++++++----- src/document/mvn-schemadocs-testsite-xpl.sh | 2 +- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/bin/metaschema-xslt b/bin/metaschema-xslt index 0ac0be42..7e34b199 100755 --- a/bin/metaschema-xslt +++ b/bin/metaschema-xslt @@ -15,6 +15,8 @@ usage() { Usage: $(basename "${BASH_SOURCE[0]}") [ARGS] SUBCOMMAND [SUBCOMMAND ARGS] Subcommands: +- docs-testsite METASCHEMA_XML OUTPUT_DIR SCHEMA_NAME [ADDITIONAL_ARGS] + Generate a set of standalone (self-contained) HTML pages with XML and JSON Schema documentation for a given metaschema, for testing - schema-gen METASCHEMA_XML OUTPUT_DIR SCHEMA_NAME [ADDITIONAL_ARGS] Generate JSON and XML schemas for a given metaschema - converter-gen METASCHEMA_XML OUTPUT_DIR SCHEMA_NAME [ADDITIONAL_ARGS] @@ -51,6 +53,9 @@ BASE_COMMAND="$(basename "${BASH_SOURCE[0]}") $SUBCOMMAND" export BASE_COMMAND case "$SUBCOMMAND" in + docs-testsite) + "$SRC_DIR"/document/mvn-schemadocs-testsite-xpl.sh "$@" + ;; schema-gen) "$SRC_DIR"/schema-gen/mvn-schemas-xpl.sh "$@" ;; diff --git a/src/document/README.md b/src/document/README.md index 6fa19ca9..036bf183 100644 --- a/src/document/README.md +++ b/src/document/README.md @@ -18,7 +18,7 @@ Arguments are provided to the script as `METASCHEMA_XML OUTPUT_DIR SCHEMA_NAME`, where -- the script `./mvn-schemadocs-html-xpl.sh` is available (in the directory or on the system path) +- the script `./mvn-schemadocs-testsite-xpl.sh` is available (in the directory or on the system path) - `a-metaschema.xml` is a metaschema (top-level module) as a relative path (file URI) - `docs` is a *relative* path (URI syntax) for writing serialized outputs (HTML files) - `metaschemaA` is the label to use in the documentation produced (file names and links) @@ -37,7 +37,7 @@ Ports for outputs (terminal and intermediate results) are not always exposed, fo Given a `path` to write to and a key name (schema name), this pipeline serializes and writes a set of documentation rooted at HTML `div` elements, suitable for ingestion into Hugo or any other HTML-based publishing system. -NB: Markdown can be acquired for docs by reducing this HTML to Markdown. Make inquiries if this is of use. +NB: Markdown can be acquired for docs by reducing this HTML to Markdown. Make inquiries if this would be a useful feature for this pipeline. ### `METASCHEMA-DOCS-DIVS.xpl` @@ -46,12 +46,14 @@ This pipeline produces the same outputs as the preceding, except: - instead of serializing outputs as files, it exposes results on ports - it permits renaming and redirecting outputs (names and locations) via runtime options +Use this pipeline from script or in an IDE to debug the basic pipeline. + ### `METASCHEMA-DOCS-TESTSITE-write.xpl` -Just like `METASCHEMA-DOCS-DIVS.xpl`, except this pipeline writes complete HTML files, not only fragments (rooted at `\
`, to a path provided at runtime. The files are linked and styled using CSS provided in the pipeline. +Like `METASCHEMA-DOCS-DIVS-write.xpl`, this pipeline writes files to the system, except they are complete HTML files, not only fragments (rooted at `\
`). The files are written in a directory whose path provided at runtime, linked and styled using CSS provided in the pipeline. -Use this pipeline to produce a set of standalone documentation ready to preview and use. +Use this pipeline to produce a set of standalone documentation ready to preview and use. This is the pipeline called by the script `mvn-schemadocs-testsite-xpl.sh`. ### `METASCHEMA-DOCS-TRACE.xpl` -The base pipeline called by all other HTML rendering pipelines (just listed), exposing ports for debugging, +The base pipeline called by all other HTML rendering pipelines (just listed), exposing all intermediate and final ports for debugging. Use this pipeline directly from script (binding all its ports), from another pipeline (as in other XProcs in this directory) or in an IDE or debugging framework. diff --git a/src/document/mvn-schemadocs-testsite-xpl.sh b/src/document/mvn-schemadocs-testsite-xpl.sh index d8b67a51..c0d266d9 100755 --- a/src/document/mvn-schemadocs-testsite-xpl.sh +++ b/src/document/mvn-schemadocs-testsite-xpl.sh @@ -6,7 +6,7 @@ source "$SCRIPT_DIR/../common/subcommand_common.bash" usage() { cat <