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

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

问题描述

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

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任务的<header>元素,但是放置在其中的任何标记最终都在<h1>标记内,该标记无效,因此被浏览器忽略.

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天全站免登陆