Docker convenience wrapper for Asciidoctor.
The basic requirements:
- Docker
- Optionally your system could be running
- NodeJS version 10+
- Yarn 1.13+, otherwise NPM should be adequate.
Using Docker, script into Asciidoctor...
Asciidoctor Build is a Docker wrapper around Asciidoctor, you pass Asciidoctor options directly through to Asciidoctor.
Usage: [options]
Options:
-t Test, run "hello world" example [boolean]
-f Files, comma seperated file extensions to watch [default: adoc,asc,md]
-w Watch, rebuild the src directory onchange [default: false]
-e Execute, asciidoctor options call string [default: asciidoctor -h]
For the full range of Asciidoctor options to "execute" you'll need to reference the Asciidoctor docs
Asciidoctor Build can be found on Docker Hub...
The base Docker image comes preloaded with a "hello world" example, the basics should generate a directory/file called dist/hellowWorld.html
$ docker pull cdcabrera/asciidoctor-build
$ docker stop asciidoctor-build-test
$ docker run -it --rm -v "$(pwd)/dist:/output" --name asciidoctor-build-test cdcabrera/asciidoctor-build -t
Set it up within a NPM script. Where your output is a dist
directory and your source is a src
directory
"scripts": {
"dockerAsciidoc": "docker run -it --rm -v \"$(pwd)/src:/data\" -v \"$(pwd)/dist:/output\" --name asciidoctor-build cdcabrera/asciidoctor-build",
"example": "npm run dockerAsciidoc -w -e \"asciidoctor -t -dbook -a toc -v -o ../output/exampleOutputFileInDistDir.html ../data/exampleFileInSrcDir.adoc\""
}