Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds support for asciidoctor-lists #262

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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} \
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

<div class="note">
Expand Down
17 changes: 17 additions & 0 deletions tests/asciidoctor.bats
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -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
}
63 changes: 63 additions & 0 deletions tests/fixtures/sample-with-lists.adoc
Original file line number Diff line number Diff line change
@@ -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[]
90 changes: 90 additions & 0 deletions updatecli/updatecli.d/asciidoctor-lists.yml
Original file line number Diff line number Diff line change
@@ -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