diff --git a/.github/workflows/documentation.yaml b/.github/workflows/documentation.yaml index 5266dc2f2..268cdf3e7 100644 --- a/.github/workflows/documentation.yaml +++ b/.github/workflows/documentation.yaml @@ -29,6 +29,9 @@ jobs: uses: actions/configure-pages@v3 - name: Checkout uses: actions/checkout@v3 + - uses: ruby/setup-ruby@v1.160.0 + with: + ruby-version: '3.2' - name: Setup python uses: actions/setup-python@v4 with: diff --git a/.gitignore b/.gitignore index 9249648c0..c3ac8fd8c 100644 --- a/.gitignore +++ b/.gitignore @@ -38,3 +38,9 @@ tests/output/** # Dynamic antsibull-docs source docs/source/collections/** + +# ASCIIDOC +.bundle +docs_build +Gemfile.lock +.ruby diff --git a/docs/Gemfile b/docs/Gemfile new file mode 100644 index 000000000..3dfdabbcd --- /dev/null +++ b/docs/Gemfile @@ -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' diff --git a/docs/build-docs.sh b/docs/build-docs.sh index 16fe04ddb..ab892e8dd 100755 --- a/docs/build-docs.sh +++ b/docs/build-docs.sh @@ -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} diff --git a/docs/source/main.adoc b/docs/source/main.adoc new file mode 100644 index 000000000..e23690139 --- /dev/null +++ b/docs/source/main.adoc @@ -0,0 +1 @@ +== EDPM ansible