-
-
Notifications
You must be signed in to change notification settings - Fork 7.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Experimental AsciiDoc support with external helpers #826
Experimental AsciiDoc support with external helpers #826
Conversation
Running with asciidoctor works fine, but there are room for fine-tuning: 1000 small pages, Blackfriday vs acsiidoctor:
|
ec257d6
to
bdcba05
Compare
a4384ae
to
5aab938
Compare
The .adoc extension is very popular for asciidoc files. I would add it too :) |
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
5aab938
to
c5ad8cd
Compare
Thank you for your suggestion, @Fale! The |
Thanks to you for the fast fix. I hope to see it in mainline soon :) |
Merged as 358dcce |
@anthonyfok Is there a way to pass attributes to asciidoctor when Hugo calls for it to render content? |
Hi @bwklein, No, not yet. There are some command-line options that are passed to asciidoctor when Hugo calls it, but it is not user-configurable, at least not yet. If you would like this to be implemented, please open a new issue and perhaps give some example use cases, especially what command-line options you would like to be user-configurable. Thanks! Anthony |
@anthonyfok Thank you for the reply. This is a good example of how Middleman does it. |
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Push Request: Experimental AsciiDoc support with external helpers
(Replaces my previously borked PR #823)
Modeled after existing support for reStructuredText files
Handles content files with extensions
.asciidoc
and.ad
Pipes content through
asciidoctor --safe -
.If
asciidoctor
is not installed, thenasciidoc --safe -
.To make sure
asciidoctor
orasciidoc
is found, after addinga piece of AsciiDoc content, run
hugo
with the-v
flagand look for this message:
Caveats:
The final "Last updated" timestamp is currently not stripped.
When
hugo
is run with-v
, you may see a lot of these messagesif you have lots of
*.ad
or*.asciidoc
files.Some versions of
asciidoc
may have trouble with its safe mode.To test if you are affected, try this:
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. :-)
More discussions at Issue #470 and at PR #823.