PHP中的示例使用programlisting
标记,如下所示:@H_404_6@
<programlisting language="PHP"><![CDATA[<?PHP // Here goes the PHP code ]]></programlisting>
请注意语言属性.
稍后由另一个工具使用它来添加语法着色,在生成输出时(对于HTML输出,至少)@H_404_6@
对于不是特定于一种编程语言的示例,例如配置文件,我们使用screen
标记;例如,对于Apache相关配置文件的一部分,一个例子是:@H_404_6@
<screen><![CDATA[# Setup Listening Port NameVirtualHost *:80 # Ensure "localhost" is preserved unchanged pointed # to the default document root for our system. <VirtualHost *:80> ServerName localhost DocumentRoot /var/www </VirtualHost>]]></screen>
A programlisting is a verbatim
environment for program source or
source fragment listings. The
programlistings are often placed in
examples or figures so that they can
be cross-referenced from the text.@H_404_6@
而且:@H_404_6@
A screen is a verbatim environment for
displaying text that the user might
see on a computer terminal. It is
often used to display the results of a
command.@H_404_6@Having less specific semantic
overtones,screen is often used
wherever a verbatim presentation is
desired,but the semantic of
programlisting is inappropriate.@H_404_6@
所以,这两个看起来很合适.@H_404_6@