sdoc 0.2.12.1 → 0.2.14
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +3 -0
- data/Rakefile +8 -1
- data/VERSION.yml +2 -2
- data/lib/sdoc/generator/shtml.rb +51 -9
- data/lib/sdoc/generator/template/direct/resources/apple-touch-icon.png +0 -0
- data/lib/sdoc/generator/template/direct/resources/favicon.ico +0 -0
- data/lib/sdoc/generator/template/direct/resources/js/searchdoc.js +13 -5
- data/lib/sdoc/generator/template/direct/resources/panel/index.html +1 -1
- data/lib/sdoc/generator/template/shtml/resources/apple-touch-icon.png +0 -0
- data/lib/sdoc/generator/template/shtml/resources/favicon.ico +0 -0
- data/lib/sdoc/generator/template/shtml/resources/js/searchdoc.js +13 -5
- data/lib/sdoc/generator/template/shtml/resources/panel/index.html +1 -1
- data/lib/sdoc/merge.rb +2 -2
- data/sdoc.gemspec +89 -0
- metadata +12 -4
data/.gitignore
ADDED
data/Rakefile
CHANGED
@@ -21,7 +21,7 @@ end
|
|
21
21
|
|
22
22
|
begin
|
23
23
|
require 'jeweler'
|
24
|
-
Jeweler::Tasks.new do |gem|
|
24
|
+
jewler = Jeweler::Tasks.new do |gem|
|
25
25
|
gem.name = "sdoc"
|
26
26
|
gem.summary = "rdoc html with javascript search index."
|
27
27
|
gem.email = "voloko@gmail.com"
|
@@ -32,6 +32,13 @@ begin
|
|
32
32
|
|
33
33
|
# gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
|
34
34
|
end
|
35
|
+
|
36
|
+
desc "Replace system gem with symlink to this folder"
|
37
|
+
task 'ghost' do
|
38
|
+
path = Gem.searcher.find(jewler.gemspec.name).full_gem_path
|
39
|
+
system 'sudo', 'rm', '-r', path
|
40
|
+
symlink File.expand_path('.'), path
|
41
|
+
end
|
35
42
|
rescue LoadError
|
36
43
|
puts "Jeweler not available. Install it with: sudo gem install technicalpickles-jeweler -s http://gems.github.com"
|
37
44
|
end
|
data/VERSION.yml
CHANGED
data/lib/sdoc/generator/shtml.rb
CHANGED
@@ -118,7 +118,7 @@ class RDoc::Generator::SHtml
|
|
118
118
|
def generate_class_tree
|
119
119
|
debug_msg "Generating class tree"
|
120
120
|
topclasses = @classes.select {|klass| !(RDoc::ClassModule === klass.parent) }
|
121
|
-
tree = generate_class_tree_level
|
121
|
+
tree = generate_file_tree + generate_class_tree_level(topclasses)
|
122
122
|
debug_msg " writing class tree to %s" % TREE_FILE
|
123
123
|
File.open(TREE_FILE, "w", 0644) do |f|
|
124
124
|
f.write('var tree = '); f.write(tree.to_json)
|
@@ -191,13 +191,14 @@ class RDoc::Generator::SHtml
|
|
191
191
|
@classes.select { |klass|
|
192
192
|
klass.document_self_or_methods
|
193
193
|
}.sort.each do |klass|
|
194
|
+
modulename = klass.module? ? '' : (klass.superclass ? (String === klass.superclass ? klass.superclass : klass.superclass.full_name) : '')
|
194
195
|
index[:searchIndex].push( search_string(klass.name) )
|
195
|
-
index[:longSearchIndex].push( search_string(klass.parent.
|
196
|
+
index[:longSearchIndex].push( search_string(klass.parent.full_name) )
|
196
197
|
index[:info].push([
|
197
198
|
klass.name,
|
198
199
|
klass.parent.full_name,
|
199
200
|
klass.path,
|
200
|
-
|
201
|
+
modulename ? " < #{modulename}" : '',
|
201
202
|
snippet(klass.comment),
|
202
203
|
TYPE_CLASS
|
203
204
|
])
|
@@ -261,16 +262,20 @@ class RDoc::Generator::SHtml
|
|
261
262
|
end
|
262
263
|
end
|
263
264
|
|
265
|
+
def index_file
|
266
|
+
if @options.main_page && file = @files.find { |f| f.full_name == @options.main_page }
|
267
|
+
file
|
268
|
+
else
|
269
|
+
@files.first
|
270
|
+
end
|
271
|
+
end
|
272
|
+
|
264
273
|
### Create index.html with frameset
|
265
274
|
def generate_index_file
|
266
275
|
debug_msg "Generating index file in #@outputdir"
|
267
276
|
templatefile = @template_dir + 'index.rhtml'
|
268
277
|
outfile = @outputdir + 'index.html'
|
269
|
-
|
270
|
-
index_path = index_path.path
|
271
|
-
else
|
272
|
-
index_path = @files.first.path
|
273
|
-
end
|
278
|
+
index_path = index_file.path
|
274
279
|
|
275
280
|
self.render_template( templatefile, binding(), outfile )
|
276
281
|
end
|
@@ -311,4 +316,41 @@ class RDoc::Generator::SHtml
|
|
311
316
|
debug_msg "Copying #{resoureces_path}/** to #{@outputdir}/**"
|
312
317
|
FileUtils.cp_r resoureces_path.to_s, @outputdir.to_s, :preserve => true unless $dryrun
|
313
318
|
end
|
314
|
-
|
319
|
+
|
320
|
+
class FilesTree
|
321
|
+
attr_reader :children
|
322
|
+
def add(path, url)
|
323
|
+
path = path.split(File::SEPARATOR) unless Array === path
|
324
|
+
@children ||= {}
|
325
|
+
if path.length == 1
|
326
|
+
@children[path.first] = url
|
327
|
+
else
|
328
|
+
@children[path.first] ||= FilesTree.new
|
329
|
+
@children[path.first].add(path[1, path.length], url)
|
330
|
+
end
|
331
|
+
end
|
332
|
+
end
|
333
|
+
|
334
|
+
def generate_file_tree
|
335
|
+
if @files.length > 1
|
336
|
+
@files_tree = FilesTree.new
|
337
|
+
@files.each do |file|
|
338
|
+
@files_tree.add(file.relative_name, file.path)
|
339
|
+
end
|
340
|
+
[['', '', 'files', generate_file_tree_level(@files_tree)]]
|
341
|
+
else
|
342
|
+
[]
|
343
|
+
end
|
344
|
+
end
|
345
|
+
|
346
|
+
def generate_file_tree_level(tree)
|
347
|
+
tree.children.keys.sort.map do |name|
|
348
|
+
child = tree.children[name]
|
349
|
+
if String === child
|
350
|
+
[name, child, '', []]
|
351
|
+
else
|
352
|
+
['', '', name, generate_file_tree_level(child)]
|
353
|
+
end
|
354
|
+
end
|
355
|
+
end
|
356
|
+
end
|
Binary file
|
Binary file
|
@@ -28,10 +28,14 @@ Searchdoc.Navigation = new function() {
|
|
28
28
|
case 38: //Event.KEY_UP:
|
29
29
|
case 39: //Event.KEY_RIGHT:
|
30
30
|
case 40: //Event.KEY_DOWN:
|
31
|
-
case 73: // i
|
32
|
-
case
|
31
|
+
case 73: // i - qwerty
|
32
|
+
case 74: // j
|
33
33
|
case 75: // k
|
34
|
-
case
|
34
|
+
case 76: // l
|
35
|
+
case 67: // c - dvorak
|
36
|
+
case 72: // h
|
37
|
+
case 84: // t
|
38
|
+
case 78: // n
|
35
39
|
this.clearMoveTimeout();
|
36
40
|
break;
|
37
41
|
}
|
@@ -41,10 +45,12 @@ Searchdoc.Navigation = new function() {
|
|
41
45
|
if (!this.navigationActive) return;
|
42
46
|
switch(e.keyCode) {
|
43
47
|
case 37: //Event.KEY_LEFT:
|
48
|
+
case 74: // j (qwerty)
|
49
|
+
case 72: // h (dvorak)
|
44
50
|
if (this.moveLeft()) e.preventDefault();
|
45
51
|
break;
|
46
52
|
case 38: //Event.KEY_UP:
|
47
|
-
case 73: // i
|
53
|
+
case 73: // i (qwerty)
|
48
54
|
case 67: // c (dvorak)
|
49
55
|
if (e.keyCode == 38 || e.ctrlKey) {
|
50
56
|
if (this.moveUp()) e.preventDefault();
|
@@ -52,10 +58,12 @@ Searchdoc.Navigation = new function() {
|
|
52
58
|
}
|
53
59
|
break;
|
54
60
|
case 39: //Event.KEY_RIGHT:
|
61
|
+
case 76: // l (qwerty)
|
62
|
+
case 78: // n (dvorak)
|
55
63
|
if (this.moveRight()) e.preventDefault();
|
56
64
|
break;
|
57
65
|
case 40: //Event.KEY_DOWN:
|
58
|
-
case 75: // k
|
66
|
+
case 75: // k (qwerty)
|
59
67
|
case 84: // t (dvorak)
|
60
68
|
if (e.keyCode == 40 || e.ctrlKey) {
|
61
69
|
if (this.moveDown()) e.preventDefault();
|
@@ -34,7 +34,7 @@
|
|
34
34
|
var panel = new Searchdoc.Panel($('#panel'), search_data, tree, top.frames[1]);
|
35
35
|
$('#search').focus();
|
36
36
|
|
37
|
-
var s = window.parent.location.search.match(/\?q=(
|
37
|
+
var s = window.parent.location.search.match(/\?q=([^&]+)/);
|
38
38
|
if (s) {
|
39
39
|
s = decodeURIComponent(s[1]).replace(/\+/g, ' ');
|
40
40
|
if (s.length > 0)
|
Binary file
|
Binary file
|
@@ -28,10 +28,14 @@ Searchdoc.Navigation = new function() {
|
|
28
28
|
case 38: //Event.KEY_UP:
|
29
29
|
case 39: //Event.KEY_RIGHT:
|
30
30
|
case 40: //Event.KEY_DOWN:
|
31
|
-
case 73: // i
|
32
|
-
case
|
31
|
+
case 73: // i - qwerty
|
32
|
+
case 74: // j
|
33
33
|
case 75: // k
|
34
|
-
case
|
34
|
+
case 76: // l
|
35
|
+
case 67: // c - dvorak
|
36
|
+
case 72: // h
|
37
|
+
case 84: // t
|
38
|
+
case 78: // n
|
35
39
|
this.clearMoveTimeout();
|
36
40
|
break;
|
37
41
|
}
|
@@ -41,10 +45,12 @@ Searchdoc.Navigation = new function() {
|
|
41
45
|
if (!this.navigationActive) return;
|
42
46
|
switch(e.keyCode) {
|
43
47
|
case 37: //Event.KEY_LEFT:
|
48
|
+
case 74: // j (qwerty)
|
49
|
+
case 72: // h (dvorak)
|
44
50
|
if (this.moveLeft()) e.preventDefault();
|
45
51
|
break;
|
46
52
|
case 38: //Event.KEY_UP:
|
47
|
-
case 73: // i
|
53
|
+
case 73: // i (qwerty)
|
48
54
|
case 67: // c (dvorak)
|
49
55
|
if (e.keyCode == 38 || e.ctrlKey) {
|
50
56
|
if (this.moveUp()) e.preventDefault();
|
@@ -52,10 +58,12 @@ Searchdoc.Navigation = new function() {
|
|
52
58
|
}
|
53
59
|
break;
|
54
60
|
case 39: //Event.KEY_RIGHT:
|
61
|
+
case 76: // l (qwerty)
|
62
|
+
case 78: // n (dvorak)
|
55
63
|
if (this.moveRight()) e.preventDefault();
|
56
64
|
break;
|
57
65
|
case 40: //Event.KEY_DOWN:
|
58
|
-
case 75: // k
|
66
|
+
case 75: // k (qwerty)
|
59
67
|
case 84: // t (dvorak)
|
60
68
|
if (e.keyCode == 40 || e.ctrlKey) {
|
61
69
|
if (this.moveDown()) e.preventDefault();
|
@@ -34,7 +34,7 @@
|
|
34
34
|
var panel = new Searchdoc.Panel($('#panel'), search_data, tree, top.frames[1]);
|
35
35
|
$('#search').focus();
|
36
36
|
|
37
|
-
var s = window.parent.location.search.match(/\?q=(
|
37
|
+
var s = window.parent.location.search.match(/\?q=([^&]+)/);
|
38
38
|
if (s) {
|
39
39
|
s = decodeURIComponent(s[1]).replace(/\+/g, ' ');
|
40
40
|
if (s.length > 0)
|
data/lib/sdoc/merge.rb
CHANGED
@@ -67,7 +67,7 @@ class SDoc::Merge
|
|
67
67
|
url = @urls.empty? ? name : @urls[i]
|
68
68
|
filename = File.join dir, RDoc::Generator::SHtml::TREE_FILE
|
69
69
|
data = open(filename).read.sub(/var tree =\s*/, '')
|
70
|
-
subtree = JSON.parse data
|
70
|
+
subtree = JSON.parse data, :max_nesting => 35
|
71
71
|
item = [
|
72
72
|
name,
|
73
73
|
url + '/' + extract_index_path(dir),
|
@@ -100,7 +100,7 @@ class SDoc::Merge
|
|
100
100
|
url = @urls.empty? ? name : @urls[i]
|
101
101
|
filename = File.join dir, RDoc::Generator::SHtml::SEARCH_INDEX_FILE
|
102
102
|
data = open(filename).read.sub(/var search_data =\s*/, '')
|
103
|
-
subindex = JSON.parse data
|
103
|
+
subindex = JSON.parse data, :max_nesting => 35
|
104
104
|
@indexes[name] = subindex
|
105
105
|
|
106
106
|
searchIndex = subindex["index"]["searchIndex"]
|
data/sdoc.gemspec
ADDED
@@ -0,0 +1,89 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
|
3
|
+
Gem::Specification.new do |s|
|
4
|
+
s.name = %q{sdoc}
|
5
|
+
s.version = "0.2.14"
|
6
|
+
|
7
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
8
|
+
s.authors = ["Volodya Kolesnikov"]
|
9
|
+
s.date = %q{2009-08-14}
|
10
|
+
s.email = %q{voloko@gmail.com}
|
11
|
+
s.executables = ["sdoc", "sdoc-merge"]
|
12
|
+
s.extra_rdoc_files = [
|
13
|
+
"LICENSE",
|
14
|
+
"README.rdoc"
|
15
|
+
]
|
16
|
+
s.files = [
|
17
|
+
".gitignore",
|
18
|
+
"LICENSE",
|
19
|
+
"README.rdoc",
|
20
|
+
"Rakefile",
|
21
|
+
"VERSION.yml",
|
22
|
+
"bin/sdoc",
|
23
|
+
"bin/sdoc-merge",
|
24
|
+
"lib/rdoc/discover.rb",
|
25
|
+
"lib/sdoc.rb",
|
26
|
+
"lib/sdoc/c_parser_fix.rb",
|
27
|
+
"lib/sdoc/generator/shtml.rb",
|
28
|
+
"lib/sdoc/generator/template/direct/_context.rhtml",
|
29
|
+
"lib/sdoc/generator/template/direct/class.rhtml",
|
30
|
+
"lib/sdoc/generator/template/direct/file.rhtml",
|
31
|
+
"lib/sdoc/generator/template/direct/index.rhtml",
|
32
|
+
"lib/sdoc/generator/template/direct/resources/apple-touch-icon.png",
|
33
|
+
"lib/sdoc/generator/template/direct/resources/css/main.css",
|
34
|
+
"lib/sdoc/generator/template/direct/resources/css/panel.css",
|
35
|
+
"lib/sdoc/generator/template/direct/resources/css/reset.css",
|
36
|
+
"lib/sdoc/generator/template/direct/resources/favicon.ico",
|
37
|
+
"lib/sdoc/generator/template/direct/resources/i/arrows.png",
|
38
|
+
"lib/sdoc/generator/template/direct/resources/i/results_bg.png",
|
39
|
+
"lib/sdoc/generator/template/direct/resources/i/tree_bg.png",
|
40
|
+
"lib/sdoc/generator/template/direct/resources/js/jquery-1.3.2.min.js",
|
41
|
+
"lib/sdoc/generator/template/direct/resources/js/jquery-effect.js",
|
42
|
+
"lib/sdoc/generator/template/direct/resources/js/main.js",
|
43
|
+
"lib/sdoc/generator/template/direct/resources/js/searchdoc.js",
|
44
|
+
"lib/sdoc/generator/template/direct/resources/panel/index.html",
|
45
|
+
"lib/sdoc/generator/template/merge/index.rhtml",
|
46
|
+
"lib/sdoc/generator/template/shtml/_context.rhtml",
|
47
|
+
"lib/sdoc/generator/template/shtml/class.rhtml",
|
48
|
+
"lib/sdoc/generator/template/shtml/file.rhtml",
|
49
|
+
"lib/sdoc/generator/template/shtml/index.rhtml",
|
50
|
+
"lib/sdoc/generator/template/shtml/resources/apple-touch-icon.png",
|
51
|
+
"lib/sdoc/generator/template/shtml/resources/css/main.css",
|
52
|
+
"lib/sdoc/generator/template/shtml/resources/css/panel.css",
|
53
|
+
"lib/sdoc/generator/template/shtml/resources/css/reset.css",
|
54
|
+
"lib/sdoc/generator/template/shtml/resources/favicon.ico",
|
55
|
+
"lib/sdoc/generator/template/shtml/resources/i/arrows.png",
|
56
|
+
"lib/sdoc/generator/template/shtml/resources/i/results_bg.png",
|
57
|
+
"lib/sdoc/generator/template/shtml/resources/i/tree_bg.png",
|
58
|
+
"lib/sdoc/generator/template/shtml/resources/js/jquery-1.3.2.min.js",
|
59
|
+
"lib/sdoc/generator/template/shtml/resources/js/main.js",
|
60
|
+
"lib/sdoc/generator/template/shtml/resources/js/searchdoc.js",
|
61
|
+
"lib/sdoc/generator/template/shtml/resources/panel/index.html",
|
62
|
+
"lib/sdoc/github.rb",
|
63
|
+
"lib/sdoc/helpers.rb",
|
64
|
+
"lib/sdoc/merge.rb",
|
65
|
+
"lib/sdoc/templatable.rb",
|
66
|
+
"sdoc.gemspec"
|
67
|
+
]
|
68
|
+
s.homepage = %q{http://github.com/voloko/sdoc}
|
69
|
+
s.rdoc_options = ["--charset=UTF-8"]
|
70
|
+
s.require_paths = ["lib"]
|
71
|
+
s.rubygems_version = %q{1.3.4}
|
72
|
+
s.summary = %q{rdoc html with javascript search index.}
|
73
|
+
|
74
|
+
if s.respond_to? :specification_version then
|
75
|
+
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
76
|
+
s.specification_version = 3
|
77
|
+
|
78
|
+
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
79
|
+
s.add_runtime_dependency(%q<json>, [">= 1.1.3"])
|
80
|
+
s.add_runtime_dependency(%q<rdoc>, [">= 2.4.2"])
|
81
|
+
else
|
82
|
+
s.add_dependency(%q<json>, [">= 1.1.3"])
|
83
|
+
s.add_dependency(%q<rdoc>, [">= 2.4.2"])
|
84
|
+
end
|
85
|
+
else
|
86
|
+
s.add_dependency(%q<json>, [">= 1.1.3"])
|
87
|
+
s.add_dependency(%q<rdoc>, [">= 2.4.2"])
|
88
|
+
end
|
89
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sdoc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.14
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Volodya Kolesnikov
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-
|
12
|
+
date: 2009-08-14 00:00:00 +04:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -43,6 +43,7 @@ extra_rdoc_files:
|
|
43
43
|
- LICENSE
|
44
44
|
- README.rdoc
|
45
45
|
files:
|
46
|
+
- .gitignore
|
46
47
|
- LICENSE
|
47
48
|
- README.rdoc
|
48
49
|
- Rakefile
|
@@ -57,9 +58,11 @@ files:
|
|
57
58
|
- lib/sdoc/generator/template/direct/class.rhtml
|
58
59
|
- lib/sdoc/generator/template/direct/file.rhtml
|
59
60
|
- lib/sdoc/generator/template/direct/index.rhtml
|
61
|
+
- lib/sdoc/generator/template/direct/resources/apple-touch-icon.png
|
60
62
|
- lib/sdoc/generator/template/direct/resources/css/main.css
|
61
63
|
- lib/sdoc/generator/template/direct/resources/css/panel.css
|
62
64
|
- lib/sdoc/generator/template/direct/resources/css/reset.css
|
65
|
+
- lib/sdoc/generator/template/direct/resources/favicon.ico
|
63
66
|
- lib/sdoc/generator/template/direct/resources/i/arrows.png
|
64
67
|
- lib/sdoc/generator/template/direct/resources/i/results_bg.png
|
65
68
|
- lib/sdoc/generator/template/direct/resources/i/tree_bg.png
|
@@ -73,9 +76,11 @@ files:
|
|
73
76
|
- lib/sdoc/generator/template/shtml/class.rhtml
|
74
77
|
- lib/sdoc/generator/template/shtml/file.rhtml
|
75
78
|
- lib/sdoc/generator/template/shtml/index.rhtml
|
79
|
+
- lib/sdoc/generator/template/shtml/resources/apple-touch-icon.png
|
76
80
|
- lib/sdoc/generator/template/shtml/resources/css/main.css
|
77
81
|
- lib/sdoc/generator/template/shtml/resources/css/panel.css
|
78
82
|
- lib/sdoc/generator/template/shtml/resources/css/reset.css
|
83
|
+
- lib/sdoc/generator/template/shtml/resources/favicon.ico
|
79
84
|
- lib/sdoc/generator/template/shtml/resources/i/arrows.png
|
80
85
|
- lib/sdoc/generator/template/shtml/resources/i/results_bg.png
|
81
86
|
- lib/sdoc/generator/template/shtml/resources/i/tree_bg.png
|
@@ -87,8 +92,11 @@ files:
|
|
87
92
|
- lib/sdoc/helpers.rb
|
88
93
|
- lib/sdoc/merge.rb
|
89
94
|
- lib/sdoc/templatable.rb
|
95
|
+
- sdoc.gemspec
|
90
96
|
has_rdoc: true
|
91
97
|
homepage: http://github.com/voloko/sdoc
|
98
|
+
licenses: []
|
99
|
+
|
92
100
|
post_install_message:
|
93
101
|
rdoc_options:
|
94
102
|
- --charset=UTF-8
|
@@ -109,9 +117,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
109
117
|
requirements: []
|
110
118
|
|
111
119
|
rubyforge_project:
|
112
|
-
rubygems_version: 1.3.
|
120
|
+
rubygems_version: 1.3.4
|
113
121
|
signing_key:
|
114
|
-
specification_version:
|
122
|
+
specification_version: 3
|
115
123
|
summary: rdoc html with javascript search index.
|
116
124
|
test_files: []
|
117
125
|
|