Skip to content

Commit

Permalink
Modeldoc generator specifies the page base path, hugo build improveme…
Browse files Browse the repository at this point in the history
…nts (#20)

- Disable Hugo RSS feed generation, curbing memory usage
- Update the GHA's Hugo version to `0.118.2`
- Incorporate the modeldoc pipeline changes from usnistgov/metaschema-xslt#70
  • Loading branch information
nikitawootten-nist authored and aj-stein-nist committed Sep 28, 2023
1 parent 9931f10 commit c83fb91
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Setup Hugo
uses: peaceiris/actions-hugo@v2
with:
hugo-version: "0.110.0"
hugo-version: "0.118.2"
extended: true
- name: Setup swap space
# The Hugo build can require a significant amount of memory
Expand Down
10 changes: 10 additions & 0 deletions site/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,13 @@ menu:
- name: Github
url: https://github.com/usnistgov/OSCAL-Reference
weight: 90
# Disable RSS generation everywhere
outputs:
page:
- HTML
home:
- HTML
section:
- HTML
taxonomy:
- HTML
12 changes: 9 additions & 3 deletions support/generate_modeldoc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -134,14 +134,20 @@ do {
model_rawname=${model_basename#oscal_}
model_rawname=${model_rawname%_metaschema.xml}

export HUGO_MODEL_DATA_DIR="data/models/${REVISION}/${model_rawname}"
model_data="${SITE_DIR}/$HUGO_MODEL_DATA_DIR"
# The path to the model relative to the hugo data dir, output dir, and site root
model_output_path="models/${REVISION}/${model_rawname}"

# The directory Hugo will read the models from relative to the site directory
export HUGO_MODEL_DATA_DIR="data/$model_output_path"

# The root of the OSCAL Reference site
page_base_path="OSCAL-Reference/$model_output_path/"

mvn \
--quiet \
-f "${METASCHEMA_DIR}/support/pom.xml" exec:java \
-Dexec.mainClass="com.xmlcalabash.drivers.Main" \
-Dexec.args="-i source=$model_path output-path=file://$model_data/ ${METASCHEMA_DIR}/src/document/write-hugo-metaschema-docs.xpl"
-Dexec.args="-i source=$model_path page-base-path=$page_base_path output-path=file://${SITE_DIR}/$HUGO_MODEL_DATA_DIR/ ${METASCHEMA_DIR}/src/document/write-hugo-metaschema-docs.xpl"

archetype=""
model_doc_path=""
Expand Down
2 changes: 1 addition & 1 deletion support/metaschema-xslt
Submodule metaschema-xslt updated 30 files
+4 −1 .gitmodules
+43 −15 README.md
+5 −0 bin/metaschema-xslt
+53 −12 src/README.md
+55 −0 src/common/datatypes.xsl
+2 −1 src/compose/testing/working_metaschema.xml
+6 −201 src/converter-gen/nist-metaschema-MAKE-JSON-TO-XML-CONVERTER.xsl
+6 −163 src/converter-gen/nist-metaschema-MAKE-XML-TO-JSON-CONVERTER.xsl
+13 −0 src/converter-gen/testing/definition-maps/computer-build-reduce-map-output.xml
+39 −0 src/converter-gen/testing/xml-to-json/produce-xml-converter.xspec
+1 −1 src/converter-gen/xml-to-json/produce-xml-converter.xsl
+114 −0 src/document/METASCHEMA-DOCS-DIVS-write.xpl
+89 −0 src/document/METASCHEMA-DOCS-DIVS.xpl
+2 −2 src/document/METASCHEMA-DOCS-TESTSITE-write.xpl
+41 −1 src/document/METASCHEMA-DOCS-TRACE.xpl
+12 −14 src/document/Makefile
+28 −15 src/document/README.md
+4 −5 src/document/common/common-definitions.xsl
+4 −8 src/document/json/json-docs-hugo-uswds.xsl
+6 −6 src/document/json/object-map-html.xsl
+4 −6 src/document/json/object-reference-html.xsl
+0 −394 src/document/make-metaschema-standalone-docs.xpl
+0 −67 src/document/mvn-schemadocs-debug-xpl.sh
+11 −18 src/document/mvn-schemadocs-testsite-xpl.sh
+44 −28 src/document/write-hugo-metaschema-docs.xpl
+8 −8 src/document/xml/element-map-html.xsl
+6 −5 src/document/xml/element-reference-html.xsl
+4 −9 src/document/xml/xml-docs-hugo-uswds.xsl
+2 −2 src/testing/issue_235_regression.xspec
+1 −1 support/metaschema

0 comments on commit c83fb91

Please sign in to comment.