[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: Re: [docbook-apps] How to indicate code snippets in Docbook?
--- Bob Foster <bob@objfac.com> wrote:
> Sorry for this newbie question. I'm trying to learn
> this stuff as I
> write. I'm a bit stumped on how to specify inline
> code snippets and
> set-apart (separate "paragraph") code examples.
>
> In HTML, I would use <code>a[i]</code> and
>
> <pre>
> public void foo() {
> }
> </pre>
>
> for these roles. What's the nearest Docbook
> equivalent?
For inline, as with your first example, you may use:
... <parameter class="function">a</parameter><option
class="option">[i]</option> ...
To set-apart code use programlisting
<programlisting>
public void foo() {
}
</programlisting>
You may also wrap the code snippet in CDATA within the
programlisting.
Sean Wheller
__________________________________
Do you Yahoo!?
Protect your identity with Yahoo! Mail AddressGuard
http://antispam.yahoo.com/whatsnewfree
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]