Patch for DocBook @role in templates

12 views
Skip to first unread message

Noah Slater

unread,
May 18, 2009, 10:29:23 AM5/18/09
to asci...@googlegroups.com
Hey,

The @role attribute in DocBook can be useful as:

* A hook for XSLT to transform elements in a certain way.

* A hook for CSS to visually style elements in a certain way.

I regularly find myself needing to set the @role attribute in DocBook so that I
can process various types of content in my documents. For example, setting
@role="dialogue" on a <variablelist> element in my current project results in
clearer visual styling in the HTML.

I have a prepared a patch for the current docbook.conf file that lets you set
@role from AsciiDoc using a regular attribute. This patch adds a @role attribute
to every template that also used an @id attribute. I am hoping you will accept
this into the next version of AsciiDoc.

Thanks,

--
Noah Slater, http://tumbolia.org/nslater

docbook.conf.diff

Stuart Rackham

unread,
May 18, 2009, 10:08:53 PM5/18/09
to asci...@googlegroups.com
Hi Noah

Thanks for the patch, I tried to apply it but for reasons I can't fathom
it gets rejected:

$ patch --verbose <docbook.conf.diff
Hmm... Looks like a unified diff to me...
The text leading up to this was:
--------------------------
|--- docbook.conf.orig 2009-05-18 14:52:51.000000000 +0100
|+++ docbook.conf 2009-05-18 14:54:47.000000000 +0100
--------------------------
Patching file docbook.conf using Plan A...
Hunk #1 FAILED at 56.
Hunk #2 FAILED at 72.
Hunk #3 FAILED at 129.
Hunk #4 FAILED at 150.
Hunk #5 FAILED at 158.
Hunk #6 FAILED at 249.
Hunk #7 FAILED at 268.
Hunk #8 FAILED at 309.
Hunk #9 FAILED at 324.
Hunk #10 FAILED at 364.
Hunk #11 FAILED at 397.
Hunk #12 FAILED at 422.
Hunk #13 FAILED at 504.
Hunk #14 FAILED at 573.
Hunk #15 FAILED at 615.
15 out of 15 hunks FAILED -- saving rejects to file docbook.conf.rej
done

I've tried patch -l and -F options but it doesn't help and I've tried to
eyeball the problem but it all looks fine. Any idea what the problem is?

Cheers, Stuart

Noah Slater

unread,
May 18, 2009, 10:30:31 PM5/18/09
to asci...@googlegroups.com
On Tue, May 19, 2009 at 02:08:53PM +1200, Stuart Rackham wrote:
> Thanks for the patch, I tried to apply it but for reasons I can't fathom
> it gets rejected:

Weird, I don't know why it fails.

It's pretty easy to duplicate if you have a good editor.

Open the file an replace every instance of this:

{id? id="{id}"}

With this:

{id? id="{id}"}{role? role="{role}"}

That should do it!

Best,

Stuart Rackham

unread,
May 19, 2009, 1:27:28 AM5/19/09
to asci...@googlegroups.com
Hi Noah

I've applied the patch to the trunk:
http://hg.sharesource.org/asciidoc/rev/0c313ff4e728

Thanks, Stuart

Noah Slater

unread,
May 19, 2009, 8:16:32 AM5/19/09
to asci...@googlegroups.com
On Tue, May 19, 2009 at 05:27:28PM +1200, Stuart Rackham wrote:
> I've applied the patch to the trunk:
> http://hg.sharesource.org/asciidoc/rev/0c313ff4e728

Thanks!

Reply all
Reply to author
Forward
0 new messages