DocBook 宏? [英] DocBook macros?

查看:13
本文介绍了DocBook 宏?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有什么方法可以在 DocBook 文档中定义宏(比如 tex 宏 o latex 定义)?

Is there any way of defining macros (like tex macros o latex defines) in DocBook documents?

DocBook 非常冗长,宏会很有帮助.我没有找到他们在快速入门教程中.

DocBook is very verbose, and macros would help a lot. I didn't find them in quickstart tutorials.

如果是这样,谁能提供一个简单的例子或链接?

If so, could anyone provide a simple example or a link to?

谢谢

推荐答案

不确定,这是否正是您想要的/是否完全满足您的要求,但我正在考虑实体.您可以在顶部定义它们(在您的 XML 文档中,一般是 XML,没有特定于 DocBook).如这里看到的doc.release.number"和doc.release.date".但它们也可以通过单独的文件包含在内.如第 3 个 ENTITY 行所示.这里 SYSTEM 的意思是,来自另一个文件 'entities.ent'.

Not sure, if this is exactly what you want / if it full fills your requirements, but I'm thinking of ENTITYs. You can define them at the top (of your XML document, so general XML, nothing DocBook specific). As seen here for the 'doc.release.number' and 'doc.release.date'. But they can also be included through an separate file. As seen in the 3th ENTITY row. Here the SYSTEM means, comming from another file 'entities.ent'.

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
    "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [

  <!ENTITY  doc.release.number                 "1.0.0.beta-1"       >
  <!ENTITY  doc.release.date                   "April 2010"         >

  <!ENTITY  %   entities  SYSTEM  "entities.ent" >

  %entities;

]>

<!--  This document is based on http://readyset.tigris.org/nonav/templates/userguide.html  -->
<article  lang="en">
  <articleinfo>
    <title>&project.impl.title; - User Manual</title>
    <subtitle></subtitle>
    <date>&project.impl.release.date;</date>
    <copyright>
      <year>doc.release.year</year>
      <holder>Team - &project.impl.title;</holder>
    </copyright>
    <releaseinfo>&doc.release.number;</releaseinfo>
  </articleinfo>

  <section>
    <title>Introduction</title>
    <para>
    The &project.impl.title; has been created to clean up (X)HTML and XML documents as part of 


    </para>
  <section>
</article>

在文档中,您通过开始 & 和结束 ; 引用实体,如 &project.impl.title;

In the document you reference the entities through a starting & and ending ; as in &project.impl.title;

在文件 'entities.ent' 中,您以类似的方式指定 ENTITY 元素:

In the file 'entities.ent' you specify the ENTITY elements in a similar way:

<?xml version="1.0" encoding="UTF-8"?>

<!ENTITY  project.impl.title            'Maven Tidy Plug-in'    >
<!ENTITY  project.impl.group-id         'net.sourceforge.docbook-utils.maven-plugin'    >
<!ENTITY  project.impl.artifact-id      'maven-tidy-plugin'     >
<!ENTITY  project.impl.release.number   '1.0.0.beta-1'          >
<!ENTITY  project.impl.release.date     'April 2010'            >
<!ENTITY  project.impl.release.year     '2010'                  >
<!ENTITY  project.impl.url              '../'                   >
<!ENTITY  project.spec.title            ''  >
<!ENTITY  project.spec.release.number   ''  >
<!ENTITY  project.spec.release.date     ''  >
<!ENTITY  doc.release.year              '2010'                  >  

这篇关于DocBook 宏?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