With the javadoc target in Apache Ant, is it possible to make all external links open in a new window
The Apache Ant javadoc target allows a <link>
attribute to link to external javadocs. I would like these javadocs to open in a new window (like target="_blank"
), but the link attribute doesn't accept a <target>
attribute that would al开发者_JAVA技巧low me to do something like this. Is there some other way to do this apart from manually editing the links after they are generated?
The "bottom" element can be used in javadoc ant task. It injects html code into each files.
<javadoc .....>
<!--
.....
-->
<bottom>
<script>
for(var i in document.links) {
var link = document.links[i];
if (link.href.indexOf('http') === 0) {
link.target = '_blank';
}
}
</script>
</bottom>
</javadoc>
精彩评论