On Mon, Sep 27, 2010 at 6:18 PM, Stuart Rackham <[email protected]> wrote:

>
> On 27/09/10 05:58, Marcus D. Hanwell wrote:
>
>> Hi,
>>
>> I am quite new to asciidoc, but would like to know if there is an
>> existing macro to link to Doxygen pages? If not, I am not certain how
>> best to accomplish that with a macro. What I essentially need is a
>> macro where I can name a class, and have asciidoc add text to the
>> start and end of the name and make it into a hyperlink.
>>
>> For example, QApplication would become
>> http://docs.site.com/QApplication.html.
>> The parts before and after the name are constant, but from what I read
>> macros are not recursive, and so that would not be made into a
>> hyperlink by that macro. This seems like it should be quite easy to
>> accomplish, but after reading through the docs and searching I have
>> not figured it out.
>>
>
> Here's how (I cloned and modified the http inline macro. Put this in a conf
> file:
>
> [macros]
> (?su)(?<!\w)[\\]?(?P<name>doxygen):(?P<target>\S*?)\[(?P<attrlist>.*?)\]=
>
> [doxygen-inlinemacro]
> <a href="http://docs.site.com/{target} <http://docs.site.com/%7Btarget%7D>
> ">{target}</a>
>
> Now you can use this:
>
> A doxygen:QApplication[] example.
>
> To generate this:
>
> A <a href="http://docs.site.com/QApplication";>QApplication</a> example.
>
> Thanks Stuart - I was nearly there with you. That works for most cases
really well, apart from when we use namespaces. Hopefully final question on
this subject, but if there a way to use the first {target} and replace ::
with _1_1, but keep the second {target} intact?

I have played around with trying to make that work, but can't see how to
accomplish it in an inline macro. I could then extend this to docbook for
other target types I guess too.

Thanks,

Marcus

-- 
You received this message because you are subscribed to the Google Groups 
"asciidoc" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/asciidoc?hl=en.

Reply via email to