A simple asciidoc template and configuration script.
-
Install Vagrant and Virtualbox
$ git clone https://github.com/CharlesTBetz/adoc.git $ cd adoc $ vagrant up && vagrant ssh #takes about 30 minutes. be patient. it is not hung. $ cd /vagrant
-
See generated adoc.html, adoc.pdf and adoc2.pdf results in /vagrant
-
As /vagrant is your shared directory, they are also now on your primary workstation in the adoc directory you cloned, and can be viewed with your browser and pdf reader there.
-
-
Play with *.asc files (AsciiDoc cheatsheet)
$ ./render.sh #re-render html & pdf. Destroys previous, no warning.
Sets up the Asciidoc toolchain on a Vagrant ubuntu64/trusty box.
Extensively lifted from the Pro Git folks. Basically took their book and started stripping it down as an educational exercise. Wound up with this possibly useful minimum.
The preqs.sh script and subsequent Gemfile bundler might run on most recent Ubuntus without Vagrant; YMMV.
Installs:
-
prereqs and Ruby 2.2.1 (built from source)
-
various other stuff (see Gemfile)
It then renders the simple document contained in the following files:
├── adoc.asc ├── Chap-01 │ ├── Chap-01-Sec-00.asc │ ├── Chap-01-Sec-01.asc │ ├── Chap-01-Sec-02.asc │ └── images │ └── cat.jpg ├── Chap-99 │ ├── Chap-99-Sec-00.asc │ ├── Chap-99-Sec-01-appendices.asc │ └── Chap-99-Sec-02-references.asc
into
-
adoc.html and an images directory
-
adoc.pdf (asciidoc render)
-
adoc2.pdf (asciidoctor render)
At this writing, the community intent seemingly is to deprecate asciidoc in favor of asciidoctor. I discovered different behaviors between asciidoc and asciidoctor pdf rendering in a complex document and currently include both in this build.
asciidoc-bib is included but not currently exercised in the document or rendering script. It would require the creation of a *.bib file.
I recommend Github Atom with the Asciidoc preview plugin for WYSIWYG editing.
Yes, the shell script is fragile. No error handling, everything baked in. This is investigative/POC work.
From scratch, this is time consuming, perhaps 30 minutes depending on your broadband speed. Downloading the Ubuntu VM, building Ruby, and installing asciidoc & fop all take significant chunks.
My impression is that there are many dependencies and failure modes in this toolchain, so building it in its own VM is helpful. I intend to pursue a Docker build time permitting.