Hi Stuart, 2011/1/24 Stuart Rackham <[email protected]>
>
> On 17/12/10 10:53, Arnaud Quette wrote:
>
>> Hi Stuart and the list,
>>
>> we're still finalizing AsciiDoc integration in NUT:
>> the dedicated branch has been merged into the trunk (over 1 Mb), few
>> things
>> remain and the 2.6.0 release is still scheduled for next week.
>>
>> now, part of these few remainders, I want to create some macros for cross
>> references between the various docs (user, developer, manpages) in the
>> various
>> formats (single and chunked html, pdf).
>>
>> afaik, a2x directly calls docbook, which render the below void:
>>
>>
>> 8<---------------------------------------------------------------------------------
>> ifdef::backend-xhtml11[]
>> [linkman-inlinemacro]
>> <a href="man/{target}.html">{target}{0?({0})}</a>
>> endif::backend-xhtml11[]
>>
>> ifdef::backend-chunked[]
>> [linkman-inlinemacro]
>> <a href="../man/{target}.html">{target}{0?({0})}</a>
>> endif::backend-chunked[]
>>
>> 8<---------------------------------------------------------------------------------
>>
>> so, how can I do this?
>>
>
> You also need to define the linkman macro syntax e.g. something like:
>
> [macros]
> (?su)(?<!\w)[\\]?(?P<name>linkman):(?P<target>\S*?)\[(?P<attrlist>.*?)\]=
>
> Then you can use e.g. linkman:man1[manual 1]
>
I've indeed focused this mail on the macro content itself, thus omitting
this part.
There was already a macro syntax declaration, ie:
[macros]
(?su)[\\]?(?P<name>linkman):(?P<target>\S*?)\[(?P<attrlist>.*?)\]=
But it differs a bit from yours (which one is the best?!)
the complete .conf is located here:
http://svn.debian.org/wsvn/nut/trunk/docs/asciidoc.conf
So this point seems fine.
Now I still have a lack: cross references using anchors doesn't work with
chunked (and PDF).
I've made some tries around executing a script (attached) to grep the right
file name (ie defining the searched anchor), but can't get it to be executed
in a macro. Executing the script manually works fine.
But I can't get it to work inside a macro...
I've resurrected this tentative:
<ulink url="../{target}.chunked/{2? sys::[./get-chunked-page.sh {target}
{2}]}.html">{0}</ulink>
I have to note that there are not much example of "sys::" usage in the doc,
so I may have done something wrong.
thanks for your help,
Arnaud
--
Linux / Unix Expert R&D - Eaton - http://powerquality.eaton.com
Network UPS Tools (NUT) Project Leader - http://www.networkupstools.org/
Debian Developer - http://www.debian.org
Free Software Developer - http://arnaud.quette.free.fr/
--
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.
get-chunked-page.sh
Description: Bourne shell script
