From bb83c4f6852366247754656d88bcc9354a4f58db Mon Sep 17 00:00:00 2001 From: Jakub Nowakowski Date: Thu, 26 Aug 2021 16:11:00 +0200 Subject: [PATCH 1/3] Install rouge gem Rouge is an optional source code highlighter we use in some projects. --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index a731de3..6bcf6e4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ FROM ruby:2-alpine -RUN gem install asciidoctor asciidoctor-pdf asciidoctor-diagram +RUN gem install asciidoctor asciidoctor-pdf asciidoctor-diagram rouge RUN apk add --no-cache \ chromium \ From bb6582a45dfe66ab42739ef95604532369ecef7b Mon Sep 17 00:00:00 2001 From: Jakub Nowakowski Date: Thu, 26 Aug 2021 17:14:55 +0200 Subject: [PATCH 2/3] Use rouge as default source-highlighter `source-highlighter` for documents conversion will be set to `rouge` by default. If a document specifies its own `source-highlighter`, the document configuration will take precedence thanks to the `@` in the `-a source-highlighter@=rouge` flag we pass here. --- entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entrypoint.sh b/entrypoint.sh index 6b071b3..5ac3025 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -36,7 +36,7 @@ if [[ -z $INPUT_FILES ]]; then exit $EX_USAGE fi -COMMAND=$(echo "$ASCIIDOCTOR -R . -D $GITHUB_WORKSPACE/asciidoc-out -r asciidoctor-diagram -a mermaid-puppeteer-config=/mermaid/puppeteer-config.json" $ASCIIDOCTOR_ARGS $INPUT_FILES) +COMMAND=$(echo "$ASCIIDOCTOR -R . -D $GITHUB_WORKSPACE/asciidoc-out -r asciidoctor-diagram -a mermaid-puppeteer-config=/mermaid/puppeteer-config.json -a source-highlighter@=rouge" $ASCIIDOCTOR_ARGS $INPUT_FILES) OUTPUT= echo "Running '$COMMAND'" From c3aa9625a3f985b4baaac6729421d0a8103db330 Mon Sep 17 00:00:00 2001 From: Jakub Nowakowski Date: Thu, 26 Aug 2021 17:21:20 +0200 Subject: [PATCH 3/3] Updated test with new argument The argument was added in the previous commit. --- .github/workflows/test.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 5003d5d..c17506f 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -18,7 +18,7 @@ jobs: files: 'test/*.adoc test/**/*.adoc' env: TEST_COMMAND: |- - asciidoctor -R . -D /github/workspace/asciidoc-out -r asciidoctor-diagram -a mermaid-puppeteer-config=/mermaid/puppeteer-config.json test/index.adoc test/index.adoc test/subdir/subdir.adoc test/subdir/subsubdir/index.adoc test/subdir/subsubdir/subsubdir.adoc test/subdir/subsubdir/vamoose.adoc test/subdir2/subdir2.adoc + asciidoctor -R . -D /github/workspace/asciidoc-out -r asciidoctor-diagram -a mermaid-puppeteer-config=/mermaid/puppeteer-config.json -a source-highlighter@=rouge test/index.adoc test/index.adoc test/subdir/subdir.adoc test/subdir/subsubdir/index.adoc test/subdir/subsubdir/subsubdir.adoc test/subdir/subsubdir/vamoose.adoc test/subdir2/subdir2.adoc TEST_OUTPUT: |- ::set-output name=asciidoctor-artifacts::asciidoc-out test-html-args: @@ -34,7 +34,7 @@ jobs: env: DATE: '+%Y-%m-%d' TEST_COMMAND: |- - asciidoctor -R . -D /github/workspace/asciidoc-out -r asciidoctor-diagram -a mermaid-puppeteer-config=/mermaid/puppeteer-config.json -a revdate=`date +%Y-%m-%d` --failure-level=ERROR test/index.adoc test/index.adoc test/subdir/subdir.adoc test/subdir/subsubdir/index.adoc test/subdir/subsubdir/subsubdir.adoc test/subdir/subsubdir/vamoose.adoc test/subdir2/subdir2.adoc + asciidoctor -R . -D /github/workspace/asciidoc-out -r asciidoctor-diagram -a mermaid-puppeteer-config=/mermaid/puppeteer-config.json -a source-highlighter@=rouge -a revdate=`date +%Y-%m-%d` --failure-level=ERROR test/index.adoc test/index.adoc test/subdir/subdir.adoc test/subdir/subsubdir/index.adoc test/subdir/subsubdir/subsubdir.adoc test/subdir/subsubdir/vamoose.adoc test/subdir2/subdir2.adoc TEST_OUTPUT: |- ::set-output name=asciidoctor-artifacts::asciidoc-out test-pdf: @@ -49,7 +49,7 @@ jobs: format: 'pdf' env: TEST_COMMAND: |- - asciidoctor-pdf -R . -D /github/workspace/asciidoc-out -r asciidoctor-diagram -a mermaid-puppeteer-config=/mermaid/puppeteer-config.json test/index.adoc test/index.adoc test/subdir/subdir.adoc test/subdir/subsubdir/index.adoc test/subdir/subsubdir/subsubdir.adoc test/subdir/subsubdir/vamoose.adoc test/subdir2/subdir2.adoc + asciidoctor-pdf -R . -D /github/workspace/asciidoc-out -r asciidoctor-diagram -a mermaid-puppeteer-config=/mermaid/puppeteer-config.json -a source-highlighter@=rouge test/index.adoc test/index.adoc test/subdir/subdir.adoc test/subdir/subsubdir/index.adoc test/subdir/subsubdir/subsubdir.adoc test/subdir/subsubdir/vamoose.adoc test/subdir2/subdir2.adoc TEST_OUTPUT: |- ::set-output name=asciidoctor-artifacts::asciidoc-out test-pdf-args: @@ -65,6 +65,6 @@ jobs: asciidoctor-args: '-a revdate=`date +%Y-%m-%d` --failure-level=ERROR' env: TEST_COMMAND: |- - asciidoctor-pdf -R . -D /github/workspace/asciidoc-out -r asciidoctor-diagram -a mermaid-puppeteer-config=/mermaid/puppeteer-config.json -a revdate=`date +%Y-%m-%d` --failure-level=ERROR test/index.adoc test/index.adoc test/subdir/subdir.adoc test/subdir/subsubdir/index.adoc test/subdir/subsubdir/subsubdir.adoc test/subdir/subsubdir/vamoose.adoc test/subdir2/subdir2.adoc + asciidoctor-pdf -R . -D /github/workspace/asciidoc-out -r asciidoctor-diagram -a mermaid-puppeteer-config=/mermaid/puppeteer-config.json -a source-highlighter@=rouge -a revdate=`date +%Y-%m-%d` --failure-level=ERROR test/index.adoc test/index.adoc test/subdir/subdir.adoc test/subdir/subsubdir/index.adoc test/subdir/subsubdir/subsubdir.adoc test/subdir/subsubdir/vamoose.adoc test/subdir2/subdir2.adoc TEST_OUTPUT: |- ::set-output name=asciidoctor-artifacts::asciidoc-out