DocBook宏? [英] DocBook macros?

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

问题描述

在DocBook文档中是否可以定义宏(如乳胶定义的tex宏)?

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;

在文件"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天全站免登陆