voloko-sdoc 0.2.12.1 → 0.2.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.gitignore +3 -0
- data/Rakefile +8 -1
- data/VERSION.yml +1 -1
- data/lib/sdoc/generator/shtml.rb +48 -7
- 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 +10 -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)
|
@@ -261,16 +261,20 @@ class RDoc::Generator::SHtml
|
|
261
261
|
end
|
262
262
|
end
|
263
263
|
|
264
|
+
def index_file
|
265
|
+
if @options.main_page && file = @files.find { |f| f.full_name == @options.main_page }
|
266
|
+
file
|
267
|
+
else
|
268
|
+
@files.first
|
269
|
+
end
|
270
|
+
end
|
271
|
+
|
264
272
|
### Create index.html with frameset
|
265
273
|
def generate_index_file
|
266
274
|
debug_msg "Generating index file in #@outputdir"
|
267
275
|
templatefile = @template_dir + 'index.rhtml'
|
268
276
|
outfile = @outputdir + 'index.html'
|
269
|
-
|
270
|
-
index_path = index_path.path
|
271
|
-
else
|
272
|
-
index_path = @files.first.path
|
273
|
-
end
|
277
|
+
index_path = index_file.path
|
274
278
|
|
275
279
|
self.render_template( templatefile, binding(), outfile )
|
276
280
|
end
|
@@ -311,4 +315,41 @@ class RDoc::Generator::SHtml
|
|
311
315
|
debug_msg "Copying #{resoureces_path}/** to #{@outputdir}/**"
|
312
316
|
FileUtils.cp_r resoureces_path.to_s, @outputdir.to_s, :preserve => true unless $dryrun
|
313
317
|
end
|
314
|
-
|
318
|
+
|
319
|
+
class FilesTree
|
320
|
+
attr_reader :children
|
321
|
+
def add(path, url)
|
322
|
+
path = path.split(File::SEPARATOR) unless Array === path
|
323
|
+
@children ||= {}
|
324
|
+
if path.length == 1
|
325
|
+
@children[path.first] = url
|
326
|
+
else
|
327
|
+
@children[path.first] ||= FilesTree.new
|
328
|
+
@children[path.first].add(path[1, path.length], url)
|
329
|
+
end
|
330
|
+
end
|
331
|
+
end
|
332
|
+
|
333
|
+
def generate_file_tree
|
334
|
+
if @files.length > 1
|
335
|
+
@files_tree = FilesTree.new
|
336
|
+
@files.each do |file|
|
337
|
+
@files_tree.add(file.relative_name, file.path)
|
338
|
+
end
|
339
|
+
[['', '', 'files', generate_file_tree_level(@files_tree)]]
|
340
|
+
else
|
341
|
+
[]
|
342
|
+
end
|
343
|
+
end
|
344
|
+
|
345
|
+
def generate_file_tree_level(tree)
|
346
|
+
tree.children.keys.sort.map do |name|
|
347
|
+
child = tree.children[name]
|
348
|
+
if String === child
|
349
|
+
[name, child, '', []]
|
350
|
+
else
|
351
|
+
['', '', name, generate_file_tree_level(child)]
|
352
|
+
end
|
353
|
+
end
|
354
|
+
end
|
355
|
+
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.13"
|
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-06-17}
|
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: voloko-sdoc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.13
|
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-06-17 00:00:00 -07: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,7 +92,8 @@ files:
|
|
87
92
|
- lib/sdoc/helpers.rb
|
88
93
|
- lib/sdoc/merge.rb
|
89
94
|
- lib/sdoc/templatable.rb
|
90
|
-
|
95
|
+
- sdoc.gemspec
|
96
|
+
has_rdoc: false
|
91
97
|
homepage: http://github.com/voloko/sdoc
|
92
98
|
post_install_message:
|
93
99
|
rdoc_options:
|
@@ -111,7 +117,7 @@ requirements: []
|
|
111
117
|
rubyforge_project:
|
112
118
|
rubygems_version: 1.2.0
|
113
119
|
signing_key:
|
114
|
-
specification_version:
|
120
|
+
specification_version: 3
|
115
121
|
summary: rdoc html with javascript search index.
|
116
122
|
test_files: []
|
117
123
|
|