From ff1222da67928b2ace409c06f88b2ba5a3ea851c Mon Sep 17 00:00:00 2001 From: Brian Sipos Date: Fri, 8 May 2026 11:02:36 -0400 Subject: [PATCH 1/8] Merging in modern HTML stylesheet --- .github/workflows/docs.yaml | 33 ++++--- .gitlab-ci.yml | 2 +- CMakeLists.txt | 18 +++- CODE_OF_CONDUCT.md | 2 +- CONTRIBUTING.md | 2 +- README.md | 2 +- apply_license.sh | 4 +- build.sh | 2 +- index.html => deploy-index.html | 4 +- product-guide/CMakeLists.txt | 146 ++++++++++++++++++++---------- product-guide/install_imgs.sh | 12 +-- product-guide/manual.css | 78 ++++++++++++++++ product-guide/manual.sty | 40 +++++++++ product-guide/pdf-opts.xsl | 6 ++ product-guide/sort_dictionary.sh | 2 +- product-guide/xml-catalog.xml.in | 8 ++ user-guide/CMakeLists.txt | 147 +++++++++++++++++++++---------- user-guide/install_imgs.sh | 12 +-- user-guide/manual.css | 78 ++++++++++++++++ user-guide/manual.sty | 40 +++++++++ user-guide/pdf-opts.xsl | 6 ++ user-guide/sort_dictionary.sh | 2 +- user-guide/xml-catalog.xml.in | 8 ++ 23 files changed, 527 insertions(+), 127 deletions(-) rename index.html => deploy-index.html (92%) create mode 100644 product-guide/manual.css create mode 100644 product-guide/manual.sty create mode 100644 product-guide/xml-catalog.xml.in create mode 100644 user-guide/manual.css create mode 100644 user-guide/manual.sty create mode 100644 user-guide/xml-catalog.xml.in diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index a6dee79..64680f8 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -1,5 +1,5 @@ ## -## Copyright (c) 2023-2025 The Johns Hopkins University Applied Physics +## Copyright (c) 2023-2026 The Johns Hopkins University Applied Physics ## Laboratory LLC. ## ## This file is part of the Asynchronous Network Management System (ANMS). @@ -37,23 +37,36 @@ jobs: contents: read steps: - name: Checkout repository - uses: actions/checkout@v4 + uses: actions/checkout@v6 with: fetch-depth: 0 submodules: recursive - name: Set up OS run: | - sudo rm /var/lib/man-db/auto-update - sudo apt-get update && sudo apt-get install -y cmake make coreutils ruby asciidoctor graphviz inkscape dblatex docbook-xsl-ns xsltproc xmlstarlet - sudo gem install asciidoctor-diagram + sudo apt-get update + sudo apt-get install -y \ + cmake make coreutils \ + ruby asciidoctor graphviz plantuml inkscape \ + dblatex xmlstarlet aspell + sudo gem install \ + asciidoctor-diagram \ + 'asciidoctor-diagram-plantuml:~>1.2024.8' - name: Build env: DESTDIR: public run: ./build.sh - - uses: actions/upload-artifact@v4 + - uses: actions/upload-artifact@v7 with: name: docs path: public + - uses: actions/upload-artifact@v7 + with: + archive: false + path: public/product-guide/anms-product-guide.pdf + - uses: actions/upload-artifact@v7 + with: + archive: false + path: public/user-guide/anms-user-guide.pdf deploy: # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages @@ -73,16 +86,16 @@ jobs: if: github.ref == 'refs/heads/main' runs-on: ubuntu-24.04 steps: - - uses: actions/download-artifact@v4 + - uses: actions/download-artifact@v8 with: name: docs path: public - name: Setup Pages - uses: actions/configure-pages@v3 + uses: actions/configure-pages@v6 - name: Upload artifact - uses: actions/upload-pages-artifact@v3 + uses: actions/upload-pages-artifact@v5 with: path: public - name: Deploy to GitHub Pages id: deployment - uses: actions/deploy-pages@v4 + uses: actions/deploy-pages@v5 diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f81dd30..e7fa1a3 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,5 +1,5 @@ ## -## Copyright (c) 2023-2025 The Johns Hopkins University Applied Physics +## Copyright (c) 2023-2026 The Johns Hopkins University Applied Physics ## Laboratory LLC. ## ## This file is part of the Asynchronous Network Management System (ANMS). diff --git a/CMakeLists.txt b/CMakeLists.txt index 8e0e66b..1fdbede 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,5 @@ #[[ -Copyright (c) 2023-2025 The Johns Hopkins University Applied Physics +Copyright (c) 2023-2026 The Johns Hopkins University Applied Physics Laboratory LLC. This file is part of the Asynchronous Network Management System (ANMS). @@ -24,10 +24,24 @@ cmake_minimum_required(VERSION 3.16) project(anms-docs LANGUAGES ) set(CMAKE_INSTALL_PREFIX "") +include(FetchContent) +FetchContent_Declare( + xsltng + URL https://codeberg.org/DocBook/xslTNG/releases/download/2.8.0/docbook-xslTNG-2.8.0.zip + URL_HASH SHA256=adbbddbf33a4fcc5c949a2851cac53e8111d30a5fd0b32429eeec68aedb61efd + DOWNLOAD_EXTRACT_TIMESTAMP OFF +) +FetchContent_MakeAvailable(xsltng) +file(GLOB xsltng_JAR "${xsltng_SOURCE_DIR}/libs/*.jar") +if(NOT xsltng_JAR) + message(FATAL_ERROR "No xslTNG jar file found under ${xsltng_SOURCE_DIR}") +endif(NOT xsltng_JAR) + add_subdirectory(user-guide) add_subdirectory(product-guide) install( - FILES index.html + FILES deploy-index.html + RENAME index.html DESTINATION . ) diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index 2549162..c66db18 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -1,5 +1,5 @@ - + Index diff --git a/product-guide/CMakeLists.txt b/product-guide/CMakeLists.txt index 6a30db6..99b07c2 100644 --- a/product-guide/CMakeLists.txt +++ b/product-guide/CMakeLists.txt @@ -1,5 +1,5 @@ #[[ -Copyright (c) 2023-2025 The Johns Hopkins University Applied Physics +Copyright (c) 2023-2026 The Johns Hopkins University Applied Physics Laboratory LLC. This file is part of the Asynchronous Network Management System (ANMS). @@ -42,53 +42,101 @@ endif() set(OUT_DOCINFO "docinfo.xml") configure_file( - "${CMAKE_CURRENT_SOURCE_DIR}/${OUT_DOCINFO}.in" - "${CMAKE_CURRENT_SOURCE_DIR}/${OUT_DOCINFO}" - @ONLY + "${CMAKE_CURRENT_SOURCE_DIR}/${OUT_DOCINFO}.in" + "${CMAKE_CURRENT_SOURCE_DIR}/${OUT_DOCINFO}" + @ONLY ) -set(OUT_DBOOK "manual.docbook.xml") +set(OUT_DBOOK "${CMAKE_CURRENT_BINARY_DIR}/manual.docbook.xml") add_custom_command( - OUTPUT ${OUT_DBOOK} - DEPENDS ${ADOC_SOURCE} ${ADOC_EXTRAS} ${OUT_DOCINFO} - COMMAND - ${ASCIIDOC} -v -r asciidoctor-diagram - --base-dir ${CMAKE_CURRENT_SOURCE_DIR} - --destination-dir ${CMAKE_CURRENT_BINARY_DIR} - -o ${OUT_DBOOK} + OUTPUT ${OUT_DBOOK} + DEPENDS ${ADOC_SOURCE} ${ADOC_EXTRAS} ${OUT_DOCINFO} + COMMAND + ${ASCIIDOC} -v -r asciidoctor-diagram + --base-dir ${CMAKE_CURRENT_SOURCE_DIR} + --destination-dir ${CMAKE_CURRENT_BINARY_DIR} + -o ${OUT_DBOOK} ${ADOC_SOURCE} ) # Place source images into build directory set(INSTALL_IMGS ${CMAKE_CURRENT_SOURCE_DIR}/install_imgs.sh) add_custom_target( - ${PROJECT_NAME}-img-bin - DEPENDS ${INSTALL_IMGS} ${OUT_DBOOK} - COMMAND ${INSTALL_IMGS} ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} ${OUT_DBOOK} + ${PROJECT_NAME}-img-bin + DEPENDS ${INSTALL_IMGS} ${OUT_DBOOK} + COMMAND + ${INSTALL_IMGS} ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_BINARY_DIR} ${OUT_DBOOK} ) -find_program(XSLTPROC xsltproc REQUIRED) -set(HTML_XSLT "${CMAKE_CURRENT_SOURCE_DIR}/xhtml-opts.xsl") +find_program(JAVA_BIN java REQUIRED) find_program(XMLSTARLET xmlstarlet REQUIRED) +set(HTML_XSLT "${CMAKE_CURRENT_SOURCE_DIR}/xhtml-opts.xsl") +set(MANUAL_CSS "${CMAKE_CURRENT_SOURCE_DIR}/manual.css") +set(DOCBOOK_CSS_FILES + "docbook.css" "docbook-paged.css" + "docbook-toc.css" "pygments.css" +) +set(DOCBOOK_JS_FILES "copy-verbatim.js" "persistent-toc.js") +set(OUT_MANUAL_CSS "html/css/manual.css") set(OUT_HTML "html/index.html") -set(OUT_CSS "html/docbook.css") + +configure_file( + "xml-catalog.xml.in" + "xml-catalog.xml" + @ONLY +) +add_custom_command( + OUTPUT ${OUT_HTML} + DEPENDS ${OUT_DBOOK} "xml-catalog.xml" ${HTML_XSLT} + COMMAND + ${JAVA_BIN} -jar ${xsltng_JAR} + -catalog:xml-catalog.xml -xsl:${HTML_XSLT} + -o:${OUT_HTML} ${OUT_DBOOK} +) +# Place needed files into HTML tree add_custom_command( - OUTPUT ${OUT_HTML} - BYPRODUCTS ${OUT_CSS} - DEPENDS ${OUT_DBOOK} ${HTML_XSLT} - COMMAND ${XSLTPROC} -o ${OUT_HTML} ${HTML_XSLT} ${OUT_DBOOK} + OUTPUT ${OUT_MANUAL_CSS} + DEPENDS ${MANUAL_CSS} + COMMAND ${CMAKE_COMMAND} -E copy_if_different ${MANUAL_CSS} ${OUT_MANUAL_CSS} + COMMENT "Copy manual.css" ) -# Place needed images into HTML tree +set(OUT_DOCBOOK_FILES "") +foreach(FILENAME ${DOCBOOK_CSS_FILES}) + set(INPATH "${xsltng_SOURCE_DIR}/resources/css/${FILENAME}") + set(OUTPATH "html/css/${FILENAME}") + add_custom_command( + OUTPUT ${OUTPATH} + DEPENDS ${INPATH} + COMMAND ${CMAKE_COMMAND} -E copy_if_different ${INPATH} ${OUTPATH} + COMMENT "Copy css/${FILENAME}" + ) + list(APPEND OUT_DOCBOOK_FILES ${OUTPATH}) +endforeach() +foreach(FILENAME ${DOCBOOK_JS_FILES}) + set(INPATH "${xsltng_SOURCE_DIR}/resources/js/${FILENAME}") + set(OUTPATH "html/js/${FILENAME}") + add_custom_command( + OUTPUT ${OUTPATH} + DEPENDS ${INPATH} + COMMAND ${CMAKE_COMMAND} -E copy_if_different ${INPATH} ${OUTPATH} + COMMENT "Copy js/${FILENAME}" + ) + list(APPEND OUT_DOCBOOK_FILES ${OUTPATH}) +endforeach() add_custom_target( - ${PROJECT_NAME}-img-html - DEPENDS ${INSTALL_IMGS} ${OUT_HTML} ${PROJECT_NAME}-img-bin - COMMAND ${INSTALL_IMGS} ${CMAKE_CURRENT_BINARY_DIR} "${CMAKE_CURRENT_BINARY_DIR}/html" + ${PROJECT_NAME}-img-html + DEPENDS ${INSTALL_IMGS} ${OUT_HTML} ${PROJECT_NAME}-img-bin + COMMAND + ${INSTALL_IMGS} ${CMAKE_CURRENT_BINARY_DIR} + "${CMAKE_CURRENT_BINARY_DIR}/html" ) add_custom_target( - ${PROJECT_NAME}-html ALL - DEPENDS ${OUT_HTML} ${PROJECT_NAME}-img-html + ${PROJECT_NAME}-html ALL + DEPENDS + ${OUT_HTML} ${OUT_MANUAL_CSS} ${OUT_DOCBOOK_FILES} ${PROJECT_NAME}-img-html ) install( - DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/html" - DESTINATION ${PROJECT_NAME} + DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/html" + DESTINATION ${PROJECT_NAME} ) @@ -121,19 +169,25 @@ add_custom_target( # PDF document output find_program(DBLATEX dblatex REQUIRED) -set(PDF_XSLT "${CMAKE_CURRENT_SOURCE_DIR}/pdf-opts.xsl") -set(OUT_PDF "manual.pdf") -add_custom_command( - OUTPUT ${OUT_PDF} - DEPENDS ${OUT_DBOOK} ${PDF_XSLT} ${PROJECT_NAME}-img-bin - COMMAND ${DBLATEX} -o ${OUT_PDF} --xsl-user=${PDF_XSLT} ${OUT_DBOOK} -) -add_custom_target( - ${PROJECT_NAME}-pdf ALL - DEPENDS ${OUT_PDF} -) -install( - FILES "${CMAKE_CURRENT_BINARY_DIR}/${OUT_PDF}" - DESTINATION ${PROJECT_NAME} -# RENAME "ANMS Product Guide v${PROJECT_VERSION}.pdf" -) +if(DBLATEX) + set(PDF_STYLE "${CMAKE_CURRENT_SOURCE_DIR}/manual.sty") + set(PDF_XSLT "${CMAKE_CURRENT_SOURCE_DIR}/pdf-opts.xsl") + set(OUT_PDF "manual.pdf") + add_custom_command( + OUTPUT ${OUT_PDF} + DEPENDS ${OUT_DBOOK} ${PDF_STYLE} ${PDF_XSLT} ${PROJECT_NAME}-img-bin + COMMAND + ${DBLATEX} + --texstyle=${PDF_STYLE} --xsl-user=${PDF_XSLT} + -o ${OUT_PDF} ${OUT_DBOOK} + ) + add_custom_target( + ${PROJECT_NAME}-pdf ALL + DEPENDS ${OUT_PDF} + ) + install( + FILES "${CMAKE_CURRENT_BINARY_DIR}/${OUT_PDF}" + RENAME "anms-product-guide.pdf" + DESTINATION ${PROJECT_NAME} + ) +endif(DBLATEX) diff --git a/product-guide/install_imgs.sh b/product-guide/install_imgs.sh index 3cc9946..fcc222f 100755 --- a/product-guide/install_imgs.sh +++ b/product-guide/install_imgs.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash ## -## Copyright (c) 2023-2025 The Johns Hopkins University Applied Physics +## Copyright (c) 2023-2026 The Johns Hopkins University Applied Physics ## Laboratory LLC. ## ## This file is part of the Asynchronous Network Management System (ANMS). @@ -24,14 +24,14 @@ SRCDIR=$1 OUTDIR=$2 DBOOKFILE=$3 -if [ -z "${DBOOKFILE}" ] +if [[ -z "${DBOOKFILE}" ]] then FILENAMES="" for HTMLFILE in ${OUTDIR}/*.html do - echo "Scanning ${HTMLFILE}" - THESENAMES=$(xmlstarlet sel -N xhtml=http://www.w3.org/1999/xhtml -t -v '//xhtml:img/@src' -n "${HTMLFILE}") - FILENAMES="${FILENAMES} ${THESENAMES}" + echo "Scanning ${HTMLFILE}" + THESENAMES=$(xmlstarlet sel -N xhtml=http://www.w3.org/1999/xhtml -t -v '//xhtml:img/@src' -n "${HTMLFILE}") + FILENAMES="${FILENAMES} ${THESENAMES}" done else FILENAMES=$(xmlstarlet sel -N db=http://docbook.org/ns/docbook -t -v '//db:imagedata/@fileref' -n "${DBOOKFILE}") @@ -40,7 +40,7 @@ fi for FN in ${FILENAMES} do SRCFN="${SRCDIR}/${FN}" - if [ ! -f "${SRCFN}" ] + if [[ ! -f "${SRCFN}" ]] then continue fi diff --git a/product-guide/manual.css b/product-guide/manual.css new file mode 100644 index 0000000..a08eb12 --- /dev/null +++ b/product-guide/manual.css @@ -0,0 +1,78 @@ +/* +Copyright (c) 2023-2026 The Johns Hopkins University Applied Physics +Laboratory LLC. + +This file is part of the Asynchronous Network Management System (ANMS). + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. + +This work was performed for the Jet Propulsion Laboratory, California +Institute of Technology, sponsored by the United States Government under +the prime contract 80NM0018D0004 between the Caltech and NASA under +subcontract 1658085. +*/ +:root { + background-color: #f8f8f8; +} + +main { + padding-top: 0em; + padding-left: 1em; + padding-right: 1em; + background-color: #ffffff; + --background-color: #ffffff; + --header-color: #ffffff; +} + +div.legalnotice { + margin: 0.5em; + padding: 0.5em; +} +div.legalnotice header { + margin-top: 1em; +} + +div.revhistory div.title, div.revhistory ul { + border-bottom-style: solid; + border-bottom-width: 1px; + border-bottom-color: #808080; +} +div.revhistory p { + margin-top: 8px; + margin-bottom: 8px; +} + +ul.toc { + padding-left: 1em; +} +ul.toc li { + padding-left: 1em; +} + +div.varlistentry dt { + font-weight: bold; +} +div.varlistentry dd p { + margin-top: 0; +} + +td p { + margin-top: 4px; + margin-bottom: 4px; +} + +div.figure { + border-color: #c8c8c8; +} + +div.qanda div.question { + font-weight: bold; +} diff --git a/product-guide/manual.sty b/product-guide/manual.sty new file mode 100644 index 0000000..4da3275 --- /dev/null +++ b/product-guide/manual.sty @@ -0,0 +1,40 @@ +%% +%% This style is derivated from the docbook one +%% +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{mystyle}[2007/04/04 My DocBook Style] + +%% Just use the original package and pass the options +\RequirePackageWithOptions{docbook} + +%% Allow "json" source files +\lstdefinelanguage{json}{ + basicstyle=\normalfont\small\ttfamily, + numbers=left, + numberstyle=\scriptsize, + stepnumber=1, + numbersep=8pt, + showstringspaces=false, + breaklines=true, + frame=lines, + string=[s]{"}{"}, + comment=[l]{:[}, + morecomment=[l]{:"}, + literate= + *{0}{{{\color{red}0}}}{1} + {1}{{{\color{red}1}}}{1} + {2}{{{\color{red}2}}}{1} + {3}{{{\color{red}3}}}{1} + {4}{{{\color{red}4}}}{1} + {5}{{{\color{red}5}}}{1} + {6}{{{\color{red}6}}}{1} + {7}{{{\color{red}7}}}{1} + {8}{{{\color{red}8}}}{1} + {9}{{{\color{red}9}}}{1} + {:}{{{\color{black}:}}}{1} + {,}{{{\color{black},}}}{1} + {\{}{{{\color{black}\{}}}{1} + {\}}{{{\color{black}\}}}}{1} + {[}{{{\color{black}[}}}{1} + {]}{{{\color{black}]}}}{1}, +} \ No newline at end of file diff --git a/product-guide/pdf-opts.xsl b/product-guide/pdf-opts.xsl index 11b7d80..af963bb 100644 --- a/product-guide/pdf-opts.xsl +++ b/product-guide/pdf-opts.xsl @@ -1,5 +1,11 @@ + letterpaper + 0.75in + 0.75in + 0.75in + 0.75in + 0 1 2 diff --git a/product-guide/sort_dictionary.sh b/product-guide/sort_dictionary.sh index dc2a49e..6bf52e0 100755 --- a/product-guide/sort_dictionary.sh +++ b/product-guide/sort_dictionary.sh @@ -1,6 +1,6 @@ #!/bin/bash ## -## Copyright (c) 2023-2025 The Johns Hopkins University Applied Physics +## Copyright (c) 2023-2026 The Johns Hopkins University Applied Physics ## Laboratory LLC. ## ## This file is part of the Asynchronous Network Management System (ANMS). diff --git a/product-guide/xml-catalog.xml.in b/product-guide/xml-catalog.xml.in new file mode 100644 index 0000000..94b985d --- /dev/null +++ b/product-guide/xml-catalog.xml.in @@ -0,0 +1,8 @@ + + + + + + diff --git a/user-guide/CMakeLists.txt b/user-guide/CMakeLists.txt index e54b3f2..6d64002 100644 --- a/user-guide/CMakeLists.txt +++ b/user-guide/CMakeLists.txt @@ -1,5 +1,5 @@ #[[ -Copyright (c) 2023-2025 The Johns Hopkins University Applied Physics +Copyright (c) 2023-2026 The Johns Hopkins University Applied Physics Laboratory LLC. This file is part of the Asynchronous Network Management System (ANMS). @@ -27,6 +27,7 @@ project(${DIRNAME} VERSION 0 LANGUAGES ) # File paths set(ADOC_SOURCE "${CMAKE_CURRENT_SOURCE_DIR}/manual.adoc") +file(GLOB ADOC_EXTRAS "images/*.png") find_program(ASCIIDOC asciidoctor REQUIRED) @@ -37,53 +38,101 @@ endif() set(OUT_DOCINFO "docinfo.xml") configure_file( - "${CMAKE_CURRENT_SOURCE_DIR}/${OUT_DOCINFO}.in" - "${CMAKE_CURRENT_SOURCE_DIR}/${OUT_DOCINFO}" - @ONLY + "${CMAKE_CURRENT_SOURCE_DIR}/${OUT_DOCINFO}.in" + "${CMAKE_CURRENT_SOURCE_DIR}/${OUT_DOCINFO}" + @ONLY ) -set(OUT_DBOOK "manual.docbook.xml") +set(OUT_DBOOK "${CMAKE_CURRENT_BINARY_DIR}/manual.docbook.xml") add_custom_command( - OUTPUT ${OUT_DBOOK} - DEPENDS ${ADOC_SOURCE} ${OUT_DOCINFO} - COMMAND - ${ASCIIDOC} -v -r asciidoctor-diagram - --base-dir ${CMAKE_CURRENT_SOURCE_DIR} - --destination-dir ${CMAKE_CURRENT_BINARY_DIR} - -o ${OUT_DBOOK} + OUTPUT ${OUT_DBOOK} + DEPENDS ${ADOC_SOURCE} ${ADOC_EXTRAS} ${OUT_DOCINFO} + COMMAND + ${ASCIIDOC} -v -r asciidoctor-diagram + --base-dir ${CMAKE_CURRENT_SOURCE_DIR} + --destination-dir ${CMAKE_CURRENT_BINARY_DIR} + -o ${OUT_DBOOK} ${ADOC_SOURCE} ) # Place source images into build directory set(INSTALL_IMGS ${CMAKE_CURRENT_SOURCE_DIR}/install_imgs.sh) add_custom_target( - ${PROJECT_NAME}-img-bin - DEPENDS ${INSTALL_IMGS} ${OUT_DBOOK} - COMMAND ${INSTALL_IMGS} ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} ${OUT_DBOOK} + ${PROJECT_NAME}-img-bin + DEPENDS ${INSTALL_IMGS} ${OUT_DBOOK} + COMMAND + ${INSTALL_IMGS} ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_BINARY_DIR} ${OUT_DBOOK} ) -find_program(XSLTPROC xsltproc REQUIRED) -set(HTML_XSLT "${CMAKE_CURRENT_SOURCE_DIR}/xhtml-opts.xsl") +find_program(JAVA_BIN java REQUIRED) find_program(XMLSTARLET xmlstarlet REQUIRED) +set(HTML_XSLT "${CMAKE_CURRENT_SOURCE_DIR}/xhtml-opts.xsl") +set(MANUAL_CSS "${CMAKE_CURRENT_SOURCE_DIR}/manual.css") +set(DOCBOOK_CSS_FILES + "docbook.css" "docbook-paged.css" + "docbook-toc.css" "pygments.css" +) +set(DOCBOOK_JS_FILES "copy-verbatim.js" "persistent-toc.js") +set(OUT_MANUAL_CSS "html/css/manual.css") set(OUT_HTML "html/index.html") -set(OUT_CSS "html/docbook.css") + +configure_file( + "xml-catalog.xml.in" + "xml-catalog.xml" + @ONLY +) +add_custom_command( + OUTPUT ${OUT_HTML} + DEPENDS ${OUT_DBOOK} "xml-catalog.xml" ${HTML_XSLT} + COMMAND + ${JAVA_BIN} -jar ${xsltng_JAR} + -catalog:xml-catalog.xml -xsl:${HTML_XSLT} + -o:${OUT_HTML} ${OUT_DBOOK} +) +# Place needed files into HTML tree add_custom_command( - OUTPUT ${OUT_HTML} - BYPRODUCTS ${OUT_CSS} - DEPENDS ${OUT_DBOOK} ${HTML_XSLT} - COMMAND ${XSLTPROC} -o ${OUT_HTML} ${HTML_XSLT} ${OUT_DBOOK} + OUTPUT ${OUT_MANUAL_CSS} + DEPENDS ${MANUAL_CSS} + COMMAND ${CMAKE_COMMAND} -E copy_if_different ${MANUAL_CSS} ${OUT_MANUAL_CSS} + COMMENT "Copy manual.css" ) -# Place needed images into HTML tree +set(OUT_DOCBOOK_FILES "") +foreach(FILENAME ${DOCBOOK_CSS_FILES}) + set(INPATH "${xsltng_SOURCE_DIR}/resources/css/${FILENAME}") + set(OUTPATH "html/css/${FILENAME}") + add_custom_command( + OUTPUT ${OUTPATH} + DEPENDS ${INPATH} + COMMAND ${CMAKE_COMMAND} -E copy_if_different ${INPATH} ${OUTPATH} + COMMENT "Copy css/${FILENAME}" + ) + list(APPEND OUT_DOCBOOK_FILES ${OUTPATH}) +endforeach() +foreach(FILENAME ${DOCBOOK_JS_FILES}) + set(INPATH "${xsltng_SOURCE_DIR}/resources/js/${FILENAME}") + set(OUTPATH "html/js/${FILENAME}") + add_custom_command( + OUTPUT ${OUTPATH} + DEPENDS ${INPATH} + COMMAND ${CMAKE_COMMAND} -E copy_if_different ${INPATH} ${OUTPATH} + COMMENT "Copy js/${FILENAME}" + ) + list(APPEND OUT_DOCBOOK_FILES ${OUTPATH}) +endforeach() add_custom_target( - ${PROJECT_NAME}-img-html - DEPENDS ${INSTALL_IMGS} ${OUT_HTML} ${PROJECT_NAME}-img-bin - COMMAND ${INSTALL_IMGS} ${CMAKE_CURRENT_BINARY_DIR} "${CMAKE_CURRENT_BINARY_DIR}/html" + ${PROJECT_NAME}-img-html + DEPENDS ${INSTALL_IMGS} ${OUT_HTML} ${PROJECT_NAME}-img-bin + COMMAND + ${INSTALL_IMGS} ${CMAKE_CURRENT_BINARY_DIR} + "${CMAKE_CURRENT_BINARY_DIR}/html" ) add_custom_target( - ${PROJECT_NAME}-html ALL - DEPENDS ${OUT_HTML} ${PROJECT_NAME}-img-html + ${PROJECT_NAME}-html ALL + DEPENDS + ${OUT_HTML} ${OUT_MANUAL_CSS} ${OUT_DOCBOOK_FILES} ${PROJECT_NAME}-img-html ) install( - DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/html" - DESTINATION ${PROJECT_NAME} + DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/html" + DESTINATION ${PROJECT_NAME} ) @@ -116,19 +165,25 @@ add_custom_target( # PDF document output find_program(DBLATEX dblatex REQUIRED) -set(PDF_XSLT "${CMAKE_CURRENT_SOURCE_DIR}/pdf-opts.xsl") -set(OUT_PDF "manual.pdf") -add_custom_command( - OUTPUT ${OUT_PDF} - DEPENDS ${OUT_DBOOK} ${PDF_XSLT} ${PROJECT_NAME}-img-bin - COMMAND ${DBLATEX} -o ${OUT_PDF} --xsl-user=${PDF_XSLT} ${OUT_DBOOK} -) -add_custom_target( - ${PROJECT_NAME}-pdf ALL - DEPENDS ${OUT_PDF} -) -install( - FILES "${CMAKE_CURRENT_BINARY_DIR}/${OUT_PDF}" - DESTINATION ${PROJECT_NAME} -# RENAME "ANMS User Guide v${PROJECT_VERSION}.pdf" -) +if(DBLATEX) + set(PDF_STYLE "${CMAKE_CURRENT_SOURCE_DIR}/manual.sty") + set(PDF_XSLT "${CMAKE_CURRENT_SOURCE_DIR}/pdf-opts.xsl") + set(OUT_PDF "manual.pdf") + add_custom_command( + OUTPUT ${OUT_PDF} + DEPENDS ${OUT_DBOOK} ${PDF_STYLE} ${PDF_XSLT} ${PROJECT_NAME}-img-bin + COMMAND + ${DBLATEX} + --texstyle=${PDF_STYLE} --xsl-user=${PDF_XSLT} + -o ${OUT_PDF} ${OUT_DBOOK} + ) + add_custom_target( + ${PROJECT_NAME}-pdf ALL + DEPENDS ${OUT_PDF} + ) + install( + FILES "${CMAKE_CURRENT_BINARY_DIR}/${OUT_PDF}" + RENAME "anms-user-guide.pdf" + DESTINATION ${PROJECT_NAME} + ) +endif(DBLATEX) diff --git a/user-guide/install_imgs.sh b/user-guide/install_imgs.sh index 3cc9946..fcc222f 100755 --- a/user-guide/install_imgs.sh +++ b/user-guide/install_imgs.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash ## -## Copyright (c) 2023-2025 The Johns Hopkins University Applied Physics +## Copyright (c) 2023-2026 The Johns Hopkins University Applied Physics ## Laboratory LLC. ## ## This file is part of the Asynchronous Network Management System (ANMS). @@ -24,14 +24,14 @@ SRCDIR=$1 OUTDIR=$2 DBOOKFILE=$3 -if [ -z "${DBOOKFILE}" ] +if [[ -z "${DBOOKFILE}" ]] then FILENAMES="" for HTMLFILE in ${OUTDIR}/*.html do - echo "Scanning ${HTMLFILE}" - THESENAMES=$(xmlstarlet sel -N xhtml=http://www.w3.org/1999/xhtml -t -v '//xhtml:img/@src' -n "${HTMLFILE}") - FILENAMES="${FILENAMES} ${THESENAMES}" + echo "Scanning ${HTMLFILE}" + THESENAMES=$(xmlstarlet sel -N xhtml=http://www.w3.org/1999/xhtml -t -v '//xhtml:img/@src' -n "${HTMLFILE}") + FILENAMES="${FILENAMES} ${THESENAMES}" done else FILENAMES=$(xmlstarlet sel -N db=http://docbook.org/ns/docbook -t -v '//db:imagedata/@fileref' -n "${DBOOKFILE}") @@ -40,7 +40,7 @@ fi for FN in ${FILENAMES} do SRCFN="${SRCDIR}/${FN}" - if [ ! -f "${SRCFN}" ] + if [[ ! -f "${SRCFN}" ]] then continue fi diff --git a/user-guide/manual.css b/user-guide/manual.css new file mode 100644 index 0000000..a08eb12 --- /dev/null +++ b/user-guide/manual.css @@ -0,0 +1,78 @@ +/* +Copyright (c) 2023-2026 The Johns Hopkins University Applied Physics +Laboratory LLC. + +This file is part of the Asynchronous Network Management System (ANMS). + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. + +This work was performed for the Jet Propulsion Laboratory, California +Institute of Technology, sponsored by the United States Government under +the prime contract 80NM0018D0004 between the Caltech and NASA under +subcontract 1658085. +*/ +:root { + background-color: #f8f8f8; +} + +main { + padding-top: 0em; + padding-left: 1em; + padding-right: 1em; + background-color: #ffffff; + --background-color: #ffffff; + --header-color: #ffffff; +} + +div.legalnotice { + margin: 0.5em; + padding: 0.5em; +} +div.legalnotice header { + margin-top: 1em; +} + +div.revhistory div.title, div.revhistory ul { + border-bottom-style: solid; + border-bottom-width: 1px; + border-bottom-color: #808080; +} +div.revhistory p { + margin-top: 8px; + margin-bottom: 8px; +} + +ul.toc { + padding-left: 1em; +} +ul.toc li { + padding-left: 1em; +} + +div.varlistentry dt { + font-weight: bold; +} +div.varlistentry dd p { + margin-top: 0; +} + +td p { + margin-top: 4px; + margin-bottom: 4px; +} + +div.figure { + border-color: #c8c8c8; +} + +div.qanda div.question { + font-weight: bold; +} diff --git a/user-guide/manual.sty b/user-guide/manual.sty new file mode 100644 index 0000000..4da3275 --- /dev/null +++ b/user-guide/manual.sty @@ -0,0 +1,40 @@ +%% +%% This style is derivated from the docbook one +%% +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{mystyle}[2007/04/04 My DocBook Style] + +%% Just use the original package and pass the options +\RequirePackageWithOptions{docbook} + +%% Allow "json" source files +\lstdefinelanguage{json}{ + basicstyle=\normalfont\small\ttfamily, + numbers=left, + numberstyle=\scriptsize, + stepnumber=1, + numbersep=8pt, + showstringspaces=false, + breaklines=true, + frame=lines, + string=[s]{"}{"}, + comment=[l]{:[}, + morecomment=[l]{:"}, + literate= + *{0}{{{\color{red}0}}}{1} + {1}{{{\color{red}1}}}{1} + {2}{{{\color{red}2}}}{1} + {3}{{{\color{red}3}}}{1} + {4}{{{\color{red}4}}}{1} + {5}{{{\color{red}5}}}{1} + {6}{{{\color{red}6}}}{1} + {7}{{{\color{red}7}}}{1} + {8}{{{\color{red}8}}}{1} + {9}{{{\color{red}9}}}{1} + {:}{{{\color{black}:}}}{1} + {,}{{{\color{black},}}}{1} + {\{}{{{\color{black}\{}}}{1} + {\}}{{{\color{black}\}}}}{1} + {[}{{{\color{black}[}}}{1} + {]}{{{\color{black}]}}}{1}, +} \ No newline at end of file diff --git a/user-guide/pdf-opts.xsl b/user-guide/pdf-opts.xsl index 11b7d80..af963bb 100644 --- a/user-guide/pdf-opts.xsl +++ b/user-guide/pdf-opts.xsl @@ -1,5 +1,11 @@ + letterpaper + 0.75in + 0.75in + 0.75in + 0.75in + 0 1 2 diff --git a/user-guide/sort_dictionary.sh b/user-guide/sort_dictionary.sh index dc2a49e..6bf52e0 100755 --- a/user-guide/sort_dictionary.sh +++ b/user-guide/sort_dictionary.sh @@ -1,6 +1,6 @@ #!/bin/bash ## -## Copyright (c) 2023-2025 The Johns Hopkins University Applied Physics +## Copyright (c) 2023-2026 The Johns Hopkins University Applied Physics ## Laboratory LLC. ## ## This file is part of the Asynchronous Network Management System (ANMS). diff --git a/user-guide/xml-catalog.xml.in b/user-guide/xml-catalog.xml.in new file mode 100644 index 0000000..94b985d --- /dev/null +++ b/user-guide/xml-catalog.xml.in @@ -0,0 +1,8 @@ + + + + + + From 7615e592b1552df148076dc33d1000f7ee3cb6eb Mon Sep 17 00:00:00 2001 From: Brian Sipos Date: Fri, 8 May 2026 11:06:51 -0400 Subject: [PATCH 2/8] fix sonar issue --- build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sh b/build.sh index 95becf1..98957c5 100755 --- a/build.sh +++ b/build.sh @@ -29,7 +29,7 @@ SELFDIR=$(realpath $(dirname "${BASH_SOURCE[0]}")) cd ${SELFDIR} cmake -S . -B build cmake --build build $@ -if [ -n "${DESTDIR}" ] +if [[ -n "${DESTDIR}" ]] then cmake --install build fi From cc1460b3e320190f2efbc130021f6a927301be2c Mon Sep 17 00:00:00 2001 From: Brian Sipos Date: Fri, 8 May 2026 11:14:41 -0400 Subject: [PATCH 3/8] update html stylesheet use for xslTNG --- product-guide/xhtml-opts.xsl | 31 ++++++++++++++++--------------- user-guide/xhtml-opts.xsl | 31 ++++++++++++++++--------------- 2 files changed, 32 insertions(+), 30 deletions(-) diff --git a/product-guide/xhtml-opts.xsl b/product-guide/xhtml-opts.xsl index 118b331..3dc4443 100644 --- a/product-guide/xhtml-opts.xsl +++ b/product-guide/xhtml-opts.xsl @@ -1,22 +1,23 @@ - - - + + + - 0 - 1 - 1 - 2 - -book toc,title,figure,table,example,equation - + css/manual.css + - 0 - + list + component section + 2 + - none - 1 - 0 + + none diff --git a/user-guide/xhtml-opts.xsl b/user-guide/xhtml-opts.xsl index 118b331..3dc4443 100644 --- a/user-guide/xhtml-opts.xsl +++ b/user-guide/xhtml-opts.xsl @@ -1,22 +1,23 @@ - - - + + + - 0 - 1 - 1 - 2 - -book toc,title,figure,table,example,equation - + css/manual.css + - 0 - + list + component section + 2 + - none - 1 - 0 + + none From 49cdafc693ff93a7a047805b0474389168784c6b Mon Sep 17 00:00:00 2001 From: Brian Sipos Date: Fri, 8 May 2026 14:23:16 -0400 Subject: [PATCH 4/8] generate misspelling and context --- .github/workflows/docs.yaml | 20 ++++++++++++ product-guide/CMakeLists.txt | 59 +++++++++++++++++++----------------- user-guide/CMakeLists.txt | 59 +++++++++++++++++++----------------- 3 files changed, 84 insertions(+), 54 deletions(-) diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index 64680f8..acb5e7f 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -55,6 +55,26 @@ jobs: env: DESTDIR: public run: ./build.sh + - name: Misspelling + env: + USER_MISSPELLING_TXT: 'build/default/user-guide/misspelling.txt' + USER_MISSPELLING_CTX_TXT: 'build/default/user-guide/misspelling-ctx.txt' + PROD_MISSPELLING_TXT: 'build/default/product-guide/misspelling.txt' + PROD_MISSPELLING_CTX_TXT: 'build/default/product-guide/misspelling-ctx.txt' + # success means file is present and empty + run: | + if [[ (-f "${USER_MISSPELLING_TXT}" && ! -s "${USER_MISSPELLING_TXT}") || (-f "${PROD_MISSPELLING_TXT}" && ! -s "${PROD_MISSPELLING_TXT}") ]] + then + printf "\nUser guide:\n" + cat "${USER_MISSPELLING_TXT}" + printf "\nIn context:\n" + cat "${USER_MISSPELLING_CTX_TXT}" + printf "\nProduct guide:\n" + cat "${PROD_MISSPELLING_TXT}" + printf "\nIn context:\n" + cat "${PROD_MISSPELLING_CTX_TXT}" + exit 1 + fi - uses: actions/upload-artifact@v7 with: name: docs diff --git a/product-guide/CMakeLists.txt b/product-guide/CMakeLists.txt index 99b07c2..9802c55 100644 --- a/product-guide/CMakeLists.txt +++ b/product-guide/CMakeLists.txt @@ -139,33 +139,38 @@ install( DESTINATION ${PROJECT_NAME} ) - -# spellcheck on HTML output -set(DICTIONARY_TXT "${CMAKE_CURRENT_SOURCE_DIR}/dictionary.txt") -set(SPELLCHECK_XSL "${CMAKE_CURRENT_SOURCE_DIR}/spellcheck.xsl") -set(MISSPELLING_TXT "misspelling.txt") -add_custom_command( - OUTPUT "dictionary.cwl" - DEPENDS "${DICTIONARY_TXT}" - COMMAND cat "${DICTIONARY_TXT}" | - ${ASPELL} --lang=en create master "./dictionary.cwl" -) -add_custom_command( - OUTPUT "${MISSPELLING_TXT}" - DEPENDS "${OUT_HTML}" "${SPELLCHECK_XSL}" "dictionary.cwl" - COMMAND ${XMLSTARLET} tr "${SPELLCHECK_XSL}" "${OUT_HTML}" | - ${ASPELL} --mode=html --lang=EN_US --extra-dicts=./dictionary.cwl list | - sort | uniq > "${MISSPELLING_TXT}" -) -add_custom_target( - ${PROJECT_NAME}-misspelling ALL - DEPENDS "${MISSPELLING_TXT}" - COMMAND cat "${MISSPELLING_TXT}" - # success means file is present and empty - COMMAND test -f "${MISSPELLING_TXT}" -a ! -s "${MISSPELLING_TXT}" - COMMENT "Checking ${MISSPELLING_TXT}" -) - +if(XMLSTARLET AND ASPELL) + # spellcheck on HTML output + set(DICTIONARY_TXT "${CMAKE_CURRENT_SOURCE_DIR}/dictionary.txt") + set(SPELLCHECK_XSL "${CMAKE_CURRENT_SOURCE_DIR}/spellcheck.xsl") + add_custom_command( + OUTPUT "dictionary.cwl" + DEPENDS "${DICTIONARY_TXT}" + COMMAND cat "${DICTIONARY_TXT}" | + ${ASPELL} --lang=en create master "./dictionary.cwl" + ) + add_custom_command( + OUTPUT "misspelling.txt" + DEPENDS + "${OUT_HTML}" "${SPELLCHECK_XSL}" "dictionary.cwl" + COMMAND + ${XMLSTARLET} tr "${SPELLCHECK_XSL}" "${OUT_HTML}" | + ${ASPELL} --mode=html --lang=EN_US --extra-dicts=./dictionary.cwl list | + sort -u >"misspelling.txt" + ) + add_custom_command( + OUTPUT "misspelling-ctx.txt" + DEPENDS + "${OUT_HTML}" "misspelling.txt" + COMMAND + ${XMLSTARLET} fo "${OUT_HTML}" | + grep --file "misspelling.txt" >"misspelling-ctx.txt" || true + ) + add_custom_target( + ${PROJECT_NAME}-misspelling ALL + DEPENDS "misspelling.txt" "misspelling-ctx.txt" + ) +endif(XMLSTARLET AND ASPELL) # PDF document output find_program(DBLATEX dblatex REQUIRED) diff --git a/user-guide/CMakeLists.txt b/user-guide/CMakeLists.txt index 6d64002..04ee805 100644 --- a/user-guide/CMakeLists.txt +++ b/user-guide/CMakeLists.txt @@ -135,33 +135,38 @@ install( DESTINATION ${PROJECT_NAME} ) - -# spellcheck on HTML output -set(DICTIONARY_TXT "${CMAKE_CURRENT_SOURCE_DIR}/dictionary.txt") -set(SPELLCHECK_XSL "${CMAKE_CURRENT_SOURCE_DIR}/spellcheck.xsl") -set(MISSPELLING_TXT "misspelling.txt") -add_custom_command( - OUTPUT "dictionary.cwl" - DEPENDS "${DICTIONARY_TXT}" - COMMAND cat "${DICTIONARY_TXT}" | - ${ASPELL} --lang=en create master "./dictionary.cwl" -) -add_custom_command( - OUTPUT "${MISSPELLING_TXT}" - DEPENDS "${OUT_HTML}" "${SPELLCHECK_XSL}" "dictionary.cwl" - COMMAND ${XMLSTARLET} tr "${SPELLCHECK_XSL}" "${OUT_HTML}" | - ${ASPELL} --mode=html --lang=EN_US --extra-dicts=./dictionary.cwl list | - sort | uniq > "${MISSPELLING_TXT}" -) -add_custom_target( - ${PROJECT_NAME}-misspelling ALL - DEPENDS "${MISSPELLING_TXT}" - COMMAND cat "${MISSPELLING_TXT}" - # success means file is present and empty - COMMAND test -f "${MISSPELLING_TXT}" -a ! -s "${MISSPELLING_TXT}" - COMMENT "Checking ${MISSPELLING_TXT}" -) - +if(XMLSTARLET AND ASPELL) + # spellcheck on HTML output + set(DICTIONARY_TXT "${CMAKE_CURRENT_SOURCE_DIR}/dictionary.txt") + set(SPELLCHECK_XSL "${CMAKE_CURRENT_SOURCE_DIR}/spellcheck.xsl") + add_custom_command( + OUTPUT "dictionary.cwl" + DEPENDS "${DICTIONARY_TXT}" + COMMAND cat "${DICTIONARY_TXT}" | + ${ASPELL} --lang=en create master "./dictionary.cwl" + ) + add_custom_command( + OUTPUT "misspelling.txt" + DEPENDS + "${OUT_HTML}" "${SPELLCHECK_XSL}" "dictionary.cwl" + COMMAND + ${XMLSTARLET} tr "${SPELLCHECK_XSL}" "${OUT_HTML}" | + ${ASPELL} --mode=html --lang=EN_US --extra-dicts=./dictionary.cwl list | + sort -u >"misspelling.txt" + ) + add_custom_command( + OUTPUT "misspelling-ctx.txt" + DEPENDS + "${OUT_HTML}" "misspelling.txt" + COMMAND + ${XMLSTARLET} fo "${OUT_HTML}" | + grep --file "misspelling.txt" >"misspelling-ctx.txt" || true + ) + add_custom_target( + ${PROJECT_NAME}-misspelling ALL + DEPENDS "misspelling.txt" "misspelling-ctx.txt" + ) +endif(XMLSTARLET AND ASPELL) # PDF document output find_program(DBLATEX dblatex REQUIRED) From 17a19734a4c38b69bece5af2938995162f6fdcd7 Mon Sep 17 00:00:00 2001 From: Brian Sipos Date: Fri, 8 May 2026 14:48:38 -0400 Subject: [PATCH 5/8] check spelling in script --- .github/workflows/docs.yaml | 20 +----------------- build.sh | 39 +++++++++++++++++++++++++++++++----- product-guide/dictionary.txt | 1 + user-guide/dictionary.txt | 1 + 4 files changed, 37 insertions(+), 24 deletions(-) diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index acb5e7f..5dfc281 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -56,25 +56,7 @@ jobs: DESTDIR: public run: ./build.sh - name: Misspelling - env: - USER_MISSPELLING_TXT: 'build/default/user-guide/misspelling.txt' - USER_MISSPELLING_CTX_TXT: 'build/default/user-guide/misspelling-ctx.txt' - PROD_MISSPELLING_TXT: 'build/default/product-guide/misspelling.txt' - PROD_MISSPELLING_CTX_TXT: 'build/default/product-guide/misspelling-ctx.txt' - # success means file is present and empty - run: | - if [[ (-f "${USER_MISSPELLING_TXT}" && ! -s "${USER_MISSPELLING_TXT}") || (-f "${PROD_MISSPELLING_TXT}" && ! -s "${PROD_MISSPELLING_TXT}") ]] - then - printf "\nUser guide:\n" - cat "${USER_MISSPELLING_TXT}" - printf "\nIn context:\n" - cat "${USER_MISSPELLING_CTX_TXT}" - printf "\nProduct guide:\n" - cat "${PROD_MISSPELLING_TXT}" - printf "\nIn context:\n" - cat "${PROD_MISSPELLING_CTX_TXT}" - exit 1 - fi + env: ./build.sh docs-spelling - uses: actions/upload-artifact@v7 with: name: docs diff --git a/build.sh b/build.sh index 98957c5..cc9c056 100755 --- a/build.sh +++ b/build.sh @@ -25,11 +25,40 @@ set -e SELFDIR=$(realpath $(dirname "${BASH_SOURCE[0]}")) - cd ${SELFDIR} -cmake -S . -B build -cmake --build build $@ -if [[ -n "${DESTDIR}" ]] + +if [[ "$1" == "docs-spelling" ]] then - cmake --install build + USER_MISSPELLING_TXT="build/user-guide/misspelling.txt" + USER_MISSPELLING_CTX_TXT="build/user-guide/misspelling-ctx.txt" + PROD_MISSPELLING_TXT="build/product-guide/misspelling.txt" + PROD_MISSPELLING_CTX_TXT="build/product-guide/misspelling-ctx.txt" + # success means file is present and empty + FAILURES=0 + if [[ -s "${USER_MISSPELLING_TXT}" ]] + then + printf "\nUser guide:\n" + cat "${USER_MISSPELLING_TXT}" + printf "\nIn context:\n" + cat "${USER_MISSPELLING_CTX_TXT}" + ((FAILURES += 1)) + fi + test ! -s "${PROD_MISSPELLING_TXT}"; echo $? + if [[ -s "${PROD_MISSPELLING_TXT}" ]] + then + printf "\nProduct guide:\n" + cat "${PROD_MISSPELLING_TXT}" + printf "\nIn context:\n" + cat "${PROD_MISSPELLING_CTX_TXT}" + ((FAILURES += 1)) + fi + exit ${FAILURES} +else + # actual build + cmake -S . -B build + cmake --build build $@ + if [[ -n "${DESTDIR}" ]] + then + cmake --install build + fi fi diff --git a/product-guide/dictionary.txt b/product-guide/dictionary.txt index 0cdc7b5..473a986 100644 --- a/product-guide/dictionary.txt +++ b/product-guide/dictionary.txt @@ -75,6 +75,7 @@ TBD TCP testenv TLS +toc transcoder transcoding tshark diff --git a/user-guide/dictionary.txt b/user-guide/dictionary.txt index 5ccd132..7ea6b83 100644 --- a/user-guide/dictionary.txt +++ b/user-guide/dictionary.txt @@ -58,6 +58,7 @@ STR submodule tbr timeframe +toc TODO transcode transcoded From 6c3d3f94239698f2c467d6a62972947b0511f373 Mon Sep 17 00:00:00 2001 From: Brian Sipos Date: Fri, 8 May 2026 14:53:06 -0400 Subject: [PATCH 6/8] fix arg quoting --- build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sh b/build.sh index cc9c056..0e01627 100755 --- a/build.sh +++ b/build.sh @@ -56,7 +56,7 @@ then else # actual build cmake -S . -B build - cmake --build build $@ + cmake --build build "$@" if [[ -n "${DESTDIR}" ]] then cmake --install build From d6943b2c9087f07d822ba1181169545ab6a157d7 Mon Sep 17 00:00:00 2001 From: Brian Sipos Date: Fri, 8 May 2026 14:54:08 -0400 Subject: [PATCH 7/8] fix job --- .github/workflows/docs.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index 5dfc281..203f93d 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -56,7 +56,7 @@ jobs: DESTDIR: public run: ./build.sh - name: Misspelling - env: ./build.sh docs-spelling + run: ./build.sh docs-spelling - uses: actions/upload-artifact@v7 with: name: docs From 4b2b92aee65bc06812175bc8a710b7e4fdd72aa2 Mon Sep 17 00:00:00 2001 From: Brian Sipos Date: Fri, 8 May 2026 14:56:43 -0400 Subject: [PATCH 8/8] remove debug --- build.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/build.sh b/build.sh index 0e01627..8d59988 100755 --- a/build.sh +++ b/build.sh @@ -43,7 +43,6 @@ then cat "${USER_MISSPELLING_CTX_TXT}" ((FAILURES += 1)) fi - test ! -s "${PROD_MISSPELLING_TXT}"; echo $? if [[ -s "${PROD_MISSPELLING_TXT}" ]] then printf "\nProduct guide:\n"