简体   繁体   English

Apache Forrest作为代码文档解决方案

[英]Apache Forrest as a Code Documentation Solution

Lately, I have been looking into Apache Forrest as a code documentation solution. 最近,我一直在研究Apache Forrest作为代码文档解决方案。 From Apache's website, 来自Apache的网站,

"Apache Forrest™ software is a publishing framework that transforms input from various sources into a unified presentation in one or more output formats. The modular and extensible plug-in architecture of Apache Forrest is based on Apache Cocoon and the relevant industry standards that separate presentation from content. Forrest can generate static documents, or be used as a dynamic server, or be deployed by its automated facility." “Apache Forrest™软件是一个发布框架,它将来自各种来源的输入转换为一种或多种输出格式的统一表示.Apache Forrest的模块化和可扩展的插件体系结构基于Apache Cocoon和相关的行业标准,将表示分开来自内容.Forrest可以生成静态文档,或者用作动态服务器,或者由其自动化工具部署。“

I was wondering if Apache Forrest could be used as a way to organize and post documentation of some java code which is complete with JavaDoc comments. 我想知道Apache Forrest是否可以用作组织和发布一些Java代码的文档的方法,这些代码与JavaDoc注释一起完成。 I know JavaDoc can do it itself, but I feel like Apache Forrest provides some additional customization. 我知道JavaDoc可以自己做,但我觉得Apache Forrest提供了一些额外的自定义。 I found instructions on the Apache website on how to include it in Maven, but it appears to be tailored towards Maven 1.x and I use Maven 2. Is something like this possible? 我在Apache网站上找到了如何将其包含在Maven中的说明,但它似乎是针对Maven 1.x而定制的,我使用的是Maven 2.这样的事情可能吗? And if so, what is the best way to go about integrating it? 如果是这样,那么整合它的最佳方式是什么?

Thanks ahead of time. 提前谢谢。

In Documenting Projects with Apache Forrest , the author writes this about Forrest Alternatives : 使用Apache Forrest的Documenting Projects中 ,作者写了关于Forrest Alternatives的文章

If you're familiar with Maven, you may be wondering why anyone would bother with Forrest. 如果你熟悉Maven,你可能会想知道为什么有人会为Forrest打扰。 Maven does everything Forrest does, and much more: completely automating your build, attaching JUnit and CVS reports and all sorts of additional useful information on top of the basic documentation. Maven完成了Forrest所做的一切,以及更多:完全自动化构建,在基本文档之上附加JUnit和CVS报告以及各种其他有用信息。 It even provides targets to auto-install your newly generated web site onto a remote host. 它甚至提供了将新生成的网站自动安装到远程主机上的目标。

I have used Maven on a number of projects, and it's an impressive package. 我在许多项目中使用过Maven,这是一个令人印象深刻的包。 The learning curve is not much worse than Forrest's for basic use, and since you don't have to learn Ant if you use Maven, it's arguably even less for setting up a project from scratch. 学习曲线并不比Forrest的基本用途差,并且因为如果你使用Maven你不需要学习Ant,那么从头开始设置一个项目可能更少。 Forrest as a whole is less complex, though, and if you don't need everything Maven provides, you might want to start with Forrest and migrate to Maven later if you need it. 但是,Forrest作为一个整体并不那么复杂,如果你不需要Maven提供的所有东西,你可能想要从Forrest开始并在以后需要时迁移到Maven。 Forrest is also better if you have an existing large-build system based on Ant: it lets you add in Maven-style web site generation incrementally instead of rewriting all your build scripts to Maven-ize the project. 如果你有一个基于Ant的现有大型构建系统,Forrest也会更好:它允许你逐步添加Maven风格的网站生成,而不是将所有构建脚本重写为Maven-ize项目。

In terms of pure-documentation alternatives, another solid option with a lot of open source community support is DocBook. 就纯文档替代方案而言,另一个具有大量开源社区支持的可靠选项是DocBook。 You could write the manual for a 747 with DocBook: it's the ultimate SGML (or XML; there are two versions) dialect for technical writing. 您可以使用DocBook编写747手册:它是技术写作的最终SGML(或XML;有两个版本)方言。 The XML variant has a nice set of stylesheets from Norman Walsh that can generate HTML, PDF, RTF (Microsoft Word) and other formats from DocBook source. XML变体有一套很好的Norman Walsh样式表,可以从DocBook源生成HTML,PDF,RTF(Microsoft Word)和其他格式。 I think Forrest's XML dialect covers 80 percent of the cases, with a much smaller learning curve, but for a large project that also needs to produce print documentation, DocBook merits consideration. 我认为Forrest的XML方言覆盖了80%的案例,学习曲线要​​小得多,但对于需要制作印刷文档的大型项目,DocBook也值得考虑。 Note that if you want to migrate from DocBook, Forrest supports rendering a subset of DocBook/XML as well, but it is not well supported. 请注意,如果要从DocBook迁移,Forrest也支持渲染DocBook / XML的子集,但它不受支持。 Forrest does not aim to become a full-fledged DocBook renderer any time in the future, either, according to one of the developers, so I would not rely upon it as a format for new documentation in Forrest. 根据其中一位开发人员的说法,Forrest并不打算在未来的任何时候成为一个成熟的DocBook渲染器,因此我不会依赖它作为Forrest新文档的格式。

So, as you're already using Maven, I really wonder why you would look at Forrest. 所以,当你已经在使用Maven时,我真的很想知道你为什么要看福雷斯特。 Check out Maven Doxia if you still have some doubts about Maven's potential. 如果您对Maven的潜力仍有疑问,请查看Maven Doxia

And if you want to use DocBook and if Maven's native support through Doxia is too limited, there is the Docbkx Maven Plugin (preferred over the Maven Docbook plugin ). 如果你想使用DocBook,如果Maven通过Doxia的原生支持太有限,那么就有Docbkx Maven插件 (优于Maven Docbook插件 )。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM