简体   繁体   English

Java:如何使用Javadoc创建外观漂亮的类文档?

[英]Java: How can I create good looking class docs with Javadoc?

I'd like to create HTML documentation for a Java class library that includes 我想为包含的Java类库创建HTML文档

  • 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. 认为 Javadoc公开了一个doclet API,允许其他方提供集成在Javadoc中的doc生成。 Is there a doclet option that I can use (for free) that does something a little nicer than the standard javadoc output? 是否有一个doclet选项,我可以使用(免费)做一些比标准的javadoc输出更好的东西?

I tried googling for this but no luck. 我试着谷歌搜索但没有运气。 Suggestions? 建议?

Addendum 附录
I found doclet.com but I don't know how to evaluate the options. 我找到了doclet.com,但我不知道如何评估这些选项。 Recommendations? 建议?

In particular, XHtmlDoclet sounds like it wants to address these issues. 特别是, XHtmlDoclet听起来像是要解决这些问题。 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 . 此外, XHTML Doclet人员提供示例看起来并不比从c.1998 javadoc生成的文档更好。


Related: 有关:
Why does Javadoc generate non-compliant XHTML? 为什么Javadoc会生成不兼容的XHTML?

Perhaps you're thinking of Java doclet API: 也许您正在考虑使用Java doclet API:

http://www.oracle.com/technetwork/java/javase/documentation/index-jsp-135444.html 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. 我认为现有的javadoc完全有可能。 The problem will be the content rather than the rendering. 问题将是内容而不是渲染。

Castor used doclet to ease its config burden. Castor使用doclet来减轻配置负担。 So did EJB 1.0 . EJB 1.0也是如此 Take a look at those if you'd like. 如果你愿意,看看那些。

This question got me thinking (ok, Googling) and I stumbled on this set of taglets . 这个问题让我思考(好吧,谷歌搜索),我偶然发现了这组标签 Never tried it, but it looks pretty promising. 没试过,但看起来很有前途。

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

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