xml – DocBook:指定代码或标记

您可以使用< equation>指定方程式.以及其他几个,但必须使用什么标记来指定代码?更具体地说,PHP,HTML,CSS和 Javascript?是否有可以与OxygenXML一起使用的插件自动添加这些功能?我需要以PDF格式输出.
我正在开发一个使用docbook的项目,并在PHP中有示例.

PHP中的示例使用programlisting标记,如下所示:

<programlisting language="php"><![CDATA[<?php

// Here goes the PHP code

]]></programlisting>

请注意语言属性.
稍后由另一个工具使用它来添加语法着色,在生成输出时(对于HTML输出,至少)

对于不是特定于一种编程语言的示例,例如配置文件,我们使用screen标记;例如,对于Apache相关配置文件的一部分,一个例子是:

<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.

而且:

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.

Having less specific semantic
overtones,screen is often used
wherever a verbatim presentation is
desired,but the semantic of
programlisting is inappropriate.

所以,这两个看起来很合适.

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐


php输出xml格式字符串
J2ME Mobile 3D入门教程系列文章之一
XML轻松学习手册
XML入门的常见问题(一)
XML入门的常见问题(三)
XML轻松学习手册(2)XML概念
xml文件介绍及使用
xml编程(一)-xml语法
XML文件结构和基本语法
第2章 包装类
XML入门的常见问题(二)
Java对象的强、软、弱和虚引用
JS解析XML文件和XML字符串详解
java中枚举的详细使用介绍
了解Xml格式
XML入门的常见问题(四)
深入SQLite多线程的使用总结详解
PlayFramework完整实现一个APP(一)
XML和YAML的使用方法
XML轻松学习总节篇