diff --git a/Dockerfile b/Dockerfile index 5ee28ea2..c5bf449c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,6 +12,7 @@ ARG asciidoctor_revealjs_version=4.1.0 ARG kramdown_asciidoc_version=2.0.0 ARG asciidoctor_bibtex_version=0.8.0 ARG asciidoctor_kroki_version=0.5.0 +ARG asciidoctor_lists_version=1.0.8 ENV ASCIIDOCTOR_VERSION=${asciidoctor_version} \ ASCIIDOCTOR_CONFLUENCE_VERSION=${asciidoctor_confluence_version} \ @@ -23,7 +24,8 @@ ENV ASCIIDOCTOR_VERSION=${asciidoctor_version} \ ASCIIDOCTOR_REVEALJS_VERSION=${asciidoctor_revealjs_version} \ KRAMDOWN_ASCIIDOC_VERSION=${kramdown_asciidoc_version} \ ASCIIDOCTOR_BIBTEX_VERSION=${asciidoctor_bibtex_version} \ - ASCIIDOCTOR_KROKI_VERSION=${asciidoctor_kroki_version} + ASCIIDOCTOR_KROKI_VERSION=${asciidoctor_kroki_version} \ + ASCIIDOCTOR_LISTS_VERSION=${asciidoctor_lists_version} # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # Minimal image with asciidoctor @@ -127,6 +129,7 @@ RUN apk add --no-cache --virtual .rubymakedepends \ text-hyphen \ "asciidoctor-bibtex:${ASCIIDOCTOR_BIBTEX_VERSION}" \ "asciidoctor-kroki:${ASCIIDOCTOR_KROKI_VERSION}" \ + "asciidoctor-lists:${ASCIIDOCTOR_LISTS_VERSION}" \ && apk del -r --no-cache .rubymakedepends # Installing Python dependencies for additional functionality diff --git a/README.md b/README.md index c8cb9736..fa3e4456 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,8 @@ This Docker image provides: - [Asciidoctor Kroki](https://github.com/Mogztter/asciidoctor-kroki) 0.5.0 +- [Asciidoctor Lists](https://github.com/Alwinator/asciidoctor-lists) 1.0.8 + This image uses Alpine Linux 3.15.4 as base image.
diff --git a/tests/asciidoctor.bats b/tests/asciidoctor.bats index 4eea4935..5a145c37 100644 --- a/tests/asciidoctor.bats +++ b/tests/asciidoctor.bats @@ -13,6 +13,7 @@ ASCIIDOCTOR_REVEALJS_VERSION=4.1.0 KRAMDOWN_ASCIIDOC_VERSION=2.0.0 ASCIIDOCTOR_BIBTEX_VERSION=0.8.0 ASCIIDOCTOR_KROKI_VERSION=0.5.0 +ASCIIDOCTOR_LISTS_VERSION=1.0.8 DOCKER_IMAGE_NAME_TO_TEST="${IMAGE_NAME:-asciidoctor}" clean_generated_files() { @@ -303,3 +304,19 @@ teardown() { grep 'Mane' ${TMP_GENERATION_DIR}/sample-with-bib.html } + +@test "We can use asciidoctor-lists" { + docker run -t --rm \ + -v "${BATS_TEST_DIRNAME}":/documents/ \ + "${DOCKER_IMAGE_NAME_TO_TEST}" \ + asciidoctor -r asciidoctor-lists \ + -o /documents/tmp/sample-with-lists.html \ + /documents/fixtures/sample-with-lists.adoc + + docker run -t --rm \ + -v "${BATS_TEST_DIRNAME}":/documents/ \ + "${DOCKER_IMAGE_NAME_TO_TEST}" \ + asciidoctor-pdf -r asciidoctor-lists \ + -o /documents/tmp/sample-with-lists.pdf \ + /documents/fixtures/sample-with-lists.adoc +} diff --git a/tests/fixtures/sample-with-lists.adoc b/tests/fixtures/sample-with-lists.adoc new file mode 100644 index 00000000..09328561 --- /dev/null +++ b/tests/fixtures/sample-with-lists.adoc @@ -0,0 +1,63 @@ += Test the List Macro +:listing-caption: Code + +.Gemfile.lock +---- +GEM + remote: https://rubygems.org/ + specs: + asciidoctor (2.0.15) + +PLATFORMS + ruby + +DEPENDENCIES + asciidoctor (~> 2.0.15) +---- + +.The wonderful linux logo +image::https://upload.wikimedia.org/wikipedia/commons/3/35/Tux.svg[Linux Logo,100,100] + +.Some Ruby code +[source,ruby] +---- +require 'sinatra' + +get '/hi' do + "Hello World!" +end +---- + +.This is my first table +|=== +|Column 1, Header Row |Column 2, Header Row + +|Cell in column 1, row 1 +|Cell in column 2, row 1 + +|Cell in column 1, row 2 +|Cell in column 2, row 2 +|=== + +.And this is the second one +|=== +|Column 1, Header Row |Column 2, Header Row + +|Cell in column 1, row 1 +|Cell in column 2, row 1 + +|Cell in column 1, row 2 +|Cell in column 2, row 2 +|=== + +.Another wikipedia SVG image +image::https://upload.wikimedia.org/wikipedia/commons/thumb/4/4f/SVG_Logo.svg/400px-SVG_Logo.svg.png[SVG,100,100] + +== List of figures +list-of::image[] + +== List of tables +list-of::table[] + +== List of code snippets +list-of::listing[] diff --git a/updatecli/updatecli.d/asciidoctor-lists.yml b/updatecli/updatecli.d/asciidoctor-lists.yml new file mode 100644 index 00000000..84307506 --- /dev/null +++ b/updatecli/updatecli.d/asciidoctor-lists.yml @@ -0,0 +1,90 @@ +--- +title: "Bump Asciidoctor-Lists version" + +scms: + default: + kind: github + spec: + user: "{{ .github.user }}" + email: "{{ .github.email }}" + owner: "{{ requiredEnv .github.owner }}" + repository: "{{ requiredEnv .github.repository }}" + token: "{{ requiredEnv .github.token }}" + username: "{{ .github.username }}" + branch: "{{ .github.branch }}" + +sources: + latestVersion: + kind: githubRelease + name: "Get the latest Asciidoctor-Lists version" + spec: + owner: "Alwinator" + repository: "asciidoctor-lists" + token: "{{ requiredEnv .github.token }}" + username: "{{ .github.username }}" + versionFilter: + kind: latest + transformers: + - trimPrefix: "v" + +conditions: + testDockerfileArgVersion: + name: "Does the Dockerfile have an ARG instruction which key is asciidoctor_lists_version?" + kind: dockerfile + spec: + file: Dockerfile + instruction: + keyword: "ARG" + matcher: "asciidoctor_lists_version" + testVersionInReadme: + name: "Does the README.adoc have a variable ASCIIDOCTOR_LISTS_VERSION" + kind: file + spec: + file: README.adoc + matchPattern: '(?m:^:ASCIIDOCTOR_LISTS_VERSION:.*)' + testVersionInTestHarness: + name: "Does the test harness have variable ASCIIDOCTOR_LISTS_VERSION" + kind: file + spec: + file: tests/asciidoctor.bats + matchPattern: '(?m:^ASCIIDOCTOR_LISTS_VERSION=.*)' + +targets: + updateDockerfile: + name: "Update the value of ARG asciidoctor_lists_version in the Dockerfile" + kind: dockerfile + spec: + file: Dockerfile + instruction: + keyword: "ARG" + matcher: "asciidoctor_lists_version" + scmID: default + updateTestHarness: + name: "Update the key ASCIIDOCTOR_LISTS_VERSION in the test harness" + kind: file + spec: + file: tests/asciidoctor.bats + matchPattern: '(?m:^ASCIIDOCTOR_LISTS_VERSION=.*)' + content: 'ASCIIDOCTOR_LISTS_VERSION={{ source `latestVersion` }}' + scmID: default + updateReadme: + name: "Update the key ASCIIDOCTOR_LISTS_VERSION in the README.adoc file" + kind: file + spec: + file: README.adoc + matchPattern: '(?m:^:ASCIIDOCTOR_LISTS_VERSION:.*)' + content: ':ASCIIDOCTOR_LISTS_VERSION: {{ source `latestVersion` }}' + scmID: default + +pullrequests: + default: + kind: github + scmID: default + targets: + - updateDockerfile + - updateTestHarness + - updateReadme + spec: + labels: + - chore + - dependencies