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: [docbook] How to mark up inline program listings?


Tobias Reif <tobiasreif@pinkjuice.com> writes:

[...]

> So how do I markup inline code in DocBook?
> 
> It's no problem for me if the name does not include "programlisting". It 
> could be named "code", "inlinecode", "inlineprogram", or etc.

Myself, I would use Literal. If that doesn't meet your need, file an
RFE. But I'd suggest proposing Code and not Inlineprogram.

> XHTML offers the element named "code"
> 
> <p>To print out "hello world",
> save the program <code>print "Hello world :)?n"</code>, and
> feed it to Ruby.</p>
> 
> ... which fulfills my requirements. I need to do the same in DocBook.

  <para>To print out <computeroutput >hello world</computeroutput>,
    save the following program and feed it to Ruby.
    <programlisting >print "Hello world :)\n"</programlisting>
  </para>

Yeah, I know it's not the same (because it'll render the program listing
as a block and not inline), but it does have the advantage that you
wouldn't need to change your markup if you ended up deciding to use as
an example the somewhat less rare case of a program listing that
actually spans two or more lines.

  --Mike

Attachment: pgp00000.pgp
Description: PGP signature


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