创建使用收藏夹图标的 Javadoc HTML 页面 [英] Creating Javadoc HTML pages that use a favicon

查看:31
本文介绍了创建使用收藏夹图标的 Javadoc HTML 页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在生成的 Javadoc HTML 的 中包含一个元素:

I want to include an element in the <head> of my generated Javadoc HTML:

<link rel="shortcut icon" href="my-project-icon.ico" />

请注意,我正在使用 Ant 任务来生成 Javadoc.

Note that I'm using an Ant task to generate the Javadoc.

我尝试使用 Ant 任务的

元素,但放置在那里的任何标记都以

标记结束,该标记无效且因此被浏览器忽略.

I tried using the <header> element of the Ant task, but any markup placed there ends up within an <h1> tag, which is invalid and therefore ignored by the browser.

推荐答案

我肯定会修改输出文件作为一个简单的蛮力解决方案.但一种复杂的方法是使用自定义 doclet.此 doclet 将是标准 doclet 的副本(在哪里可以下载当前版本(1.5 或 1.6)的标准 JavaDoc doclet 的源代码).

I would definitely modify the output files as an easy brute force solution. But a sophisticated way would be to have a custom doclet. This doclet would be a copy of standard doclet (Where can you download the source for the standard JavaDoc doclet for current releases (1.5 or 1.6)).

HtmlDocletWriter.java中有很多行head.addContent.您可以再添加一行这样的行,也许基于 HtmlTree.LINK.

In HtmlDocletWriter.java there are many lines head.addContent. You would add one more such a line, perhaps based on HtmlTree.LINK.

这篇关于创建使用收藏夹图标的 Javadoc HTML 页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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