If you want to go with the JavaDoc way, I would recommend using Natural Docs. However, if you want to simply show the Java and convert into a CSS formatted HTML section on your page, I would recommend using Google's Code Prettify. Check out the link to README for examples. You can also check out the Java Test Page to see how the Java will look.
Javadoc 会将您的代码转换为 HTML(以及关联的类树和链接等) ,但不幸的是,语法并没有突出显示代码。 您可以做的是将 Google 代码美化器 添加到每个页面,这可以工作。
Javadoc will convert your code to HTML (along with the associated class trees and linkages, etc), but doesn't syntax highlight the code unfortunately. What you could do is add the Google Code Prettifier to each page, which could work.
发布评论
评论(4)
Pygments
Java 示例:http://pygments.org/demo/1476/
Pygments
Java example: http://pygments.org/demo/1476/
如果您想采用 JavaDoc 方式,我建议使用 Natural Docs。 但是,如果您只想在页面上显示 Java 并转换为 CSS 格式的 HTML 部分,我建议使用 Google 的 代码美化。 查看 README 的链接以获取示例。 您还可以查看 Java 测试页 查看 Java 的外观。
If you want to go with the JavaDoc way, I would recommend using Natural Docs. However, if you want to simply show the Java and convert into a CSS formatted HTML section on your page, I would recommend using Google's Code Prettify. Check out the link to README for examples. You can also check out the Java Test Page to see how the Java will look.
Javadoc 会将您的代码转换为 HTML(以及关联的类树和链接等) ,但不幸的是,语法并没有突出显示代码。 您可以做的是将 Google 代码美化器 添加到每个页面,这可以工作。
Javadoc will convert your code to HTML (along with the associated class trees and linkages, etc), but doesn't syntax highlight the code unfortunately. What you could do is add the Google Code Prettifier to each page, which could work.
我正在使用 Java2HTML。 它作为 Eclipse 插件运行,也可以从命令行或作为 ant 脚本运行。
它还可以转换为 TeX 和 XML。
I'm using Java2HTML. It runs as Eclipse plugin, and also from commandline or as ant script.
It can also convert to TeX and XML.