docbook-apps

RE: [docbook] How do I tell keycap+ from keycap keypad+

  • 1.  RE: [docbook] How do I tell keycap+ from keycap keypad+

    Posted 01-15-2011 03:41
    [Moving this to the more appropriate docbook-apps mailing list. The DocBook list is for discussion of the standard itself.]



    There must be a dozen ways to do what you want. Here is one that works for HTML output generated with the DocBook XSL stylesheets, and using a CSS file. This does not work for PDF output, which lacks CSS styling.



    1. When you mean any plus key, tag it as usual: <keycap>+</keycap>

    2. When you mean the plus key on the numeric keypad, wrap the <keypad> in an <emphasis> element with the role attribute set to an arbitrary string (but not "keycap"). Here, I use "numpad":

    <emphasis role="numpad">

    <keycap>+</keycap>

    </emphasis>

    3. Set the stylesheet parameter emphasis.propagates.style=1 as described in this page<http://www.sagehill.net/docbookxsl/UsingCSS.html#RoleAsClass> of the Stayton book.

    4. In your CSS file, provide a style for span.numpad. For example:

    span.numpad {

    background-color: #bfbfbf;

    }



    An example of the results is here: http://s299684157.onlinehome.us/



    Perhaps someone else can suggest a more general solution that works for other output formats.



    -----Original Message-----
    From: Krzysztof Zelechowski [mailto:giecrilj@stegny.2a.pl]
    Sent: Friday, January 14, 2011 7:30 PM
    To: Barton Wright
    Cc: docbook@lists.oasis-open.org
    Subject: Re: [docbook] How do I tell keycap+ from keycap keypad+



    Dnia piatek, 14 stycznia 2011 o 19:42:47 Barton Wright napisal(a):

    > Hello Krzysztof,

    >

    > Your question is really a matter of style, which is up to you, or up to the company for which you are writing.



    Not necessarily. A technical question: How do I markup <keycap >+</keycap > so that it can be rendered on a gray background when keypad is required, but not when any '+' wins?



    Chris