rdoc_chm 2.3.0

Sign up to get free protection for your applications and to get access to all the features.
Binary file
@@ -0,0 +1,6 @@
1
+ === 2.3.0 / 2008-12-29
2
+
3
+ * 1 major enhancement
4
+
5
+ * Removed from RDoc
6
+
@@ -0,0 +1,7 @@
1
+ History.txt
2
+ Manifest.txt
3
+ README.txt
4
+ Rakefile
5
+ lib/rdoc/discover.rb
6
+ lib/rdoc/generator/chm.rb
7
+ lib/rdoc/generator/chm/chm.rb
@@ -0,0 +1,35 @@
1
+ = rdoc_chm
2
+
3
+ * Project Page: http://rubyforge.org/projects/rdoc
4
+ * Documentation: http://rdoc.rubyforge.org/rdoc_chm
5
+
6
+ == DESCRIPTION:
7
+
8
+ An unmaintained Microsoft Compiled HTML Help generator for RDoc.
9
+
10
+ == FEATURES/PROBLEMS:
11
+
12
+ * Unmaintained, only known to work with RDoc 2.3.0
13
+
14
+ == SYNOPSIS:
15
+
16
+ gem 'rdoc'
17
+ require 'rdoc/rdoc'
18
+
19
+ RDoc::RDoc.new.document "-f chm", # ... see RDoc
20
+
21
+ == REQUIREMENTS:
22
+
23
+ * RDoc 2.3 (probably works with newer RDoc 2.x versions)
24
+ * Requires installation of Microsoft's HTML Help Workshop
25
+
26
+ == INSTALL:
27
+
28
+ * sudo gem install rdoc_chm
29
+
30
+ == LICENSE:
31
+
32
+ RDoc is Copyright (c) 2001-2003 Dave Thomas, The Pragmatic Programmers. It is
33
+ free software, and may be redistributed under the terms specified in the
34
+ README file of the Ruby distribution.
35
+
@@ -0,0 +1,22 @@
1
+ # -*- ruby -*-
2
+
3
+ require 'rubygems'
4
+ require 'hoe'
5
+
6
+ $:.unshift 'lib'
7
+ require 'rdoc/rdoc'
8
+ require 'rdoc/generator/chm'
9
+
10
+ Hoe.new 'rdoc_chm', RDoc::Generator::CHM::VERSION do |p|
11
+ p.rubyforge_name = 'rdoc'
12
+
13
+ p.developer 'Eric Hodel', 'drbrain@segment7.net'
14
+ p.developer 'Dave Thomas', ''
15
+ p.developer 'Tony Strauss', 'tony.strauss@designingpatterns.com'
16
+
17
+ p.extra_deps << ['rdoc', '~> 2.3']
18
+ p.extra_dev_deps << ['minitest', '~> 1.3']
19
+ p.spec_extras['required_rubygems_version'] = '>= 1.3'
20
+ end
21
+
22
+ # vim: syntax=Ruby
@@ -0,0 +1,2 @@
1
+ require 'rdoc/generator/chm'
2
+
@@ -0,0 +1,118 @@
1
+ gem 'rdoc', '~> 2.3'
2
+ require 'rdoc/generator/html'
3
+
4
+ class RDoc::Generator::CHM < RDoc::Generator::HTML
5
+
6
+ VERSION = '2.3.0'
7
+
8
+ RDoc::RDoc.add_generator self
9
+
10
+ HHC_PATH = "c:/Program Files/HTML Help Workshop/hhc.exe"
11
+
12
+ ##
13
+ # Standard generator factory
14
+
15
+ def self.for(options)
16
+ new(options)
17
+ end
18
+
19
+ def initialize(*args)
20
+ super
21
+ @op_name = @options.op_name || "rdoc"
22
+ check_for_html_help_workshop
23
+ end
24
+
25
+ def check_for_html_help_workshop
26
+ stat = File.stat(HHC_PATH)
27
+ rescue
28
+ $stderr <<
29
+ "\n.chm output generation requires that Microsoft's Html Help\n" <<
30
+ "Workshop is installed. RDoc looks for it in:\n\n " <<
31
+ HHC_PATH <<
32
+ "\n\nYou can download a copy for free from:\n\n" <<
33
+ " http://msdn.microsoft.com/library/default.asp?" <<
34
+ "url=/library/en-us/htmlhelp/html/hwMicrosoftHTMLHelpDownloads.asp\n\n"
35
+ end
36
+
37
+ ##
38
+ # Generate the html as normal, then wrap it in a help project
39
+
40
+ def generate(info)
41
+ super
42
+ @project_name = @op_name + ".hhp"
43
+ create_help_project
44
+ end
45
+
46
+ ##
47
+ # The project contains the project file, a table of contents and an index
48
+
49
+ def create_help_project
50
+ create_project_file
51
+ create_contents_and_index
52
+ compile_project
53
+ end
54
+
55
+ ##
56
+ # The project file links together all the various
57
+ # files that go to make up the help.
58
+
59
+ def create_project_file
60
+ template = RDoc::TemplatePage.new @template::HPP_FILE
61
+ values = { "title" => @options.title, "opname" => @op_name }
62
+ files = []
63
+ @files.each do |f|
64
+ files << { "html_file_name" => f.path }
65
+ end
66
+
67
+ values['all_html_files'] = files
68
+
69
+ File.open(@project_name, "w") do |f|
70
+ template.write_html_on(f, values)
71
+ end
72
+ end
73
+
74
+ ##
75
+ # The contents is a list of all files and modules.
76
+ # For each we include as sub-entries the list
77
+ # of methods they contain. As we build the contents
78
+ # we also build an index file
79
+
80
+ def create_contents_and_index
81
+ contents = []
82
+ index = []
83
+
84
+ (@files+@classes).sort.each do |entry|
85
+ content_entry = { "c_name" => entry.name, "ref" => entry.path }
86
+ index << { "name" => entry.name, "aref" => entry.path }
87
+
88
+ internals = []
89
+
90
+ methods = entry.build_method_summary_list(entry.path)
91
+
92
+ content_entry["methods"] = methods unless methods.empty?
93
+ contents << content_entry
94
+ index.concat methods
95
+ end
96
+
97
+ values = { "contents" => contents }
98
+ template = RDoc::TemplatePage.new @template::CONTENTS
99
+ File.open("contents.hhc", "w") do |f|
100
+ template.write_html_on(f, values)
101
+ end
102
+
103
+ values = { "index" => index }
104
+ template = RDoc::TemplatePage.new @template::CHM_INDEX
105
+ File.open("index.hhk", "w") do |f|
106
+ template.write_html_on(f, values)
107
+ end
108
+ end
109
+
110
+ ##
111
+ # Invoke the windows help compiler to compiler the project
112
+
113
+ def compile_project
114
+ system(HHC_PATH, @project_name)
115
+ end
116
+
117
+ end
118
+
@@ -0,0 +1,100 @@
1
+ require 'rdoc/generator/chm'
2
+ require 'rdoc/generator/html/html'
3
+
4
+ module RDoc::Generator::CHM::CHM
5
+
6
+ HTML = RDoc::Generator::HTML::HTML
7
+
8
+ INDEX = HTML::INDEX
9
+
10
+ STYLE = HTML::STYLE
11
+
12
+ CLASS_INDEX = HTML::CLASS_INDEX
13
+ CLASS_PAGE = HTML::CLASS_PAGE
14
+ FILE_INDEX = HTML::FILE_INDEX
15
+ FILE_PAGE = HTML::FILE_PAGE
16
+ METHOD_INDEX = HTML::METHOD_INDEX
17
+ METHOD_LIST = HTML::METHOD_LIST
18
+
19
+ FR_INDEX_BODY = HTML::FR_INDEX_BODY
20
+
21
+ # This is a nasty little hack, but hhc doesn't support the <?xml tag, so...
22
+ BODY = HTML::BODY.sub!(/<\?xml.*\?>/, '')
23
+ SRC_PAGE = HTML::SRC_PAGE.sub!(/<\?xml.*\?>/, '')
24
+
25
+ HPP_FILE = <<-EOF
26
+ [OPTIONS]
27
+ Auto Index = Yes
28
+ Compatibility=1.1 or later
29
+ Compiled file=<%= values[:opname] %>.chm
30
+ Contents file=contents.hhc
31
+ Full-text search=Yes
32
+ Index file=index.hhk
33
+ Language=0x409 English(United States)
34
+ Title=<%= values[:title] %>
35
+
36
+ [FILES]
37
+ <% values[:all_html_files].each do |all_html_files| %>
38
+ <%= all_html_files[:html_file_name] %>
39
+ <% end # values[:all_html_files] %>
40
+ EOF
41
+
42
+ CONTENTS = <<-EOF
43
+ <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
44
+ <HTML>
45
+ <HEAD>
46
+ <meta name="GENERATOR" content="Microsoft&reg; HTML Help Workshop 4.1">
47
+ <!-- Sitemap 1.0 -->
48
+ </HEAD><BODY>
49
+ <OBJECT type="text/site properties">
50
+ <param name="Foreground" value="0x80">
51
+ <param name="Window Styles" value="0x800025">
52
+ <param name="ImageType" value="Folder">
53
+ </OBJECT>
54
+ <UL>
55
+ <% values[:contents].each do |contents| %>
56
+ <LI> <OBJECT type="text/sitemap">
57
+ <param name="Name" value="<%= contents[:c_name] %>">
58
+ <param name="Local" value="<%= contents[:ref] %>">
59
+ </OBJECT>
60
+ <% if contents[:methods] then %>
61
+ <ul>
62
+ <% contents[:methods].each do |methods| %>
63
+ <LI> <OBJECT type="text/sitemap">
64
+ <param name="Name" value="<%= methods[:name] %>">
65
+ <param name="Local" value="<%= methods[:aref] %>">
66
+ </OBJECT>
67
+ <% end # contents[:methods] %>
68
+ </ul>
69
+ <% end %>
70
+ </LI>
71
+ <% end # values[:contents] %>
72
+ </UL>
73
+ </BODY></HTML>
74
+ EOF
75
+
76
+ CHM_INDEX = <<-EOF
77
+ <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
78
+ <HTML>
79
+ <HEAD>
80
+ <meta name="GENERATOR" content="Microsoft&reg; HTML Help Workshop 4.1">
81
+ <!-- Sitemap 1.0 -->
82
+ </HEAD><BODY>
83
+ <OBJECT type="text/site properties">
84
+ <param name="Foreground" value="0x80">
85
+ <param name="Window Styles" value="0x800025">
86
+ <param name="ImageType" value="Folder">
87
+ </OBJECT>
88
+ <UL>
89
+ <% values[:index].each do |index| %>
90
+ <LI> <OBJECT type="text/sitemap">
91
+ <param name="Name" value="<%= index[:name] %>">
92
+ <param name="Local" value="<%= index[:aref] %>">
93
+ </OBJECT>
94
+ <% end # values[:index] %>
95
+ </UL>
96
+ </BODY></HTML>
97
+ EOF
98
+
99
+ end
100
+
metadata ADDED
@@ -0,0 +1,117 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: rdoc_chm
3
+ version: !ruby/object:Gem::Version
4
+ version: 2.3.0
5
+ platform: ruby
6
+ authors:
7
+ - Eric Hodel
8
+ - Dave Thomas
9
+ - Tony Strauss
10
+ autorequire:
11
+ bindir: bin
12
+ cert_chain:
13
+ - |
14
+ -----BEGIN CERTIFICATE-----
15
+ MIIDNjCCAh6gAwIBAgIBADANBgkqhkiG9w0BAQUFADBBMRAwDgYDVQQDDAdkcmJy
16
+ YWluMRgwFgYKCZImiZPyLGQBGRYIc2VnbWVudDcxEzARBgoJkiaJk/IsZAEZFgNu
17
+ ZXQwHhcNMDcxMjIxMDIwNDE0WhcNMDgxMjIwMDIwNDE0WjBBMRAwDgYDVQQDDAdk
18
+ cmJyYWluMRgwFgYKCZImiZPyLGQBGRYIc2VnbWVudDcxEzARBgoJkiaJk/IsZAEZ
19
+ FgNuZXQwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCbbgLrGLGIDE76
20
+ LV/cvxdEzCuYuS3oG9PrSZnuDweySUfdp/so0cDq+j8bqy6OzZSw07gdjwFMSd6J
21
+ U5ddZCVywn5nnAQ+Ui7jMW54CYt5/H6f2US6U0hQOjJR6cpfiymgxGdfyTiVcvTm
22
+ Gj/okWrQl0NjYOYBpDi+9PPmaH2RmLJu0dB/NylsDnW5j6yN1BEI8MfJRR+HRKZY
23
+ mUtgzBwF1V4KIZQ8EuL6I/nHVu07i6IkrpAgxpXUfdJQJi0oZAqXurAV3yTxkFwd
24
+ g62YrrW26mDe+pZBzR6bpLE+PmXCzz7UxUq3AE0gPHbiMXie3EFE0oxnsU3lIduh
25
+ sCANiQ8BAgMBAAGjOTA3MAkGA1UdEwQCMAAwCwYDVR0PBAQDAgSwMB0GA1UdDgQW
26
+ BBS5k4Z75VSpdM0AclG2UvzFA/VW5DANBgkqhkiG9w0BAQUFAAOCAQEAHagT4lfX
27
+ kP/hDaiwGct7XPuVGbrOsKRVD59FF5kETBxEc9UQ1clKWngf8JoVuEoKD774dW19
28
+ bU0GOVWO+J6FMmT/Cp7nuFJ79egMf/gy4gfUfQMuvfcr6DvZUPIs9P/TlK59iMYF
29
+ DIOQ3DxdF3rMzztNUCizN4taVscEsjCcgW6WkUJnGdqlu3OHWpQxZBJkBTjPCoc6
30
+ UW6on70SFPmAy/5Cq0OJNGEWBfgD9q7rrs/X8GGwUWqXb85RXnUVi/P8Up75E0ag
31
+ 14jEc90kN+C7oI/AGCBN0j6JnEtYIEJZibjjDJTSMWlUKKkj30kq7hlUC2CepJ4v
32
+ x52qPcexcYZR7w==
33
+ -----END CERTIFICATE-----
34
+
35
+ date: 2009-01-28 00:00:00 -08:00
36
+ default_executable:
37
+ dependencies:
38
+ - !ruby/object:Gem::Dependency
39
+ name: rdoc
40
+ type: :runtime
41
+ version_requirement:
42
+ version_requirements: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - ~>
45
+ - !ruby/object:Gem::Version
46
+ version: "2.3"
47
+ version:
48
+ - !ruby/object:Gem::Dependency
49
+ name: minitest
50
+ type: :development
51
+ version_requirement:
52
+ version_requirements: !ruby/object:Gem::Requirement
53
+ requirements:
54
+ - - ~>
55
+ - !ruby/object:Gem::Version
56
+ version: "1.3"
57
+ version:
58
+ - !ruby/object:Gem::Dependency
59
+ name: hoe
60
+ type: :development
61
+ version_requirement:
62
+ version_requirements: !ruby/object:Gem::Requirement
63
+ requirements:
64
+ - - ">="
65
+ - !ruby/object:Gem::Version
66
+ version: 1.8.2
67
+ version:
68
+ description: An unmaintained Microsoft Compiled HTML Help generator for RDoc.
69
+ email:
70
+ - drbrain@segment7.net
71
+ - ""
72
+ - tony.strauss@designingpatterns.com
73
+ executables: []
74
+
75
+ extensions: []
76
+
77
+ extra_rdoc_files:
78
+ - History.txt
79
+ - Manifest.txt
80
+ - README.txt
81
+ files:
82
+ - History.txt
83
+ - Manifest.txt
84
+ - README.txt
85
+ - Rakefile
86
+ - lib/rdoc/discover.rb
87
+ - lib/rdoc/generator/chm.rb
88
+ - lib/rdoc/generator/chm/chm.rb
89
+ has_rdoc: true
90
+ homepage: "Project Page: http://rubyforge.org/projects/rdoc"
91
+ post_install_message:
92
+ rdoc_options:
93
+ - --main
94
+ - README.txt
95
+ require_paths:
96
+ - lib
97
+ required_ruby_version: !ruby/object:Gem::Requirement
98
+ requirements:
99
+ - - ">="
100
+ - !ruby/object:Gem::Version
101
+ version: "0"
102
+ version:
103
+ required_rubygems_version: !ruby/object:Gem::Requirement
104
+ requirements:
105
+ - - ">="
106
+ - !ruby/object:Gem::Version
107
+ version: "1.3"
108
+ version:
109
+ requirements: []
110
+
111
+ rubyforge_project: rdoc
112
+ rubygems_version: 1.3.1.1939
113
+ signing_key:
114
+ specification_version: 2
115
+ summary: An unmaintained Microsoft Compiled HTML Help generator for RDoc.
116
+ test_files: []
117
+
Binary file