Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
11 posts
|
I wanted to set a chrome link inside an Asciidoctor file like:
chrome://extensions/[Extensions] but the schema is not recognized and therefore no link is created. Is there a workaround for that? Kind regards, CL |
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
2681 posts
|
Christian, Although Asciidoctor only recognizes the uri schemes http:, https:, mailto:, ftp: and irc: out of the box, you can convince it that any text is a link using the explicit 'link:' prefix. For example: [source,asciidoc] -- link:chrome://extensions/[Extensions] -- which produces: [source,html] -- <a href="chrome://extensions/">Extensions</a> -- This would be a great point to emphasize in the user manual. Thanks for raising it! Another approach to solving this problem is to register a custom inline macro for the 'chrome:' scheme. Here's an example: [source,ruby] -- class ChromeUriMacro < Asciidoctor::Extensions::InlineMacroProcessor option :pos_attrs, ['text'] def process parent, target, attributes target = %(chrome:#{target}) text = attributes['text'] || target Asciidoctor::Inline.new(parent, :anchor, text, :type => :link, :target => target).render end end Asciidoctor::Extensions.register do |document| inline_macro :chrome, ChromeUriMacro end -- Now the following source: [source,asciidoc] -- chrome://extensions/[Extensions] -- becomes [source,html] -- <a href="chrome://extensions/">Extensions</a> -- Hopefully one of those options works for you! Cheers, On Mon, Oct 21, 2013 at 8:17 AM, ChrLipp [via Asciidoctor :: Discussion] <[hidden email]> wrote: I wanted to set a chrome link inside an Asciidoctor file like: -- 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 |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Administrator
2681 posts
|
In reply to this post by ChrLipp
-Dan On Sun, Oct 27, 2013 at 12:35 AM, Dan Allen <[hidden email]> wrote:
... [show rest of quote] -- Dan Allen | http://google.com/profiles/dan.j.allen |
Free forum by Nabble | Edit this page |