javadoc的语法高亮? [英] syntax highlighting for javadoc?

查看:376
本文介绍了javadoc的语法高亮?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目前我在我的javadoc中使用PRE标签格式化代码示例,例如:

Currently I format code examples in my javadoc using the PRE tag e.g.:

/**
 * Example javadoc
 * 
<pre>
String foo = "bar";
</pre>
 *
 * @return   true if the operation completed
 */



<但是这在结果javadoc中变得相当单调和无聊,我更倾向于使用类似于 SyntaxHighlighter

如何做到这一点?

推荐答案

您可以使用 jQuery 使用 beautyOfCode 插件。我不确定是否有一种简单的方法来挂钩javadoc代,但事后你可以在你的标题中执行以下操作:

You can use jQuery to get it done using the beautyOfCode plugin. I'm not sure if there's an easy way to hook into the javadoc generation, but after-the-fact you can just do the following in your header:

$(function(){  
    $("pre").beautifyCode('java');  
});

并且PRE标签内的所有文本都将突出显示为java。查看上面的链接以获取更多信息。

and all text inside PRE tags will be highlighted as java. Check out the links above for more info.

这篇关于javadoc的语法高亮?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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