Skip to content

Commit

Permalink
Added test site generator script; added to make; corrected broken R…
Browse files Browse the repository at this point in the history
…EADME
  • Loading branch information
wendellpiez committed Aug 10, 2023
1 parent d42fa8b commit 25a9fa5
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
5 changes: 5 additions & 0 deletions bin/metaschema-xslt
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -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 "$@"
;;
Expand Down
12 changes: 7 additions & 5 deletions src/document/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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`

Expand All @@ -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 `\<div>`, 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 `\<div>`). 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.
2 changes: 1 addition & 1 deletion src/document/mvn-schemadocs-testsite-xpl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ source "$SCRIPT_DIR/../common/subcommand_common.bash"

usage() {
cat <<EOF
Usage: $(basename "${BASH_SOURCE[0]}") METASCHEMA_XML OUTPUT_DIR SCHEMA_NAME [ADDITIONAL_ARGS]
Usage: ${BASE_COMMAND:-$(basename "${BASH_SOURCE[0]}")} METASCHEMA_XML OUTPUT_DIR SCHEMA_NAME [ADDITIONAL_ARGS]
Produces HTML documentation from Metaschema XML source, using XML Calabash invoked from Maven.
Please install Maven first.
Expand Down

0 comments on commit 25a9fa5

Please sign in to comment.