On 25/01/11 23:36, Arnaud Quette wrote:
Hi Stuart,
2011/1/24 Stuart Rackham <[email protected] <mailto:[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?!)
(?su)(?<!\w)[\\]?(?P<name>linkman):(?P<target>\S*?)\[(?P<attrlist>.*?)\]=
(?su)[\\]?(?P<name>linkman):(?P<target>\S*?)\[(?P<attrlist>.*?)\]=
The (?<!\w) term was added to disallow preceding word character e.g. it will not
match xlinkman:xxx[]
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).
There should be no problem here, it's all taken care of by DocBook XSL
Stylesheets.
Ah, I see now, there is no "chunked" backend in AsciiDoc (you're confusing it
with the a2x chunked output format. Instead of the ifdef::backend-chunked[]
markup you need to define conditional DocBook markup (not HTML) for the DocBook
link element in and ifdef::backend-docbook[].
See the xref-inlinemacro macros in docbook45.conf
(http://code.google.com/p/asciidoc/source/browse/docbook45.conf).
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.
The sys::[] macro is a block element, you need to use the sys:[] inline syntax.
Used the asciidoc -v option to view sys macro execution.
Cheers, Stuart
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.
--
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.