Darwin’s documentation
Prerequisites
Install Homebrew:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Verify Homebrew is setup correctly:
brew doctor
Install Git and Ruby:
brew install git
brew install ruby
Add the location where Homebrew installed Ruby to your PATH environment variable:
echo 'PATH=/usr/local/bin:${PATH/:\/usr\/local\/bin}' >> $HOME/.bash_profile
source $HOME/.bash_profile
Configure RubyGems to install executables into /usr/local/bin so they will be available on your executable path:
echo "gem: -N -n /usr/local/bin" >> $HOME/.gemrc
Install Asciidoctor:
gem install asciidoctor
Verify Asciidoctor is installed and you can execute the asciidoctor command:
asciidoctor -V
Asciidoctor PDF is published in pre-release on RubyGems.org. You can install the published gem using the following command:
gem install --pre asciidoctor-pdf
If you want to syntax highlight source listings, you’ll also want to install CodeRay or Pygments. To be safe, go ahead and install both gems:
gem install coderay pygments.rb
Usage
To generate html:
asciidoctor index.adoc
To generate pdf:
asciidoctor-pdf index.adoc
Recommended text editor
Install Atom. Then from the Atom editor menus, navigate to Atom ▸ Preferences. From there, open the Packages tab and install:
-
asciidoc-preview
-
language-asciidoc