Skip to content

Commit

Permalink
Asciidocs build procedure
Browse files Browse the repository at this point in the history
Signed-off-by: Jiri Podivin <[email protected]>
  • Loading branch information
jpodivin committed Jan 2, 2024
1 parent 5ead703 commit 7b04148
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/documentation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ jobs:
uses: actions/configure-pages@v3
- name: Checkout
uses: actions/checkout@v3
- uses: ruby/[email protected]
with:
ruby-version: '3.2'
- name: Setup python
uses: actions/setup-python@v4
with:
Expand Down
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,9 @@ tests/output/**

# Dynamic antsibull-docs source
docs/source/collections/**

# ASCIIDOC
.bundle
docs_build
Gemfile.lock
.ruby
6 changes: 6 additions & 0 deletions docs/Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
source 'https://rubygems.org'

gem 'asciidoctor', '~> 2.0', '>= 2.0.20'

# Uncomment for ability to render pdf:
# gem 'asciidoctor-pdf', '~> 2.0', '>= 2.0.20'
21 changes: 21 additions & 0 deletions docs/build-docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,26 @@ doc8 --config ${DOCS_DIR}/doc8.ini ${DOCS_DIR}/source

sphinx-build -a -E -W -d ${DOCS_DIR}/build/doctrees --keep-going -b html ${DOCS_DIR}/source ${DOCS_DIR}/build/html -T

## ASCIIDocs
# Dependencies
if ! type bundle; then \
echo "Bundler not found. On Linux run 'sudo dnf install /usr/bin/bundle' to install it."; \
exit 1; \
fi

bundle config set path .ruby/.bundle
bundle install --gemfile=${DOCS_DIR}/Gemfile --binstubs=.ruby

# Build
${DOCS_DIR}/.ruby/asciidoctor -a source-highlighter=highlightjs \
-a highlightjs-languages="yaml,bash" \
-a highlightjs-theme="monokai" \
--failure-level WARN \
-a build=build \
-b xhtml5 \
-d book \
-o ${DOCS_DIR}/build/html/index-asciidoc.html \
${DOCS_DIR}/source/main.adoc

deactivate
rm -fr ${TEMP_VENV_ENV}
1 change: 1 addition & 0 deletions docs/source/main.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
== EDPM ansible

0 comments on commit 7b04148

Please sign in to comment.