This is the mail archive of the docbook@lists.oasis-open.org mailing list for the DocBook project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Looking for a tag analogous to HTML's <code>


----- 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>-&gt;<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/--/&mdash;/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.




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]