使用doxygen生成具有自定义结构的PDF [英] Generate PDF with custom structure using doxygen

查看:120
本文介绍了使用doxygen生成具有自定义结构的PDF的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试自定义doxygen生成的pdf文档结构.我已经在为html和chm输出执行此操作,但对于pdf则不起作用.
我的主要问题是,这是设计上的限制还是我遗漏了一些东西?
如果这是设计使然,我还有其他方法可以从doxygen开始,从而生成定制的pdf文档?

I'm trying to customize the pdf document structure generated by doxygen. I'm already doing this for html and chm output, but for pdf it does not work.
My primary question is, is this restriction by design or am i missing something?
If this is by design, is there any other way I could go starting from doxygen, resulting in a customized pdf document?

我们正在使用doxygen生成C API的源代码文档,该文档也使用C ++,C#和Java进行包装.
我们希望将所有这些语言记录在一个文档中,但要按语言进行结构化.为了实现此目的,我们通过以下方式使用DoxygenLayout.xml文件自定义了文档结构:

We are using doxygen to generate sourcecode documentation for a C API, which is also wrapped using C++, C# and Java.
We want to document all these languages in one single document, but structure it by language. In order to achieve this we customized the document structure using a DoxygenLayout.xml file in the following way:

  • 首先是几页描述性文字,适用于所有 语言,我们将此部分称为用户手册".
  • 第二个是API文档,该文档结构化为不同的语言.
  • First come a few pages of descriptive text, that applies to all languages, we call this part "user manual".
  • Second comes the API documentation, which is structured into the different languages.

换句话说,我们完全禁用了标准结构并定义了我们自己的结构. 布局定义看起来很像这个简化的示例:

In other words, we completely disable the standard structure and define our own. The layout definition looks pretty much like in this simplified example:

  <navindex>
    <tab type="mainpage" visible="yes" title="My Project"/>
    <tab type="pages" visible="no" title="" intro=""/>
    <tab type="modules" visible="no" title="" intro=""/>
    <tab type="namespaces" visible="no" title="">
      <tab type="namespacelist" visible="no" title="" intro=""/>
      <tab type="namespacemembers" visible="no" title="" intro=""/>
    </tab>
    <tab type="classes" visible="no" title="">
      <tab type="classlist" visible="no" title="" intro=""/>
      <tab type="classindex" visible="no" title=""/> 
      <tab type="hierarchy" visible="no" title="" intro=""/>
      <tab type="classmembers" visible="no" title="" intro=""/>
    </tab>
    <tab type="files" visible="no" title="">
      <tab type="filelist" visible="no" title="" intro=""/>
      <tab type="globals" visible="no" title="" intro=""/>
    </tab>
    <tab type="examples" visible="no" title="" intro=""/>  

    <tab type="usergroup" title="User Manual">
        <tab type="user" title="Page 1" url="@ref page1"/>
    </tab>

    <tab type="usergroup" title="API documentation">
        <tab type="usergoup" title="C">
            <tab type="user" title="SomeFunction" url="@ref SomeFunction" />
            <tab type="user" title="AnotherFunction" url="@ref AnotherFunction" />
        </tab>
        <tab type="usergoup" title="C#">
            <tab type="usergroup" title="A.Class1">
                <tab type="user" title="SomeFunction" url="@ref A.Class1.SomeFunction" />
            </tab>
            <tab type="usergroup" title="B.Class2">
                <tab type="user" title="AnotherFunction" url="@ref B.Class2.AnotherFunction" />
            </tab>
        </tab>
        <tab type="usergoup" title="Java">
            <tab type="usergroup" title="com.xyz.A.Class1">
                <tab type="user" title="SomeFunction" url="@ref com.xyz.A.Class1.SomeFunction" />
            </tab>
            <tab type="usergroup" title="com.xyz.B.Class2">
                <tab type="user" title="AnotherFunction" url="@ref com.xyz.B.Class2.AnotherFunction" />
            </tab>
        </tab>
    </tab>
</navindex>

这对于chm和html输出非常完美,但是不幸的是,对于可用于生成pdf的乳胶和docbook输出似乎完全被忽略了. layoutfile的文档暗示它应该独立于所使用的输出而工作:

This works perfectly fine for chm and html output, but unfortunatly seems to be completely ignored for the latex and docbook output, which could be used to generate pdf. The documentation for the layoutfile implies that it should work independently from the used output:

# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed
# by doxygen. The layout file controls the global structure of the generated
# output files in an output format independent way. To create the layout file
# that represents doxygen's defaults, run doxygen with the -l option. You can
# optionally specify a file name after the option, if omitted DoxygenLayout.xml
# will be used as the name of the layout file.
#
# Note that if you run doxygen from a directory containing a file called
# DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE
# tag is left empty.
LAYOUT_FILE            = "DoxygenLayout.xml"

推荐答案

Doxygen在Latex目录中生成了许多文件,在这种情况下,最值得注意的是:

Doxygen produces a number of files in the latex directory, in this case the most notable are:

  • refman.tex,具有许多设置,包括不同章节的内容,可能最适合您想要的东西.
  • doxygen.sty与doxygen使用的设置.一个人可以修改此文件(不是真的建议),也可以通过配置标签LATEX_EXTRA_STYLESHEET添加额外的样式表,其中一个否决(例如,通过更新命令)是默认命令.
  • refman.tex, with a number of settings and the include of the different chapters, probably most suitable for the things you want.
  • doxygen.sty with a the settings doxygen uses. One can modify this file (not really advise), one can also add extra style sheets by means of the configuration tag LATEX_EXTRA_STYLESHEET where one overrules (e.g. by renew commands) default commands.

值得注意的还有LATEX_HEADER,LATEX_FOOTER,EXTRA_PACKAGES等设置,请参见文档(> http://www.doxygen.nl/manual/),以获取更多的可能性.

Noteworthy are also settings like LATEX_HEADER, LATEX_FOOTER,EXTRA_PACKAGES`, see the documentation (chapter Configuration in http://www.doxygen.nl/manual/) for these and more possibilities.

对于docbook输出,当前版本1.8.15可能会更好一些,但是docbook没有特殊的"stylesheett".

For docbook output the current version, version 1.8.15, might work a bit better but there is no special "stylesheett" for docbook.

这篇关于使用doxygen生成具有自定义结构的PDF的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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