2008-01-12 22:13:37 -05:00
|
|
|
require 'rdoc/generator/chm'
|
|
|
|
require 'rdoc/generator/html/html'
|
2003-12-01 02:12:49 -05:00
|
|
|
|
2008-01-12 22:13:37 -05:00
|
|
|
module RDoc::Generator::CHM::CHM
|
2003-12-01 02:12:49 -05:00
|
|
|
|
2008-01-12 22:13:37 -05:00
|
|
|
HTML = RDoc::Generator::HTML::HTML
|
2003-12-01 02:12:49 -05:00
|
|
|
|
2008-01-12 22:02:49 -05:00
|
|
|
INDEX = HTML::INDEX
|
2008-09-24 22:43:03 -04:00
|
|
|
|
|
|
|
STYLE = HTML::STYLE
|
2003-12-01 02:12:49 -05:00
|
|
|
|
2008-01-12 22:02:49 -05:00
|
|
|
CLASS_INDEX = HTML::CLASS_INDEX
|
|
|
|
CLASS_PAGE = HTML::CLASS_PAGE
|
|
|
|
FILE_INDEX = HTML::FILE_INDEX
|
|
|
|
FILE_PAGE = HTML::FILE_PAGE
|
|
|
|
METHOD_INDEX = HTML::METHOD_INDEX
|
|
|
|
METHOD_LIST = HTML::METHOD_LIST
|
|
|
|
|
|
|
|
FR_INDEX_BODY = HTML::FR_INDEX_BODY
|
|
|
|
|
|
|
|
# This is a nasty little hack, but hhc doesn't support the <?xml tag, so...
|
|
|
|
BODY = HTML::BODY.sub!(/<\?xml.*\?>/, '')
|
|
|
|
SRC_PAGE = HTML::SRC_PAGE.sub!(/<\?xml.*\?>/, '')
|
|
|
|
|
|
|
|
HPP_FILE = <<-EOF
|
2003-12-01 02:12:49 -05:00
|
|
|
[OPTIONS]
|
|
|
|
Auto Index = Yes
|
|
|
|
Compatibility=1.1 or later
|
2008-01-07 05:40:50 -05:00
|
|
|
Compiled file=<%= values["opname"] %>.chm
|
2003-12-01 02:12:49 -05:00
|
|
|
Contents file=contents.hhc
|
|
|
|
Full-text search=Yes
|
|
|
|
Index file=index.hhk
|
|
|
|
Language=0x409 English(United States)
|
2008-01-07 05:40:50 -05:00
|
|
|
Title=<%= values["title"] %>
|
2003-12-01 02:12:49 -05:00
|
|
|
|
|
|
|
[FILES]
|
2008-01-07 05:40:50 -05:00
|
|
|
<% values["all_html_files"].each do |all_html_files| %>
|
|
|
|
<%= all_html_files["html_file_name"] %>
|
|
|
|
<% end # values["all_html_files"] %>
|
2008-01-12 22:02:49 -05:00
|
|
|
EOF
|
2003-12-01 02:12:49 -05:00
|
|
|
|
2008-01-12 22:02:49 -05:00
|
|
|
CONTENTS = <<-EOF
|
2003-12-01 02:12:49 -05:00
|
|
|
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
|
|
|
|
<HTML>
|
|
|
|
<HEAD>
|
|
|
|
<meta name="GENERATOR" content="Microsoft® HTML Help Workshop 4.1">
|
|
|
|
<!-- Sitemap 1.0 -->
|
|
|
|
</HEAD><BODY>
|
|
|
|
<OBJECT type="text/site properties">
|
|
|
|
<param name="Foreground" value="0x80">
|
|
|
|
<param name="Window Styles" value="0x800025">
|
|
|
|
<param name="ImageType" value="Folder">
|
|
|
|
</OBJECT>
|
|
|
|
<UL>
|
2008-01-07 05:40:50 -05:00
|
|
|
<% values["contents"].each do |contents| %>
|
2003-12-01 02:12:49 -05:00
|
|
|
<LI> <OBJECT type="text/sitemap">
|
2008-01-07 05:40:50 -05:00
|
|
|
<param name="Name" value="<%= contents["c_name"] %>">
|
|
|
|
<param name="Local" value="<%= contents["ref"] %>">
|
2003-12-01 02:12:49 -05:00
|
|
|
</OBJECT>
|
2008-01-07 05:40:50 -05:00
|
|
|
<% if contents["methods"] then %>
|
2003-12-01 02:12:49 -05:00
|
|
|
<ul>
|
2008-01-07 05:40:50 -05:00
|
|
|
<% contents["methods"].each do |methods| %>
|
2003-12-01 02:12:49 -05:00
|
|
|
<LI> <OBJECT type="text/sitemap">
|
2008-01-07 05:40:50 -05:00
|
|
|
<param name="Name" value="<%= methods["name"] %>">
|
|
|
|
<param name="Local" value="<%= methods["aref"] %>">
|
2003-12-01 02:12:49 -05:00
|
|
|
</OBJECT>
|
2008-01-07 05:40:50 -05:00
|
|
|
<% end # contents["methods"] %>
|
2003-12-01 02:12:49 -05:00
|
|
|
</ul>
|
2008-01-07 05:40:50 -05:00
|
|
|
<% end %>
|
2003-12-01 02:12:49 -05:00
|
|
|
</LI>
|
2008-01-07 05:40:50 -05:00
|
|
|
<% end # values["contents"] %>
|
2003-12-01 02:12:49 -05:00
|
|
|
</UL>
|
|
|
|
</BODY></HTML>
|
2008-01-12 22:02:49 -05:00
|
|
|
EOF
|
2003-12-01 02:12:49 -05:00
|
|
|
|
2008-01-12 22:02:49 -05:00
|
|
|
CHM_INDEX = <<-EOF
|
2003-12-01 02:12:49 -05:00
|
|
|
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
|
|
|
|
<HTML>
|
|
|
|
<HEAD>
|
|
|
|
<meta name="GENERATOR" content="Microsoft® HTML Help Workshop 4.1">
|
|
|
|
<!-- Sitemap 1.0 -->
|
|
|
|
</HEAD><BODY>
|
|
|
|
<OBJECT type="text/site properties">
|
|
|
|
<param name="Foreground" value="0x80">
|
|
|
|
<param name="Window Styles" value="0x800025">
|
|
|
|
<param name="ImageType" value="Folder">
|
|
|
|
</OBJECT>
|
|
|
|
<UL>
|
2008-01-07 05:40:50 -05:00
|
|
|
<% values["index"].each do |index| %>
|
2003-12-01 02:12:49 -05:00
|
|
|
<LI> <OBJECT type="text/sitemap">
|
2008-01-07 05:40:50 -05:00
|
|
|
<param name="Name" value="<%= index["name"] %>">
|
|
|
|
<param name="Local" value="<%= index["aref"] %>">
|
2003-12-01 02:12:49 -05:00
|
|
|
</OBJECT>
|
2008-01-07 05:40:50 -05:00
|
|
|
<% end # values["index"] %>
|
2003-12-01 02:12:49 -05:00
|
|
|
</UL>
|
|
|
|
</BODY></HTML>
|
2008-01-12 22:02:49 -05:00
|
|
|
EOF
|
2008-01-07 05:40:50 -05:00
|
|
|
|
2003-12-01 02:12:49 -05:00
|
|
|
end
|
2008-01-07 05:40:50 -05:00
|
|
|
|