hugo/helpers
Anthony Fok 358dcce7a6 Experimental AsciiDoc support with external helpers
See #470

 * Based on existing support for reStructuredText files

 * Handles content files with extensions `.asciidoc` and `.ad`

 * Pipes content through `asciidoctor --safe -`.
   If `asciidoctor` is not installed, then `asciidoc --safe -`.

 * To make sure `asciidoctor` or `asciidoc` is found, after adding
   a piece of AsciiDoc content, run `hugo` with the `-v` flag
   and look for this message:

        INFO: 2015/01/23 Rendering with /usr/bin/asciidoctor ...

Caveats:

 * The final "Last updated" timestamp is currently not stripped.

 * When `hugo` is run with `-v`, you may see a lot of these messages

        INFO: 2015/01/23 Rendering with /usr/bin/asciidoctor ...

   if you have lots of `*.ad`, `*.adoc` or `*.asciidoc` files.

 * Some versions of `asciidoc` may have trouble with its safe mode.
   To test if you are affected, try this:

        $ echo "Hello" | asciidoc --safe -
        asciidoc: ERROR: unsafe: ifeval invalid
        asciidoc: FAILED: ifeval invalid safe document

   If so, I recommend that you install `asciidoctor` instead.

Feedback and patches welcome!

Ideally, we should be using https://github.com/VonC/asciidocgo,
@VonC's wonderful Go implementation of Asciidoctor.  However,
there is still a bit of work needed for asciidocgo to expose
its API so that Hugo can actually use it.

Until then, hope this "experimental AsciiDoc support through external
helpers" can serve as a stopgap solution for our community. :-)

2015-01-30: Updated for the replaceShortcodeTokens() syntax change
2015-02-21: Add `.adoc` extension as suggested by @Fale

Conflicts:
	helpers/content.go
2015-03-12 22:01:49 -04:00
..
content.go Experimental AsciiDoc support with external helpers 2015-03-12 22:01:49 -04:00
content_test.go Correct initialisms as suggested by golint 2015-03-11 21:55:00 +01:00
general.go Experimental AsciiDoc support with external helpers 2015-03-12 22:01:49 -04:00
general_test.go Experimental AsciiDoc support with external helpers 2015-03-12 22:01:49 -04:00
path.go helpers: apply some Golint rules 2015-03-07 00:02:06 +01:00
path_test.go Fix errors reported by Go Vet 2015-03-06 15:25:19 +01:00
pygments.go Wrap comments helpers package to fit 80-column width 2014-12-26 08:07:03 -07:00
url.go Correct initialisms as suggested by golint 2015-03-11 21:55:00 +01:00
url_test.go Correct initialisms as suggested by golint 2015-03-11 21:55:00 +01:00