From 859272d1b90d0836a912925f50ca9b3d9e5fb5ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tina=20M=C3=BCller?= Date: Tue, 26 Apr 2022 11:17:12 +0200 Subject: [PATCH] Add simple command to generate HTML documentation tools/generate-htmldoc will generate the HTML documentation in a container and write it to openqa-documentation.html The checklist suggestes to run this command to check if any asciidoc changes are looking good, instead of the previous non functioning tools/generate-documentation suggestion. Issue: https://progress.opensuse.org/issues/110181 --- .github/checklist.yml | 2 +- .gitignore | 1 + tools/generate-htmldoc | 4 ++++ tools/generate-htmldoc-in-container | 9 +++++++++ 4 files changed, 15 insertions(+), 1 deletion(-) create mode 100755 tools/generate-htmldoc create mode 100755 tools/generate-htmldoc-in-container diff --git a/.github/checklist.yml b/.github/checklist.yml index 6df11c38b79..83142115ecd 100644 --- a/.github/checklist.yml +++ b/.github/checklist.yml @@ -4,4 +4,4 @@ paths: "assets/stylesheets/**": - Consider providing screenshots in a PR comment to show the difference visually "docs/*.asciidoc": - - Consider generating documentation locally to verify it is rendered correctly using `tools/generate-documentation` + - Consider generating documentation locally to verify it is rendered correctly using `tools/generate-htmldoc` diff --git a/.gitignore b/.gitignore index dd83cce690b..c59a79a0b2d 100644 --- a/.gitignore +++ b/.gitignore @@ -45,3 +45,4 @@ job.json node_modules package-lock.json .tidyall.d/ +openqa-documentation.html diff --git a/tools/generate-htmldoc b/tools/generate-htmldoc new file mode 100755 index 00000000000..79a98eb2173 --- /dev/null +++ b/tools/generate-htmldoc @@ -0,0 +1,4 @@ +#!/bin/bash -e + +cre=${cre:-"podman"} +$cre run -it --rm -v"$PWD"/:/openqa --workdir /openqa --env GEM_HOME=/home/squamata/.gem registry.opensuse.org/devel/openqa/ci/containers/base:latest tools/generate-htmldoc-in-container diff --git a/tools/generate-htmldoc-in-container b/tools/generate-htmldoc-in-container new file mode 100755 index 00000000000..8dade344406 --- /dev/null +++ b/tools/generate-htmldoc-in-container @@ -0,0 +1,9 @@ +#!/bin/bash -e + +gem install asciidoctor pygments.rb + +asciidoctor_bin=$(command -v asciidoctor) || true +[[ -n "$asciidoctor_bin" ]] || \ + for asciidoctor_bin in "${GEM_HOME}"/bin/asciidoctor.ruby*; do :; done +set -x +"$asciidoctor_bin" -o openqa-documentation.html docs/index.asciidoc -d book