docbook: Thread: Alternative to tag in Docbook


[<<] [<] Page 1 of 1 [>] [>>]
Subject: Alternative to tag in Docbook
From: odc ####@####.####
Date: 5 Aug 2002 01:14:59 -0000
Message-Id: <3D4DD23E.FEEE05B1@myrealbox.com>

Is there any alternative for Para that doesn't have a newline /
carriagereturn ?

I'm trying to use it in a listitem, but I don't want the listitems to be
spaced apart.

Subject: Re: Alternative to tag in Docbook
From: "John R. Daily" ####@####.####
Date: 5 Aug 2002 02:37:47 -0000
Message-Id: <200208050237.g752bj607275@clmboh1-smtp3.columbus.rr.com>

At (time_t)1028510270 odc wrote:

> Is there any alternative for Para that doesn't have a newline /
> carriagereturn ?
> 
> I'm trying to use it in a listitem, but I don't want the listitems to be
> spaced apart.

Your complaint isn't with the <para> tag per se, but rather with
the stylesheets and the fact that web browsers treat <li><p> as
two blocks instead of one.

I ran a simple test using Norm Walsh's XSL stylesheets, and the
relevant HTML came out thusly:

<html><body>
<div class="itemizedlist">
  <ul type="disc">
  <li><p>Foo</p></li>
  <li><p>Foo2</p></li>
  </ul>
</div></body></html>

By removing the <p> tags, you can achieve a closer nesting in
Mozilla, at least.

So, there would seem to be at least a few options:

1) Customize the XSL/DSSSL stylesheets to not insert the <p>.
   I think something along the lines of this would work for XSL:

<xsl:template match="listitem/para">
  <xsl:apply-templates/>
</xsl:template>

2) Break validation, and remove the <para> tags.  Undesirable but
   straightforward.

3) Use CSS to define a <p> nested in a <li> as an inline instead
   of block:

<head>
<style type="text/css">
  li p {
    display: inline;
  }
</style>
</head>

If you already have a CSS stylesheet, the last option would
clearly be the simplest, and in general feels like the best
solution to me.

(On-topic plug: I knew little about CSS until this weekend, but
picked up "Cascading Style Sheets: Designing for the Web" by Lie
& Bos yesterday, and read straight through it.  Excellent,
excellent book.)

--
John R. Daily
<email><mailbox>john</mailbox><domain>geekhavoc.com</domain></email>
Subject: Re: Alternative to tag in Docbook
From: "John R. Daily" ####@####.####
Date: 5 Aug 2002 03:30:48 -0000
Message-Id: <200208050330.g753Ul603141@clmboh1-smtp3.columbus.rr.com>

Belatedly, I note that there is an attribute for itemizedlists
that is supposed to minimize the vertical space:

<itemizedlist spacing="compact">

The stylesheets then produce a <ul compact="compact"> (XHTML),
but my testing with Mozilla was unsuccessful.  <ul compact> (the
HTML 4 version) didn't work either.

-John
Subject: Re: Alternative to tag in Docbook
From: Hal Burgiss ####@####.####
Date: 5 Aug 2002 04:08:10 -0000
Message-Id: <20020805000809.F3765@feenix.burgiss.net>

On Sun, Aug 04, 2002 at 09:40:37PM -0500, John R. Daily wrote:
> 
> If you already have a CSS stylesheet, the last option would
> clearly be the simplest, and in general feels like the best
> solution to me.

One more option might be simplelist which does not have the extra line
breaks like itemizedlist (at least with the stylesheets that seem to
be commonly distributed). But you loose some of the nice list type
formatting of itemizedlist. If the line lengths are short, you can
sort of simulate it like:

<simplelist>
 <member>
  &nbsp;&nbsp;&squf;&nbsp;&nbsp;Item 1
 </member>
 <member>
  &nbsp;&nbsp;&squf;&nbsp;&nbsp;Item 2
 </member>
 <member>
  &nbsp;&nbsp;&squf;&nbsp;&nbsp;Item 3
 </member>
</simplelist>

Another issue is whether you control the build and/or presentation
environments. If you distribute the source (even with customized
stylesheets), there probably isn't any way to guarantee how they'll
look. And arguably shouldn't be a major concern anyway.

But I agree that css is a nice way to spice things up. As an example
of subtle, but nice differences done with css:

http://www.privoxy.org/user-manual/appendix.html

Scroll down to the Anatomy section and see how the <guibutton> tags
turn out :) (Not my idea btw, but it is a nice touch IMO.)

-- 
Hal Burgiss
 
Subject: Re: Alternative to tag in Docbook
From: odc ####@####.####
Date: 5 Aug 2002 20:34:45 -0000
Message-Id: <3D4EE214.F8652536@myrealbox.com>

"John R. Daily" wrote:

