Skip to content

Convert AsciiDoctor Docker Action

Actions
AsciiDoc Convert action
v1
Latest
Star (6)

Asciidoctor docker action

You can use Asciidoctor command easily if you use this action

Inputs

shellcommand

required bash command
default 'asciidoctor index.adoc'

Example

For more advanced use, please use [Analog-inc/asciidoctor-action-sample].

Example Nomal

workflow.yml
steps:
- name: Convert AsciiDoc step
  id: documents
  uses: Analog-inc/asciidoctor-action@master
  with:
    shellcommand: "asciidoctor index.adoc"

Example shell script

Copy [into.github/workflows] to your repository [.github/workflows]

github/workflows/asciidoc.sh
#!/bin/bash
set -e

CURRENT_PATH=`pwd`
ASCIIDOCTOR_PDF_DIR=`gem contents asciidoctor-pdf --show-install-dir`

# -a, --attribute=ATTRIBUTE
# -B, --base-dir=DIR
# -D, --destination-dir=DIR
# -o, --out-file=OUT_FILE
# -R, --source-dir=DIR
# -b, --backend=BACKEND
# -d, --doctype=DOCTYPE
# -r, --require=LIBRARY

# Output HTML
mkdir -p ./outputs/html
asciidoctor -B ${CURRENT_PATH}/ -D ${CURRENT_PATH}/outputs/html/ -o index.html -r asciidoctor-diagram index.adoc

# Output PDF
mkdir -p ./outputs/pdf
asciidoctor-pdf -B ${CURRENT_PATH}/ -D ${CURRENT_PATH}/outputs/pdf/ -o index.pdf -a scripts@=cjk -r asciidoctor-diagram index.adoc

# Output ePub
mkdir -p ./outputs/ebub
asciidoctor-epub3 -B ${CURRENT_PATH}/ -D ${CURRENT_PATH}/outputs/ebub/ -o index.epub -r asciidoctor-diagram index.adoc
github/workflows/main.yml
name: CI

on: [push]

jobs:
  asciidoctor_job:
    runs-on: ubuntu-latest
    name: Convert AsciiDoctor
    steps:
    - name: Check out code
      uses: actions/checkout@v3
      ## https://github.com/actions/checkout
      # with:
      # Default: ${{ github.repository }}
      # repository: ''
      # Otherwise, defaults to `master`.
      # ref: ''
      # Default: ${{ github.token }}
      # token: ''
      # Default: true
      # persist-credentials: ''
      # Relative path under $GITHUB_WORKSPACE to place the repository
      # path: ''
      # Default: true
      # clean: ''
      # Default: 1
      # fetch-depth: ''
      # Default: false
      # lfs: ''
    - name: Convert AsciiDoc step
      id: documents
      uses: Analog-inc/asciidoctor-action@master
      with:
        shellcommand: "./.github/workflows/asciidoc.sh"
    # Use the output from the documents step
    - name: Save AsciiDoc step
      uses: actions/upload-artifact@v1
      with:
        name: Docs
        path: ./outputs/

Convert AsciiDoctor Docker Action is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.

About

AsciiDoc Convert action
v1
Latest

Convert AsciiDoctor Docker Action is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.