Skip to content

Commit

Permalink
Merge pull request #5389 from josegomezr/simplify_doc_build
Browse files Browse the repository at this point in the history
Simplify generation of documentation
  • Loading branch information
mergify[bot] authored Dec 13, 2023
2 parents cf97631 + 9d56e76 commit 6d98001
Show file tree
Hide file tree
Showing 8 changed files with 53 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .github/checklist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ 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-htmldoc`
- Consider generating documentation locally to verify it is rendered correctly using `tools/generate-docs`
"external/**":
- Consider doing this change in the upstream repository directly, see external/os-autoinst-common/README.md
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,5 @@ node_modules
package-lock.json
.tidyall.d/
openqa-documentation.html
docs/build/
docs/vendor/
8 changes: 8 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -350,3 +350,11 @@ test-helm-install:
.PHONY: update-deps
update-deps:
tools/update-deps --specfile dist/rpm/openQA.spec

.PHONY: generate-docs
generate-docs:
tools/generate-docs

.PHONY: serve-docs
serve-docs: generate-docs
(cd docs/build/; python3 -m http.server)
4 changes: 4 additions & 0 deletions docs/Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
source 'https://rubygems.org'

gem 'asciidoctor'
gem 'pygments.rb'
15 changes: 15 additions & 0 deletions docs/Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
GEM
remote: https://rubygems.org/
specs:
asciidoctor (2.0.20)
pygments.rb (2.4.1)

PLATFORMS
x86_64-linux

DEPENDENCIES
asciidoctor
pygments.rb

BUNDLED WITH
2.4.10
23 changes: 23 additions & 0 deletions tools/generate-docs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash -e

# Navigate to the docs directory
cd "$(dirname "${BASH_SOURCE[0]}")/../docs"
mkdir -p ./build/

if [[ ! -e ./build/images ]]; then
ln -s ../images build/images
fi

asciidoctor_bin=$(command -v asciidoctor) || true

if [[ -z "$asciidoctor_bin" ]]; then
echo "asciidoc not found in PATH."
echo "Fallback to Rubygem's Asciidoc"
export BUNDLE_PATH=./vendor/
# Make sure dependencies exist
bundle install
asciidoctor_bin="bundle exec asciidoctor"
fi

# Run asciidoc
$asciidoctor_bin -o build/index.html ./index.asciidoc -d book
4 changes: 0 additions & 4 deletions tools/generate-htmldoc

This file was deleted.

9 changes: 0 additions & 9 deletions tools/generate-htmldoc-in-container

This file was deleted.

0 comments on commit 6d98001

Please sign in to comment.