> At (time_t)1028510270 odc wrote:
>
> > Is there any alternative for Para that doesn't have a newline /
> > carriagereturn ?
> >
> > I'm trying to use it in a listitem, but I don't want the listitems to be
> > spaced apart.
>
> Your complaint isn't with the <para> tag per se, but rather with
> the stylesheets and the fact that web browsers treat <li><p> as
> two blocks instead of one.
>
> I ran a simple test using Norm Walsh's XSL stylesheets, and the
> relevant HTML came out thusly:
>
> <html><body>
> <div class="itemizedlist">
>   <ul type="disc">
>   <li><p>Foo</p></li>
>   <li><p>Foo2</p></li>
>   </ul>
> </div></body></html>
>
> By removing the <p> tags, you can achieve a closer nesting in
> Mozilla, at least.
>
> So, there would seem to be at least a few options:
>
> 1) Customize the XSL/DSSSL stylesheets to not insert the <p>.
>    I think something along the lines of this would work for XSL:
>
> <xsl:template match="listitem/para">
>   <xsl:apply-templates/>
> </xsl:template>
>
> 2) Break validation, and remove the <para> tags.  Undesirable but
>    straightforward.
>
> 3) Use CSS to define a <p> nested in a <li> as an inline instead
>    of block:
>
> <head>
> <style type="text/css">
>   li p {
>     display: inline;
>   }
> </style>
> </head>
>
> If you already have a CSS stylesheet, the last option would
> clearly be the simplest, and in general feels like the best
> solution to me.
>
> (On-topic plug: I knew little about CSS until this weekend, but
> picked up "Cascading Style Sheets: Designing for the Web" by Lie
> & Bos yesterday, and read straight through it.  Excellent,
> excellent book.)
>
> --
> John R. Daily
> <email><mailbox>john</mailbox><domain>geekhavoc.com</domain></email>

Hmm, where would I put a style sheet declaration ? The document I'm working on

is an LDP-style guide.

Or is that something I have to do post-parsing ?


Subject: Re: Alternative to tag in Docbook
From: "John R. Daily" ####@####.####
Date: 6 Aug 2002 01:50:19 -0000
Message-Id: <200208060150.g761oA610812@clmboh1-smtp3.columbus.rr.com>

At (time_t)1028579860 odc wrote:

> Hmm, where would I put a style sheet declaration ? The document I'm working o
> n
> 
> is an LDP-style guide.
> 
> Or is that something I have to do post-parsing ?

Well, if you're using DocBook/XML and XSL, the customized
stylesheet below (with the proper path to your local LDP
stylesheet in the xsl:import statement) should work.

If you're using SGML, you'll have to use DSSSL, and my functional
programming skills aren't up to the task to help much with that,
other than to point to the DocBook Wiki:

  http://docbook.org/wiki/moin.cgi/DocBookDssslStylesheetDocs


<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                version='1.0'
                xmlns="http://www.w3.org/TR/xhtml1/transitional"
                exclude-result-prefixes="#default">

<xsl:import href="/usr/share/sgml/docbook/stylesheet/xsl/ldp/ldp-html.xsl"/>

<xsl:template match="listitem/para">
  <p style="display: inline">
    <xsl:apply-templates/>
  </p>
</xsl:template>

</xsl:stylesheet>

--
John R. Daily
<email><mailbox>john</mailbox><domain>geekhavoc.com</domain></email>

Subject: Re: Alternative to tag in Docbook
From: odc ####@####.####
Date: 9 Aug 2002 07:54:24 -0000
Message-Id: <3D536C49.35C642D3@myrealbox.com>

Hal Burgiss wrote:

> On Sun, Aug 04, 2002 at 09:40:37PM -0500, John R. Daily wrote:
> >
> > If you already have a CSS stylesheet, the last option would
> > clearly be the simplest, and in general feels like the best
> > solution to me.
>
> One more option might be simplelist which does not have the extra line
> breaks like itemizedlist (at least with the stylesheets that seem to
> be commonly distributed). But you loose some of the nice list type
> formatting of itemizedlist. If the line lengths are short, you can
> sort of simulate it like:
>
> <simplelist>
>  <member>
>   &nbsp;&nbsp;&squf;&nbsp;&nbsp;Item 1
>  </member>
>  <member>
>   &nbsp;&nbsp;&squf;&nbsp;&nbsp;Item 2
>  </member>
>  <member>
>   &nbsp;&nbsp;&squf;&nbsp;&nbsp;Item 3
>  </member>
> </simplelist>
>
> Another issue is whether you control the build and/or presentation
> environments. If you distribute the source (even with customized
> stylesheets), there probably isn't any way to guarantee how they'll
> look. And arguably shouldn't be a major concern anyway.
>
> But I agree that css is a nice way to spice things up. As an example
> of subtle, but nice differences done with css:
>
> http://www.privoxy.org/user-manual/appendix.html
>
> Scroll down to the Anatomy section and see how the <guibutton> tags
> turn out :) (Not my idea btw, but it is a nice touch IMO.)
>
> --
> Hal Burgiss
>
>
> ______________________
> http://lists.tldp.org/

Thank you for the help, but none of the options would work.  Except for
the CSS -- I think, I have to add that into the final version of my
document, as I do not know how to place it inline with the SGML.

If anybody knows how it would be appreciated.

I am, also a little dissapointed with the whole SGML Docbook concept.

Why cannot I use <br> ?

Why isn't <para> abbreviated to <p> for simplicities sake ?

