Dave Jarvis' Repositories

git clone https://repo.autonoma.ca/repo/keenwrite.git

Upgrades container to 2025.08.21 23:32

AuthorDaveJarvis <email>
Date2025-08-25 16:48:13 GMT-0700
Commit9a4fad85b2ae5a739a05bd8ce768a6358e164ece
Parent2c88469
container/Containerfile
#
# ########################################################################
+FROM alpine:latest
LABEL org.opencontainers.image.description Configures a typesetting system.
-FROM alpine:latest
ENV ENV="/etc/profile"
ENV PROFILE=/etc/profile
ENV CONTEXT_HOME=$INSTALL_DIR/context
+ENV CONTEXT_ARCH=linuxmusl-64
# ########################################################################
# Typesetting software
-ADD "http://lmtx.pragma-ade.nl/install-lmtx/context-linuxmusl.zip" "context.zip"
+ADD "http://lmtx.pragma-ade.nl/install-lmtx/context-$CONTEXT_ARCH.zip" "context.zip"
# ########################################################################
#
# Install components, modules, configure system, remove unnecessary files
#
# ########################################################################
WORKDIR $CONTEXT_HOME
RUN \
+ apk update && \
apk add -t py3-cssselect && \
apk add -t py3-lxml && \
apk add -t py3-numpy && \
apk --update --no-cache \
- add ca-certificates curl fontconfig inkscape rsync && \
+ add ca-certificates curl fontconfig rsync
+
+RUN apk --update --no-cache add inkscape
+
+RUN \
mkdir -p \
"$FONTS_DIR" \
"$INSTALL_DIR" \
"$TARGET_DIR" \
"$SOURCE_DIR" \
"$THEMES_DIR" \
"$IMAGES_DIR" \
"$CACHES_DIR" && \
echo "export CONTEXT_HOME=\"$CONTEXT_HOME\"" >> $PROFILE && \
- echo "export PATH=\"\$PATH:\$CONTEXT_HOME/tex/texmf-linuxmusl/bin\"" >> $PROFILE && \
+ echo "export PATH=\"\$PATH:\$CONTEXT_HOME/tex/texmf-$CONTEXT_ARCH/bin\"" >> $PROFILE && \
echo "export OSFONTDIR=\"/usr/share/fonts//\"" >> $PROFILE && \
echo "PS1='\\u@typesetter:\\w\\$ '" >> $PROFILE && \
mkdir -p $CONTEXT_HOME/tex/texmf-fonts/tex/context/user && \
ln -s $CONTEXT_HOME/tex/texmf-fonts/tex/context/user $HOME/fonts && \
- source $PROFILE && \
+ source $PROFILE \
mtxrun --generate && \
find \
container/README.md
# Upgrade
+## Themes
+
+If changes have been made to the themes, upgrade them as follows:
+
+1. Change to the themes repository directory.
+
+ cd $HOME/dev/java/keenwrite/themes
+
+1. Tag the themes, such as:
+
+ git tag -a 1.11.0 -m "message"
+ git push --tags
+
+1. Ensure the personal access token exists:
+
+ test -f tokens/release.pat && echo "exists"
+
+1. Create the release and release notes via the web.
+
+1. Run the release script to upload the release akchive:
+
+ ./release.sh
+
+1. Edit `src/main/resources/com/keenwrite/messages.properties`.
+1. Set `Wizard.typesetter.themes.version` to the version.
+1. Set `Wizard.typesetter.themes.checksum` to the checksum.
+
+The themes are released.
+
+## Container
+
Upgrade the containerization software (e.g., podman or docker) as follows:
1. Edit `src/main/resources/com/keenwrite/messages.properties`.
-1. Set `Wizard.typesetter.container.version` to the latest version.
+1. Set `Wizard.typesetter.container.version` to the new container version.
1. Set `Wizard.typesetter.container.checksum` to the Windows version checksum.
1. Set `Wizard.typesetter.container.image.version` to the new image version.
1. Save the file.
The containerization software version is changed.
# Publish
-Publish the changes to the container image as follows:
+Building the container will pull from the container version in the properties
+file. Ensure that a personal access token (`token.txt`) exists, then publish
+the changes to the container image as follows:
``` bash
-./manage.sh --delete --build --export --publish
+./manage.sh --verbose --delete --build --export --publish
```
container/manage.sh
# ---------------------------------------------------------------------------
-source ../scripts/build-template
-
-# Reads the value of a property from a properties file.
-#
-# $1 - The key name to obtain.
-function property {
- grep "^${1}" "${PROPERTIES}" | cut -d'=' -f2
-}
-
-readonly BUILD_DIR=build
-readonly PROPERTIES="${SCRIPT_DIR}/../src/main/resources/com/keenwrite/messages.properties"
-
-readonly CONTAINER_EXE=podman
-readonly CONTAINER_SHORTNAME=$(property Wizard.typesetter.container.image.name)
-readonly CONTAINER_VERSION=$(property Wizard.typesetter.container.image.version)
-readonly CONTAINER_NETWORK=host
-readonly CONTAINER_FILE="${CONTAINER_SHORTNAME}-${CONTAINER_VERSION}"
-readonly CONTAINER_ARCHIVE_FILE="${CONTAINER_FILE}.tar"
-readonly CONTAINER_ARCHIVE_PATH="${BUILD_DIR}/${CONTAINER_ARCHIVE_FILE}"
-readonly CONTAINER_COMPRESSED_FILE="${CONTAINER_ARCHIVE_FILE}.gz"
-readonly CONTAINER_COMPRESSED_PATH="${BUILD_DIR}/${CONTAINER_ARCHIVE_FILE}.gz"
-readonly CONTAINER_IMAGE_FILE="${BUILD_DIR}/${CONTAINER_FILE}"
-readonly CONTAINER_DIR_SOURCE="/root/source"
-readonly CONTAINER_DIR_TARGET="/root/target"
-readonly CONTAINER_DIR_IMAGES="/root/images"
-readonly CONTAINER_DIR_FONTS="/root/fonts"
-
-ARG_CONTAINER_NAME="${CONTAINER_SHORTNAME}:${CONTAINER_VERSION}"
-ARG_CONTAINER_COMMAND="context --version"
-ARG_MOUNTPOINT_SOURCE=""
-ARG_MOUNTPOINT_TARGET="."
-ARG_MOUNTPOINT_IMAGES=""
-ARG_MOUNTPOINT_FONTS="${HOME}/.fonts"
-
-DEPENDENCIES=(
- "podman,https://podman.io"
- "tar,https://www.gnu.org/software/tar"
- "bzip2,https://gitlab.com/bzip2/bzip2"
-)
-
-ARGUMENTS+=(
- "b,build,Build container"
- "c,connect,Connect to container"
- "d,delete,Remove all containers"
- "s,source,Set mount point for input document (before typesetting)"
- "t,target,Set mount point for output file (after typesetting)"
- "i,images,Set mount point for image files (to typeset)"
- "f,fonts,Set mount point for font files (during typesetting)"
- "l,load,Load container (${CONTAINER_COMPRESSED_PATH})"
- "p,publish,Publish the container"
- "r,run,Run a command in the container (\"${ARG_CONTAINER_COMMAND}\")"
- "x,export,Save container (${CONTAINER_COMPRESSED_PATH})"
-)
-
-# ---------------------------------------------------------------------------
-# Manages the container.
-# ---------------------------------------------------------------------------
-execute() {
- $do_delete
- $do_build
- $do_publish
- $do_export
- $do_load
- $do_execute
- $do_connect
-
- return 1
-}
-
-# ---------------------------------------------------------------------------
-# Deletes all containers.
-# ---------------------------------------------------------------------------
-utile_delete() {
- $log "Deleting all containers"
-
- ${CONTAINER_EXE} rmi --all --force > /dev/null
-
- $log "Containers deleted"
-}
-
-# ---------------------------------------------------------------------------
-# Builds the container file in the current working directory.
-# ---------------------------------------------------------------------------
-utile_build() {
- $log "Building container version ${CONTAINER_VERSION}"
-
- # Show what commands are run while building, but not the commands' output.
- ${CONTAINER_EXE} build \
- --network="${CONTAINER_NETWORK}" \
- --squash \
- -t "${ARG_CONTAINER_NAME}" . | \
- grep ^STEP
-}
-
-# ---------------------------------------------------------------------------
-# Publishes the container to the repository.
-# ---------------------------------------------------------------------------
-utile_publish() {
- local -r TOKEN_FILE="token.txt"
-
- if [[ -f "${TOKEN_FILE}" ]]; then
- local -r repository=$(cat ${TOKEN_FILE})
- local -r remote_file="${CONTAINER_SHORTNAME}:${CONTAINER_VERSION}"
- local -r remote_path="${repository}/${remote_file}"
-
- $log "Publishing ${CONTAINER_IMAGE_FILE} to ${remote_path}"
-
- # Path to the repository.
- scp -q "${CONTAINER_IMAGE_FILE}" "${remote_path}"
- else
- error "Create ${TOKEN_FILE} with publish credentials"
- fi
-}
-
-# ---------------------------------------------------------------------------
-# Creates the command-line option for a read-only mountpoint.
-#
-# $1 - The host directory.
-# $2 - The guest (container) directory.
-# $3 - The file system permissions (set to 1 for read-write).
-# ---------------------------------------------------------------------------
-get_mountpoint() {
- local result=""
- local binding="ro"
-
- if [ ! -z "${3+x}" ]; then
- binding="Z"
- fi
-
- if [ ! -z "${1}" ]; then
- result="-v ${1}:${2}:${binding}"
- fi
-
- echo "${result}"
-}
-
-get_mountpoint_source() {
- echo $(get_mountpoint "${ARG_MOUNTPOINT_SOURCE}" "${CONTAINER_DIR_SOURCE}")
-}
-
-get_mountpoint_target() {
- echo $(get_mountpoint "${ARG_MOUNTPOINT_TARGET}" "${CONTAINER_DIR_TARGET}" 1)
-}
-
-get_mountpoint_images() {
- echo $(get_mountpoint "${ARG_MOUNTPOINT_IMAGES}" "${CONTAINER_DIR_IMAGES}")
-}
-
-get_mountpoint_fonts() {
- echo $(get_mountpoint "${ARG_MOUNTPOINT_FONTS}" "${CONTAINER_DIR_FONTS}")
-}
-
-# ---------------------------------------------------------------------------
-# Connects to the container.
-# ---------------------------------------------------------------------------
-utile_connect() {
- $log "Connecting to container"
-
- declare -r mount_source=$(get_mountpoint_source)
- declare -r mount_target=$(get_mountpoint_target)
- declare -r mount_images=$(get_mountpoint_images)
- declare -r mount_fonts=$(get_mountpoint_fonts)
-
- $log "mount_source = '${mount_source}'"
- $log "mount_target = '${mount_target}'"
- $log "mount_images = '${mount_images}'"
- $log "mount_fonts = '${mount_fonts}'"
-
- ${CONTAINER_EXE} run \
- --network="${CONTAINER_NETWORK}" \
- --rm \
- -it \
- ${mount_source} \
- ${mount_target} \
- ${mount_images} \
- ${mount_fonts} \
- "${ARG_CONTAINER_NAME}"
-}
-
-# ---------------------------------------------------------------------------
-# Runs a command in the container.
-#
-# Examples:
-#
-# ./manage.sh -r "ls /"
-# ./manage.sh -r "context --version"
-# ---------------------------------------------------------------------------
-utile_execute() {
- $log "Running \"${ARG_CONTAINER_COMMAND}\":"
-
- ${CONTAINER_EXE} run \
- --network=${CONTAINER_NETWORK} \
- --rm \
- -i \
- -t "${ARG_CONTAINER_NAME}" \
- /bin/sh --login -c "${ARG_CONTAINER_COMMAND}"
-}
-
-# ---------------------------------------------------------------------------
-# Saves the container to a file.
-# ---------------------------------------------------------------------------
-utile_export() {
- if [[ -f "${CONTAINER_COMPRESSED_PATH}" ]]; then
- warning "${CONTAINER_COMPRESSED_PATH} exists, delete before saving."
- else
- $log "Saving ${CONTAINER_SHORTNAME} image"
-
- mkdir -p "${BUILD_DIR}"
-
- ${CONTAINER_EXE} save \
- --quiet \
- -o "${BUILD_DIR}/${CONTAINER_ARCHIVE_FILE}" \
- "${ARG_CONTAINER_NAME}"
-
- $log "Compressing to ${CONTAINER_COMPRESSED_PATH}"
- gzip "${CONTAINER_ARCHIVE_PATH}"
-
- $log "Renaming to ${CONTAINER_IMAGE_FILE}"
- mv "${CONTAINER_COMPRESSED_PATH}" "${CONTAINER_IMAGE_FILE}"
-
- $log "Saved ${CONTAINER_IMAGE_FILE} image"
- fi
-}
-
-# ---------------------------------------------------------------------------
-# Loads the container from a file.
-# ---------------------------------------------------------------------------
-utile_load() {
- if [[ -f "${CONTAINER_COMPRESSED_PATH}" ]]; then
- $log "Loading ${CONTAINER_SHORTNAME} from ${CONTAINER_COMPRESSED_PATH}"
-
- ${CONTAINER_EXE} load \
- --quiet \
- -i "${CONTAINER_COMPRESSED_PATH}"
-
- $log "Loaded ${CONTAINER_SHORTNAME} image"
- else
- warning "Missing ${CONTAINER_COMPRESSED_PATH}; use build followed by save"
- fi
-}
-
-argument() {
- local consume=1
-
- case "$1" in
- -b|--build)
- do_build=utile_build
- ;;
- -c|--connect)
- do_connect=utile_connect
- ;;
- -d|--delete)
- do_delete=utile_delete
- ;;
- -l|--load)
- do_load=utile_load
- ;;
- -i|--images)
- if [ ! -z "${2+x}" ]; then
- ARG_MOUNTPOINT_IMAGES="$2"
- consume=2
- fi
- ;;
- -t|--target)
- if [ ! -z "${2+x}" ]; then
- ARG_MOUNTPOINT_TARGET="$2"
- consume=2
- fi
- ;;
- -p|--publish)
- do_publish=utile_publish
- ;;
- -r|--run)
- do_execute=utile_execute
-
- if [ ! -z "${2+x}" ]; then
- ARG_CONTAINER_COMMAND="$2"
- consume=2
- fi
- ;;
- -s|--source)
- if [ ! -z "${2+x}" ]; then
- ARG_MOUNTPOINT_SOURCE="$2"
- consume=2
- fi
- ;;
- -x|--export)
- do_export=utile_export
- ;;
- esac
-
- return ${consume}
-}
-
-do_build=:
-do_connect=:
-do_delete=:
-do_execute=:
-do_load=:
-do_publish=:
-do_export=:
-
-main "$@"
-
+set -euo pipefail # Exit on error, undefined vars, and pipe failures
+
+source ../scripts/build-template
+
+# Reads the value of a property from a properties file.
+#
+# $1 - The key name to obtain.
+function property {
+ if [[ ! -f "${PROPERTIES}" ]]; then
+ echo "Error: Properties file ${PROPERTIES} not found" >&2
+ exit 1
+ fi
+ grep "^${1}" "${PROPERTIES}" | cut -d'=' -f2
+}
+
+readonly BUILD_DIR=build
+readonly PROPERTIES="${SCRIPT_DIR}/../src/main/resources/com/keenwrite/messages.properties"
+
+readonly CONTAINER_EXE=podman
+readonly CONTAINER_SHORTNAME=$(property Wizard.typesetter.container.image.name)
+readonly CONTAINER_VERSION=$(property Wizard.typesetter.container.image.version)
+readonly CONTAINER_NETWORK=host
+readonly CONTAINER_IMAGE_FILE="${CONTAINER_SHORTNAME}-${CONTAINER_VERSION}"
+readonly CONTAINER_IMAGE_PATH="${BUILD_DIR}/${CONTAINER_IMAGE_FILE}"
+readonly CONTAINER_ARCHIVE_FILE="${CONTAINER_IMAGE_FILE}.tar"
+readonly CONTAINER_ARCHIVE_PATH="${BUILD_DIR}/${CONTAINER_ARCHIVE_FILE}"
+readonly CONTAINER_COMPRESSED_FILE="${CONTAINER_ARCHIVE_FILE}.gz"
+readonly CONTAINER_COMPRESSED_PATH="${BUILD_DIR}/${CONTAINER_COMPRESSED_FILE}"
+readonly CONTAINER_DIR_SOURCE="/root/source"
+readonly CONTAINER_DIR_TARGET="/root/target"
+readonly CONTAINER_DIR_IMAGES="/root/images"
+readonly CONTAINER_DIR_FONTS="/root/fonts"
+
+ARG_CONTAINER_NAME="${CONTAINER_SHORTNAME}:${CONTAINER_VERSION}"
+ARG_CONTAINER_COMMAND="context --version"
+ARG_MOUNTPOINT_SOURCE=""
+ARG_MOUNTPOINT_TARGET="."
+ARG_MOUNTPOINT_IMAGES=""
+ARG_MOUNTPOINT_FONTS="${HOME}/.fonts"
+
+DEPENDENCIES=(
+ "podman,https://podman.io"
+ "tar,https://www.gnu.org/software/tar"
+ "bzip2,https://gitlab.com/bzip2/bzip2"
+)
+
+ARGUMENTS+=(
+ "b,build,Build container"
+ "c,connect,Connect to container"
+ "d,delete,Remove all containers"
+ "s,source,Set mount point for input document (before typesetting)"
+ "t,target,Set mount point for output file (after typesetting)"
+ "i,images,Set mount point for image files (to typeset)"
+ "f,fonts,Set mount point for font files (during typesetting)"
+ "l,load,Load container (${CONTAINER_COMPRESSED_PATH})"
+ "p,publish,Publish the container"
+ "r,run,Run a command in the container (\"${ARG_CONTAINER_COMMAND}\")"
+ "x,export,Save container (${CONTAINER_COMPRESSED_PATH})"
+)
+
+# ---------------------------------------------------------------------------
+# Manages the container.
+# ---------------------------------------------------------------------------
+execute() {
+ ${do_delete}
+ ${do_build}
+ ${do_export}
+ ${do_publish}
+ ${do_load}
+ ${do_execute}
+ ${do_connect}
+
+ return 1
+}
+
+# ---------------------------------------------------------------------------
+# Deletes all containers.
+# ---------------------------------------------------------------------------
+utile_delete() {
+ [[ -f ${CONTAINER_IMAGE_PATH} ]] && \
+ $log "Deleting ${CONTAINER_IMAGE_PATH}"; \
+ rm -f "${CONTAINER_IMAGE_PATH}"
+
+ $log "Deleting all containers"
+
+ ${CONTAINER_EXE} rmi --all --force > /dev/null || true
+
+ $log "Containers deleted"
+}
+
+# ---------------------------------------------------------------------------
+# Builds the container file in the current working directory.
+# ---------------------------------------------------------------------------
+utile_build() {
+ $log "Building container version ${CONTAINER_VERSION}"
+
+ mkdir -p "${ARG_MOUNTPOINT_FONTS}"
+
+ # Show what commands are run while building, but not the commands' output.
+ ${CONTAINER_EXE} build \
+ --network="${CONTAINER_NETWORK}" \
+ --squash \
+ -t "${ARG_CONTAINER_NAME}" . | \
+ grep ^STEP || true
+}
+
+# ---------------------------------------------------------------------------
+# Publishes the container to the repository.
+# ---------------------------------------------------------------------------
+utile_publish() {
+ local -r HOST_PATH="host-path.txt"
+
+ if [[ -f "${HOST_PATH}" ]]; then
+ local -r repository=$(cat "${HOST_PATH}")
+ local -r remote_file="${CONTAINER_SHORTNAME}:${CONTAINER_VERSION}"
+ local -r remote_path="${repository}/${remote_file}"
+
+ $log "Publishing ${CONTAINER_IMAGE_PATH} to ${remote_path}"
+
+ # Path to the repository.
+ scp -q "${CONTAINER_IMAGE_PATH}" "${remote_path}"
+ else
+ error "Create ${HOST_PATH} with path on remote host"
+ fi
+}
+
+# ---------------------------------------------------------------------------
+# Creates the command-line option for a read-only mountpoint.
+#
+# $1 - The host directory.
+# $2 - The guest (container) directory.
+# $3 - The file system permissions (set to 1 for read-write).
+# ---------------------------------------------------------------------------
+get_mountpoint() {
+ local result=""
+ local binding="ro"
+
+ if [[ -n "${3:-}" ]]; then
+ binding="Z"
+ fi
+
+ if [[ -n "${1:-}" ]]; then
+ result="-v ${1}:${2}:${binding}"
+ fi
+
+ echo "${result}"
+}
+
+get_mountpoint_source() {
+ echo "$(get_mountpoint "${ARG_MOUNTPOINT_SOURCE}" "${CONTAINER_DIR_SOURCE}")"
+}
+
+get_mountpoint_target() {
+ echo "$(get_mountpoint "${ARG_MOUNTPOINT_TARGET}" "${CONTAINER_DIR_TARGET}" 1)"
+}
+
+get_mountpoint_images() {
+ echo "$(get_mountpoint "${ARG_MOUNTPOINT_IMAGES}" "${CONTAINER_DIR_IMAGES}")"
+}
+
+get_mountpoint_fonts() {
+ echo "$(get_mountpoint "${ARG_MOUNTPOINT_FONTS}" "${CONTAINER_DIR_FONTS}")"
+}
+
+# ---------------------------------------------------------------------------
+# Connects to the container.
+# ---------------------------------------------------------------------------
+utile_connect() {
+ $log "Connecting to container"
+
+ local mount_source
+ local mount_target
+ local mount_images
+ local mount_fonts
+
+ mount_source=$(get_mountpoint_source)
+ mount_target=$(get_mountpoint_target)
+ mount_images=$(get_mountpoint_images)
+ mount_fonts=$(get_mountpoint_fonts)
+
+ $log "mount_source = '${mount_source}'"
+ $log "mount_target = '${mount_target}'"
+ $log "mount_images = '${mount_images}'"
+ $log "mount_fonts = '${mount_fonts}'"
+
+ # Use array to properly handle empty mount options
+ local mount_args=()
+ [[ -n "${mount_source}" ]] && mount_args+=(${mount_source})
+ [[ -n "${mount_target}" ]] && mount_args+=(${mount_target})
+ [[ -n "${mount_images}" ]] && mount_args+=(${mount_images})
+ [[ -n "${mount_fonts}" ]] && mount_args+=(${mount_fonts})
+
+ # Ensure directories exist and log creation
+ for mount in "${mount_args[@]}"; do
+ # Extract host path from mount string (format: -v /host:/container)
+ host_path=$(echo "${mount}" | sed 's/^-v \([^:]*\):.*$/\1/')
+
+ [[ ! -d "$host_path" ]] && \
+ $log "Create directory: $host_path" && \
+ mkdir -p "$host_path"
+ done
+
+ ${CONTAINER_EXE} run \
+ --network="${CONTAINER_NETWORK}" \
+ --rm \
+ -it \
+ "${mount_args[@]}" \
+ "${ARG_CONTAINER_NAME}"
+}
+
+# ---------------------------------------------------------------------------
+# Runs a command in the container.
+#
+# Examples:
+#
+# ./manage.sh -r "ls /"
+# ./manage.sh -r "context --version"
+# ---------------------------------------------------------------------------
+utile_execute() {
+ $log "Running \"${ARG_CONTAINER_COMMAND}\":"
+
+ ${CONTAINER_EXE} run \
+ --network="${CONTAINER_NETWORK}" \
+ --rm \
+ -it \
+ "${ARG_CONTAINER_NAME}" \
+ /bin/sh --login -c "${ARG_CONTAINER_COMMAND}"
+}
+
+# ---------------------------------------------------------------------------
+# Saves the container to a file.
+# ---------------------------------------------------------------------------
+utile_export() {
+ if [[ -f "${CONTAINER_COMPRESSED_PATH}" ]]; then
+ warning "${CONTAINER_COMPRESSED_PATH} exists, delete before saving."
+ else
+ $log "Saving ${CONTAINER_SHORTNAME} image"
+
+ mkdir -p "${BUILD_DIR}"
+
+ ${CONTAINER_EXE} save \
+ --quiet \
+ -o "${CONTAINER_ARCHIVE_PATH}" \
+ "${ARG_CONTAINER_NAME}"
+
+ $log "Compressing to ${CONTAINER_COMPRESSED_PATH}"
+ gzip "${CONTAINER_ARCHIVE_PATH}"
+
+ $log "Renaming to ${CONTAINER_IMAGE_PATH}"
+ mv "${CONTAINER_COMPRESSED_PATH}" "${CONTAINER_IMAGE_PATH}"
+
+ $log "Saved ${CONTAINER_IMAGE_PATH} image"
+ fi
+}
+
+# ---------------------------------------------------------------------------
+# Loads the container from a file.
+# ---------------------------------------------------------------------------
+utile_load() {
+ if [[ -f "${CONTAINER_COMPRESSED_PATH}" ]]; then
+ $log "Loading ${CONTAINER_SHORTNAME} from ${CONTAINER_COMPRESSED_PATH}"
+
+ ${CONTAINER_EXE} load \
+ --quiet \
+ -i "${CONTAINER_COMPRESSED_PATH}"
+
+ $log "Loaded ${CONTAINER_SHORTNAME} image"
+ else
+ warning "Missing ${CONTAINER_COMPRESSED_PATH}; use build followed by save"
+ fi
+}
+
+argument() {
+ local consume=1
+
+ case "$1" in
+ -b|--build)
+ do_build=utile_build
+ ;;
+ -c|--connect)
+ do_connect=utile_connect
+ ;;
+ -z|--delete)
+ do_delete=utile_delete
+ ;;
+ -l|--load)
+ do_load=utile_load
+ ;;
+ -i|--images)
+ if [[ -n "${2:-}" ]]; then
+ ARG_MOUNTPOINT_IMAGES="$2"
+ consume=2
+ fi
+ ;;
+ -t|--target)
+ if [[ -n "${2:-}" ]]; then
+ ARG_MOUNTPOINT_TARGET="$2"
+ consume=2
+ fi
+ ;;
+ -p|--publish)
+ do_publish=utile_publish
+ ;;
+ -r|--run)
+ do_execute=utile_execute
+
+ if [[ -n "${2:-}" ]]; then
+ ARG_CONTAINER_COMMAND="$2"
+ consume=2
+ fi
+ ;;
+ -s|--source)
+ if [[ -n "${2:-}" ]]; then
+ ARG_MOUNTPOINT_SOURCE="$2"
+ consume=2
+ fi
+ ;;
+ -x|--export)
+ do_export=utile_export
+ ;;
+ esac
+
+ return ${consume}
+}
+
+do_build=:
+do_connect=:
+do_delete=:
+do_execute=:
+do_load=:
+do_publish=:
+do_export=:
+
+main "$@"
libs/keenquotes.jar
Binary files differ
src/main/java/com/keenwrite/dom/DocumentParser.java
sDocumentFactory.setValidating( false );
sDocumentFactory.setAttribute( LOAD_EXTERNAL_DTD, false );
- sDocumentFactory.setNamespaceAware( false );
+ sDocumentFactory.setNamespaceAware( true );
sDocumentFactory.setIgnoringComments( true );
sDocumentFactory.setIgnoringElementContentWhitespace( true );
final var target = createXhtmlDocument();
final var html = target.getDocumentElement();
- final var sourceHead = evaluate( "/html/head", source );
+ final var sourceHead = evaluate( "//head", source );
final var head = target.importNode( sourceHead, true );
src/main/java/com/keenwrite/processors/html/XhtmlProcessor.java
catch( final Exception ex ) {
// Implies that the head/body elements are missing from the document.
- final var element = document.createElement( name );
+ final var element = createElement( document, name, null );
document.getDocumentElement().appendChild( element );
src/main/resources/com/keenwrite/messages.properties
Wizard.typesetter.name=ConTeXt
Wizard.typesetter.container.name=Podman
-Wizard.typesetter.container.version=4.8.2
-Wizard.typesetter.container.checksum=250b12c24444005e09306eda38fa63c60cb1bdadf040f4e3f24f976e213cd462
+Wizard.typesetter.container.version=5.6.0
+Wizard.typesetter.container.checksum=fc8960481e6165b5d1ef05970a11b691b13d434d1f97ceb29b8be6f3902ba86c
Wizard.typesetter.container.image.name=typesetter
-Wizard.typesetter.container.image.version=3.2.0
+Wizard.typesetter.container.image.version=3.3.0
Wizard.typesetter.container.image.tag=${Wizard.typesetter.container.image.name}:${Wizard.typesetter.container.image.version}
Wizard.typesetter.container.image.url=https://repository.keenwrite.com/containers/${Wizard.typesetter.container.image.tag}
-Wizard.typesetter.themes.version=1.10.2
-Wizard.typesetter.themes.checksum=d2d3674434d914378af9a845fc363194cb4bc7a983eb3f8b7af38309faae19f6
+Wizard.typesetter.themes.version=1.11.0
+Wizard.typesetter.themes.checksum=87e258329d2a4c2802135c4828c2b095a92d62adf7e02925dba24ec4cc1fee6e
Wizard.container.install.command=Installing container using: ''{0}''
Delta389 lines added, 320 lines removed, 69-line increase