This is the mail archive of the
docbook@lists.oasis-open.org
mailing list for the DocBook project.
Re: Looking for a tag analogous to HTML's <code>
- From: Brian Lalonde <brianiacus at yahoo dot com>
- To: Norman Walsh <ndw at nwalsh dot com>
- Cc: docbook at lists dot oasis-open dot org
- Date: Tue, 29 Jan 2002 11:53:12 -0800
- Subject: DOCBOOK: Re: Looking for a tag analogous to HTML's <code>
- References: <000c01c1a8eb$3ce6e3b0$4003a8c0@stcu.org><87lmehc9eq.fsf@nwalsh.com>
----- Original Message -----
From: "Norman Walsh" <ndw@nwalsh.com>
> The grab-bag for this is probably <literal>. What sort of statements do
you
> want to put inline?
Various expressions, such as properties qualified by object, method calls,
etc.
Examples (implemented using <literal role="code">):
<para>To free up resources, use
<literal role="code"><variable>Session</variable
>.<methodname>Abandon</methodname>()</literal> when ... </para>
<para>To suggest a filename, use <literal role="code"
><variable>$Response</variable>-><methodname>AddHeader</methodname
>(<literal>'Content-Disposition'</literal>,
<literal>'attachment; filename=export.csv'</literal>);</literal>
... </para>
<para>Simple conversion can be acheived via
<literal role="code">while(<>) { s/--/—/go }</literal>
... </para>
Basically, one-liners and member references that require connecting syntax,
like ".", ":", "::", or "->" (which, in practical terms, I would also like
to be rendered in a monospace font when styled).
These are really too small enough to be rendered as blocks (which would also
break up the flow unnecessarily), which rules out <programlisting>.
It looks like the above examples will validate for now, but I would still
like to occasionally include the markup for the different components,
so I am a little worried by the "Future Changes" in the docs that
suggest severe constraints to the <literal> tag in later versions.
> | I am tempted to use xreflabel; would this be abusive?
> Definitely. Abusing role is probably a better bet.
Hmm... OK.