Thank you for the help.


Subject: Re: Alternative to tag in Docbook
From: Peter Jay Salzman ####@####.####
Date: 9 Aug 2002 08:32:54 -0000
Message-Id: <20020809083247.GA19468@dirac.org>

begin odc ####@####.#### 
> 
> Thank you for the help, but none of the options would work.  Except for
> the CSS -- I think, I have to add that into the final version of my
> document, as I do not know how to place it inline with the SGML.
> 
> If anybody knows how it would be appreciated.
> 
> I am, also a little dissapointed with the whole SGML Docbook concept.
> 
> Why cannot I use <br> ?
 
in the words of our previous president, i feel your pain.  docbook is
painful to write in.  however, i've found that the pain does go away.

i enjoy maintaining my HOWTO and mini-HOWTO so much that i've stopped
minding docbook a long time ago.


one of the goals of docbook is logical markup.  that is,
<command>foo</command> and <filename>foo</filename> may end up looking
the same on paper, but the important thing is that foo is going to be
formatted according to what foo is, rather than the fact that "foo is an
important concept".

note that html and latex are markup languages too, but they're more
visual markup.  an <I>important</I> thing is formatted visually rather
than \textit{logically}.

<BR> is an example of visual formatting.  it serves no purpose in<BR>
this paragraph, other than to break a line.  but the whole point of<BR>
logical markup is that the author shouldn't have to worry about<BR>
visual markup like linebreaking.\hfill

> Why isn't <para> abbreviated to <p> for simplicities sake ?
 
who knows.  it would've been nice.  then again, whoever came up with
"umount" and "creat" clearly went too far in the wrong direction!

pete
Subject: Re: Alternative to tag in Docbook
From: Alexander Bartolich ####@####.####
Date: 9 Aug 2002 08:45:36 -0000
Message-Id: <13654.1028882707@www16.gmx.net>

odc wrote:
> [...] Why cannot I use <br> ?

<simplelist> can help sometimes.

-- 
GMX - Die Kommunikationsplattform im Internet.
http://www.gmx.net

Subject: Re: Alternative to tag in Docbook
From: Hal Burgiss ####@####.####
Date: 9 Aug 2002 12:49:56 -0000
Message-Id: <20020809084955.J3765@feenix.burgiss.net>

On Fri, Aug 09, 2002 at 12:16:25AM -0700, odc wrote:
> 
> Thank you for the help, but none of the options would work.  Except for
> the CSS -- I think, I have to add that into the final version of my
> document, as I do not know how to place it inline with the SGML.
> 
> If anybody knows how it would be appreciated.

In line? Are you using ldp.dsl for a stylesheet? Just put this in your
stylesheet if you want finished doc to be css aware:

(define %stylesheet%
  ;; REFENTRY stylesheet
  ;; PURP Name of the stylesheet to use
  ;; DESC
  ;; The name of the stylesheet to place in the HTML LINK TAG, or '#f' to
  ;; suppress the stylesheet LINK.
  ;; /DESC
  ;; AUTHOR N/A
  ;; /REFENTRY
  "my_doc.css")

(define %stylesheet-type%
  ;; REFENTRY stylesheet-type
  ;; PURP The type of the stylesheet to use
  ;; DESC
  ;; The type of the stylesheet to place in the HTML LINK TAG.
  ;; /DESC
  ;; AUTHOR N/A
  ;; /REFENTRY
  "text/css")

(define %css-liststyle-alist%
  ;; REFENTRY css-liststyle-alist
  ;; PURP Map DocBook OVERRIDE and MARK attributes to CSS
  ;; DESC
  ;; If '%css-decoration%' is turned on then the list-style-type property of
  ;; list items will be set to reflect the list item style selected in the
  ;; DocBook instance.  This associative list maps the style type names used
  ;; in your instance to the appropriate CSS names.  If no mapping exists,
  ;; the name from the instance will be used.
  ;; /DESC
  ;; AUTHOR N/A
  ;; /REFENTRY
  '(("bullet" "disc")
    ("box" "square")))

(define %css-decoration%
  ;; REFENTRY css-decoration
  ;; PURP Enable CSS decoration of elements
  ;; DESC
  ;; If '%css-decoration%' is turned on then HTML elements produced bythe
  ;; stylesheet may be decorated with STYLE attributes.  For example,the
  ;; LI tags produced for list items may include a fragment of CSS inthe
  ;; STYLE attribute which sets the CSS property "list-style-type".
  ;; /DESC
  ;; AUTHOR N/A
  ;; /REFENTRY
  #t)

 
> I am, also a little dissapointed with the whole SGML Docbook concept.
> 
> Why cannot I use <br> ?

Well, I think the whole idea behind docbook is *content* and not the
finished look. That is up to the stylesheets and presentation vehicle. 

> 
> Why isn't <para> abbreviated to <p> for simplicities sake ?

These are not simple people :)

-- 
Hal Burgiss
 
[<<] [<] Page 1 of 1 [>] [>>]


  ©The Linux Documentation Project, 2014. Listserver maintained by dr Serge Victor on ibiblio.org servers. See current spam statz.