Imported File#ftype spec from rubyspecs.
[rbx.git] / lib / rdoc / generator / chm / chm.rb
blob0a17a9e1eaa4292fcbc5dd4801f878091ad5ed6d
1 require 'rdoc/generator/chm'
2 require 'rdoc/generator/html/html'
4 module RDoc::Generator::CHM::CHM
6   HTML = RDoc::Generator::HTML::HTML
8   INDEX = HTML::INDEX
10   CLASS_INDEX = HTML::CLASS_INDEX
11   CLASS_PAGE = HTML::CLASS_PAGE
12   FILE_INDEX = HTML::FILE_INDEX
13   FILE_PAGE = HTML::FILE_PAGE
14   METHOD_INDEX = HTML::METHOD_INDEX
15   METHOD_LIST = HTML::METHOD_LIST
17   FR_INDEX_BODY = HTML::FR_INDEX_BODY
19   # This is a nasty little hack, but hhc doesn't support the <?xml tag, so...
20   BODY = HTML::BODY.sub!(/<\?xml.*\?>/, '')
21   SRC_PAGE = HTML::SRC_PAGE.sub!(/<\?xml.*\?>/, '')
23   HPP_FILE = <<-EOF
24 [OPTIONS]
25 Auto Index = Yes
26 Compatibility=1.1 or later
27 Compiled file=<%= values["opname"] %>.chm
28 Contents file=contents.hhc
29 Full-text search=Yes
30 Index file=index.hhk
31 Language=0x409 English(United States)
32 Title=<%= values["title"] %>
34 [FILES]
35 <% values["all_html_files"].each do |all_html_files| %>
36 <%= all_html_files["html_file_name"] %>
37 <% end # values["all_html_files"] %>
38   EOF
40   CONTENTS = <<-EOF
41 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
42 <HTML>
43 <HEAD>
44 <meta name="GENERATOR" content="Microsoft&reg; HTML Help Workshop 4.1">
45 <!-- Sitemap 1.0 -->
46 </HEAD><BODY>
47 <OBJECT type="text/site properties">
48         <param name="Foreground" value="0x80">
49         <param name="Window Styles" value="0x800025">
50         <param name="ImageType" value="Folder">
51 </OBJECT>
52 <UL>
53 <% values["contents"].each do |contents| %>
54         <LI> <OBJECT type="text/sitemap">
55                 <param name="Name" value="<%= contents["c_name"] %>">
56                 <param name="Local" value="<%= contents["ref"] %>">
57                 </OBJECT>
58 <% if contents["methods"] then %>
59 <ul>
60 <% contents["methods"].each do |methods| %>
61         <LI> <OBJECT type="text/sitemap">
62                 <param name="Name" value="<%= methods["name"] %>">
63                 <param name="Local" value="<%= methods["aref"] %>">
64                 </OBJECT>
65 <% end # contents["methods"] %>
66 </ul>
67 <% end %>
68         </LI>
69 <% end # values["contents"] %>
70 </UL>
71 </BODY></HTML>
72   EOF
74   CHM_INDEX = <<-EOF
75 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
76 <HTML>
77 <HEAD>
78 <meta name="GENERATOR" content="Microsoft&reg; HTML Help Workshop 4.1">
79 <!-- Sitemap 1.0 -->
80 </HEAD><BODY>
81 <OBJECT type="text/site properties">
82         <param name="Foreground" value="0x80">
83         <param name="Window Styles" value="0x800025">
84         <param name="ImageType" value="Folder">
85 </OBJECT>
86 <UL>
87 <% values["index"].each do |index| %>
88         <LI> <OBJECT type="text/sitemap">
89                 <param name="Name" value="<%= index["name"] %>">
90                 <param name="Local" value="<%= index["aref"] %>">
91                 </OBJECT>
92 <% end # values["index"] %>
93 </UL>
94 </BODY></HTML>
95   EOF
97 end