-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Labels
Milestone
Description
I would like to add a custom extension to the Ant task using inline Ruby like this
<asciidoctor ...>
<inlineMacroProcessor>
<![CDATA[
use_dsl
named :man
name_positional_attributes 'volnum'
def process parent, target, attrs
text = manname = target
suffix = ''
target = %(#{manname}.html)
suffix = if (volnum = attrs['volnum'])
"(#{volnum})"
else
nil
end
if parent.document.basebackend? 'html'
parent.document.register :links, target
%(#{(create_anchor parent, text, type: :link, target: target).render}#{suffix})
elsif parent.document.backend == 'manpage'
%(\\fB#{manname}\\fP#{suffix})
else
%(#{manname}#{suffix})
end
end
]]>
</inlineMacroProcessor>
</asciidoctor>
(the code would be wrapped as a class extending Extensions::InlineMacroProcessor and registered as an extension).
The idea is to avoid compiling an extension Java class and adding it to the classpath.
Would it be possible?
Reactions are currently unavailable