#204 command in cmdsynopsis is not indented

XSL (399)
Sam Steingold

in manpages,

is presented as
foo -a -b
____-c -d
____-e -f

i.e., the options are indented from the left margin
by the width of the command name.

in HTML no such indentation is done:

foo -a -b
-c -d -e -f

this does not look good.


  • Sam Steingold
    Sam Steingold

    Logged In: YES

    fixing this might be as easy as adding

    style="text-intent: X+1 em;"

    attribute to the <p> element
    to which cmdsynopsis is transfroemed.
    X should be the number of letters
    in the <command> element contents.

    • labels: 321159 --> XSL
  • Logged In: YES

    as a workaround, is it possible to set style for this
    with an external CSS stylesheet? does the <p>
    element the cmdsysnopsis is in have a
    class=cmdsynosis attribute?

    • priority: 5 --> 3
  • Sam Steingold
    Sam Steingold

    Logged In: YES

    the <p> element is wrapped in a <div>:
    <div class="cmdsynopsis"><p>....
    besides, it is not clear how to compute the indentation (offset)
    in the CSS stylesheet (i.e., X+1).

    • status: open --> pending
  • Logged In: YES


    I have checked in a change for this. Please try if you
    can to test it with the latest snapshot and let me know
    what you think -


    I implemented it with some inline CSS as you had
    suggested, though actually it took a bit more work --
    basically using the CSS float property to have the
    comand treated as on block on the page, then the rest of
    the command synopsis treated as a block, and then just
    aligning those as if they were two cells in a table row.

    Anyway, please give it a try and let me know if it
    works for you as you'd expect.

  • Sam Steingold
    Sam Steingold

    • status: pending --> open
  • Sam Steingold
    Sam Steingold

    Logged In: YES

    Nay, this is worse.
    what I see is

    _[[-h] | [--help]]

    i.e., the first line contains the single word
    - the command name
    while all the further lines are indented by 1 character.

    Here is what I find nice:

    <p style="text-indent: -1em; margin-left: 1em;">
    the necessary number of EMs is unclear to me,
    it would be nice if it guaranteed the offset equal
    to the length of the command name, but I see
    no resemblance even with the monospace font-family.
    a good first step would be 1em or 2em.

    Thanks for your efforts!

    PS. I do _not_ like the idea of making the whole paragraph
    monospace because it contains verious objects
    which should be correctly formatted.

    • assigned_to: nobody --> xmldoc
  • Sam Steingold
    Sam Steingold

    Logged In: YES

    Michael, thanks for your help!!
    cmdsynopsis.001.html looks perfect.
    do I understand correctly that synop.xsl should go into xhtml/
    in the snapshot?

  • Logged In: YES

    Hi Sam,

    Yep, should go into the xhtml/ directory, and for
    testing you should make sure you're using the
    xhtml/docbook.xsl or xhtml/chunk.xsl xhtml/onechunk.xsl
    driver instead of the html ones.

    Or, as far as testing goes, you could just put it into
    the html/ directory (if you are already using a
    customization layer that calls one of the html drivers.

  • Sam Steingold
    Sam Steingold

    Logged In: YES

    Hi Michael,
    it did not help.
    I have
    $Id: synop.xsl,v 1.14 2004/10/25 22:05:18 xmldoc Exp $
    from the latest snapshot, which is identical to the file you
    link to.
    the generated html file (attached together with the CSS)
    looks the same as described on 2004-10-26 15:20

  • Sam Steingold
    Sam Steingold

    generated HTML file

  • Logged In: YES


    I have reproduced this. I just retested with Mozilla
    and am seeing same as you've described.

    I think it's a bug in Mozilla's CSS handling, but oh
    well... it seems like the only options at this point are:

    - (ab)use a table for alignment, which I rather not do.

    - use a CSS "hanging indent" ("margin-left: Nem;
    text-indent: -Nem;", where we calculate N based on
    the length of the command name).

    The CSS hanging indent doesn't provide precise
    alignment the way that we could get from using a table
    or CSS floats (if they worked as expected in Mozilla),
    but maybe it'll be close enough.

  • Sam Steingold
    Sam Steingold

    Logged In: YES

    it this is a Mozilla bug, it should definitely be reported
    as such!
    did you do that already?
    if not, please do report is ASAP!
    If the bug is accepted - and it should be! -
    I don't think you should invest any more effort into it;
    we will just wait for Mozilla people to fix it.
    If they claim that their rendering is valid,
    I think the second ("hanging indent") alternative is better.


    PS I just checked that IE renders the page correctly.

  • Logged In: YES


    It seems to me that it is clearly a Mozilla/Gecko bug.
    I would be surprised if someone hasn't reported it
    already, and would want to take time to look through
    their open bugs and check before filing a new one. I
    don't have time to do that right now...

    Anyway, I don't expect that they'll be fixing it any
    time soon, so we'll need to figure out how to work
    around it. We're planning to do a new XSL stylesheets
    release this week, so for now, I'm just going to plan
    to revert the change I made and plan to implement
    something for the next release.

    I'm flip-flopping on what would be the best way to
    implement it. I'm now thinking that it'd be better to
    do it using HTML table markup; we have a precedent for
    that in that Funcsynopsis is already (optionally)
    rendered in HTML output using table markup for alignment.

    But if you feel strongly that the CSS hanging-indent
    should be available, I guess I can make it a three-way
    option named something like cmdsynopsis.ident with the
    existing no-indent behavior being the default and with
    "tabular" and "css" being the other possible values.

    But right now I'd really rather just implement it using
    table markup.

  • Sam Steingold
    Sam Steingold

    Logged In: YES

    1. mozilla bug: don't bother about searching,
    they can do it for you. just file a new bug.

    2. what to do: entirely up to you.
    if you will be adding an option,
    I'd recommend 4 values:
    - no indent
    - table
    - hanging-indent
    - the current patch you want to revert

    • priority: 3 --> 7