Loading... |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
I use the Asciidoctor Java integration and it works great, thanks for your work!
My beginner question: I want to render an admonition paragraph (like `TIP:`, `IMPORTANT:`) with an icon on the left side. I have added `:icon:` to the head of my document, but no image link is generated in the HTML when I generate it from Java. The admonition paragraph gets rendered as `...<.div class="title">Tip</div> ...`. When I call the `asciidoctor` command from the command line, the same paragraph gets rendered like `...<.td class="icon"><.img src="/images/icons/tip.png" alt="Tip"/><./td>...`. (with removed "." after "<") How can I change the default rendering of AsciiDoc-for-Java to get these icon-links? |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Alex could probably say for sure, but this is something that is either fixed in 0.1.2.1 or will be in 0.1.3 On Tue, May 21, 2013 at 9:14 AM, Hocdoc [via Asciidoctor :: Discussion] <[hidden email]> wrote: I use the Asciidoctor Java integration and it works great, thanks for your work! ... [show rest of quote] |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Administrator
|
In reply to this post by Hocdoc
Hocdoc, There are few things to explain here. First, the default safe mode when invoking Asciidoctor via the API is SafeMode.SECURE. In secure safe mode, icons cannot be enabled by the document (a security feature). Thus, one way to get this to work is to lower the safe mode level when calling the Asciidoctor API:
String result = asciidoctor.render(source, OptionsBuilder.options().safe(SafeMode.SAFE).asMap()); Another approach is to enable icons for all documents. You can do this by passing the icons attribute to the Asciidoctor API: String result = asciidoctor.render(source, OptionsBuilder.options().headerFooter(true).attributes(AttributesBuilder.attributes().attribute("icons", "").asMap()).asMap()));
In Asciidoctor 0.1.3, we are working on adding font-based admonition icons so that you don't have to worry about the path to the icons :) They will be enabled by setting:
:icons: font
Here's the issue to track that new feature: https://github.com/asciidoctor/asciidoctor/issues/115
-Dan On Tue, May 21, 2013 at 9:14 AM, Hocdoc [via Asciidoctor :: Discussion] <[hidden email]> wrote: I use the Asciidoctor Java integration and it works great, thanks for your work! ... [show rest of quote] Dan Allen | http://google.com/profiles/dan.j.allen |
Loading... |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Thanks, I tried the second approach to enable icons for all documents and it works like a charm.
|
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Administrator
|
Excellent! -Dan On Wed, May 22, 2013 at 1:24 AM, Hocdoc [via Asciidoctor :: Discussion] <[hidden email]> wrote: Thanks, I tried the second approach to enable icons for all documents and it works like a charm. Dan Allen | http://google.com/profiles/dan.j.allen
|
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Thanks Dan for the explanation.
|
Free forum by Nabble | Edit this page |