Java:如何使用 Javadoc 创建美观的类文档?
我想为 Java 类库创建 HTML 文档,其中包括
- 编程指南信息 - 除了
- 中的类参考代码示例
- 参考文档可折叠区域
之外,我希望它看起来样式良好。像这样的东西:
我认为 Javadoc 公开了一个 doclet API,允许其他方提供集成在 Javadoc 中的文档生成。是否有一个 doclet 选项可供我使用(免费),它的功能比标准 javadoc 输出更好一些?
我尝试用谷歌搜索这个但没有运气。 建议?
附录
我找到了 doclet.com 但我不知道如何评估这些选项。建议?
特别是, XHtmlDoclet 听起来像是想要解决这些问题。有人用过吗? 我无法让它工作。另外,XHTML Doclet 人员提供的示例看起来并不比从 c.1998 javadoc 生成的文档 。
I'd like to create HTML documentation for a Java class library that includes
- programming guide information - beyond just a class reference
- code examples in the reference doc
- collapsible regions
I want it to look well-styled. Something like this:
I think that Javadoc exposes a doclet API that allows other parties to provide doc generation integrated in Javadoc. Is there a doclet option that I can use (for free) that does something a little nicer than the standard javadoc output?
I tried googling for this but no luck.
Suggestions?
Addendum
I found doclet.com but I don't know how to evaluate the options. Recommendations?
In particular, XHtmlDoclet sounds like it wants to address these issues. Anyone used it? I can't get it to work. Also the example offered by the XHTML Doclet guys doesn't look any better than the docs generated from c.1998 javadoc .
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这个问题让我思考(好吧,谷歌搜索),我偶然发现了这组标签。从未尝试过,但看起来很有希望。
This question got me thinking (ok, Googling) and I stumbled on this set of taglets. Never tried it, but it looks pretty promising.
也许您正在考虑 Java doclet API:
http: //www.oracle.com/technetwork/java/javase/documentation/index-jsp-135444.html
您似乎正在添加示例和一些文本。我认为现有的 javadoc 是完全可能的。问题将出在内容而不是渲染上。
Castor 使用 doclet 来减轻其配置负担。 EJB 1.0 也是如此。如果您愿意,请看一下这些内容。
Perhaps you're thinking of Java doclet API:
http://www.oracle.com/technetwork/java/javase/documentation/index-jsp-135444.html
It appears that you're adding examples and some text. I think it's entirely possible with existing javadocs. The problem will be the content rather than the rendering.
Castor used doclet to ease its config burden. So did EJB 1.0. Take a look at those if you'd like.