voloko-sdoc 0.2.0 → 0.2.1
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/VERSION.yml +1 -1
- data/lib/sdoc/generator/shtml.rb +2 -0
- data/lib/sdoc/generator/template/direct/_context.rhtml +170 -0
- data/lib/sdoc/generator/template/direct/class.rhtml +40 -0
- data/lib/sdoc/generator/template/direct/file.rhtml +29 -0
- data/lib/sdoc/generator/template/direct/index.rhtml +14 -0
- data/lib/sdoc/generator/template/direct/resources/css/main.css +233 -0
- data/lib/sdoc/generator/template/direct/resources/css/panel.css +377 -0
- data/lib/sdoc/generator/template/direct/resources/css/reset.css +53 -0
- data/lib/sdoc/generator/template/direct/resources/i/arrows.png +0 -0
- data/lib/sdoc/generator/template/direct/resources/i/results_bg.png +0 -0
- data/lib/sdoc/generator/template/direct/resources/i/tree_bg.png +0 -0
- data/lib/sdoc/generator/template/direct/resources/js/jquery-1.3.2.min.js +19 -0
- data/lib/sdoc/generator/template/direct/resources/js/jquery-effect.js +593 -0
- data/lib/sdoc/generator/template/direct/resources/js/main.js +22 -0
- data/lib/sdoc/generator/template/direct/resources/js/searchdoc.js +604 -0
- data/lib/sdoc/generator/template/direct/resources/panel/index.html +61 -0
- data/lib/sdoc/generator/template/shtml/resources/css/panel.css +11 -1
- data/lib/sdoc/generator/template/shtml/resources/js/searchdoc.js +2 -1
- data/lib/sdoc/github.rb +7 -7
- data/lib/sdoc/helpers.rb +26 -0
- data/lib/sdoc/merge.rb +13 -2
- metadata +24 -2
@@ -0,0 +1,61 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
|
3
|
+
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
|
4
|
+
|
5
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
|
6
|
+
<head>
|
7
|
+
<title>layout</title>
|
8
|
+
<link rel="stylesheet" href="../css/reset.css" type="text/css" media="screen" charset="utf-8" />
|
9
|
+
<link rel="stylesheet" href="../css/panel.css" type="text/css" media="screen" charset="utf-8" />
|
10
|
+
<script src="search_index.js" type="text/javascript" charset="utf-8"></script>
|
11
|
+
<script src="tree.js" type="text/javascript" charset="utf-8"></script>
|
12
|
+
<script src="../js/jquery-1.3.2.min.js" type="text/javascript" charset="utf-8"></script>
|
13
|
+
<script src="../js/searchdoc.js" type="text/javascript" charset="utf-8"></script>
|
14
|
+
<script type="text/javascript" charset="utf-8">
|
15
|
+
function placeholder() {
|
16
|
+
if (jQuery.browser.safari) return;
|
17
|
+
$('#search-label').click(function() {
|
18
|
+
$('#search').focus();
|
19
|
+
$('#search-label').hide();
|
20
|
+
});
|
21
|
+
|
22
|
+
$('#search').focus(function() {
|
23
|
+
$('#search-label').hide();
|
24
|
+
});
|
25
|
+
$('#search').blur(function() {
|
26
|
+
this.value == '' && $('#search-label').show()
|
27
|
+
});
|
28
|
+
|
29
|
+
$('#search')[0].value == '' && $('#search-label').show();
|
30
|
+
|
31
|
+
setInterval(function() { $('#search')[0].value != '' && $('#search-label').hide() }, 100)
|
32
|
+
}
|
33
|
+
$(function() {
|
34
|
+
placeholder();
|
35
|
+
new Searchdoc.Panel($('#panel'), search_data, tree, top.frames[1]);
|
36
|
+
$('#search').focus();
|
37
|
+
})
|
38
|
+
</script>
|
39
|
+
</head>
|
40
|
+
<body>
|
41
|
+
<div class="panel panel_tree" id="panel">
|
42
|
+
<div class="header">
|
43
|
+
<div>
|
44
|
+
<label for="search" id="search-label" style="display: none">Search</label>
|
45
|
+
<table>
|
46
|
+
<tr><td>
|
47
|
+
<input type="Search" placeholder="Search" autosave="searchdoc" results="10" id="search" autocomplete="off"/>
|
48
|
+
</td></tr>
|
49
|
+
</table></div>
|
50
|
+
</div>
|
51
|
+
<div class="tree">
|
52
|
+
<ul>
|
53
|
+
</ul>
|
54
|
+
</div>
|
55
|
+
<div class="result">
|
56
|
+
<ul>
|
57
|
+
</ul>
|
58
|
+
</div>
|
59
|
+
</div>
|
60
|
+
</body>
|
61
|
+
</html>
|
@@ -79,6 +79,7 @@
|
|
79
79
|
width: 100%;
|
80
80
|
overflow-y: scroll;
|
81
81
|
overflow-x: hidden;
|
82
|
+
-overflow-y: hidden;
|
82
83
|
background: #EDF3FE url(../i/results_bg.png);
|
83
84
|
z-index: 2;
|
84
85
|
}
|
@@ -88,12 +89,15 @@
|
|
88
89
|
font-size: 0.8em;
|
89
90
|
width: 100%;
|
90
91
|
background: #EDF3FE url(../i/results_bg.png);
|
91
|
-
zoom:1;
|
92
|
+
-zoom:1;
|
92
93
|
}
|
93
94
|
|
94
95
|
.panel .result ul li
|
95
96
|
{
|
96
97
|
height: 46px;
|
98
|
+
-height: 50px;
|
99
|
+
-display: inline;
|
100
|
+
-width: 100%;
|
97
101
|
overflow: hidden;
|
98
102
|
padding: 4px 10px 0 10px;
|
99
103
|
cursor: pointer;
|
@@ -239,8 +243,10 @@
|
|
239
243
|
bottom: 0;
|
240
244
|
left: 0;
|
241
245
|
width: 100%;
|
246
|
+
-height: expression((this.parentNode.offsetHeight - 31));
|
242
247
|
overflow-y: scroll;
|
243
248
|
overflow-x: hidden;
|
249
|
+
-overflow-y: hidden;
|
244
250
|
background: #EDF3FE url(../i/tree_bg.png);
|
245
251
|
z-index: 3;
|
246
252
|
}
|
@@ -253,6 +259,10 @@
|
|
253
259
|
.panel .tree li
|
254
260
|
{
|
255
261
|
cursor: pointer;
|
262
|
+
overflow: hidden;
|
263
|
+
-height: 23px;
|
264
|
+
-display: inline;
|
265
|
+
-zoom: 1;
|
256
266
|
}
|
257
267
|
|
258
268
|
|
@@ -67,7 +67,7 @@ Searchdoc.Navigation = new function() {
|
|
67
67
|
}
|
68
68
|
|
69
69
|
this.startMoveTimeout = function(isDown) {
|
70
|
-
if (!$.browser.mozilla) return;
|
70
|
+
if (!$.browser.mozilla && !$.browser.opera) return;
|
71
71
|
if (this.moveTimeout) this.clearMoveTimeout();
|
72
72
|
var _this = this;
|
73
73
|
|
@@ -380,6 +380,7 @@ Searchdoc.Panel.prototype = $.extend({}, Searchdoc.Navigation, new function() {
|
|
380
380
|
|
381
381
|
this.open = function(src) {
|
382
382
|
this.frame.location.href = '../' + src;
|
383
|
+
if (this.frame.highlight) this.frame.highlight(src);
|
383
384
|
}
|
384
385
|
|
385
386
|
this.select = function() {
|
data/lib/sdoc/github.rb
CHANGED
@@ -54,11 +54,11 @@ module SDoc::GitHub
|
|
54
54
|
|
55
55
|
def in_dir(dir)
|
56
56
|
pwd = Dir.pwd
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
57
|
+
Dir.chdir dir
|
58
|
+
return yield
|
59
|
+
rescue Exception => e
|
60
|
+
return ''
|
61
|
+
ensure
|
62
|
+
Dir.chdir pwd
|
63
63
|
end
|
64
|
-
end
|
64
|
+
end
|
data/lib/sdoc/helpers.rb
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
module SDoc::Helpers
|
2
|
+
def each_letter_group(methods, &block)
|
3
|
+
group = {:name => '', :methods => []}
|
4
|
+
methods.sort{ |a, b| a.name <=> b.name }.each do |method|
|
5
|
+
gname = group_name method.name
|
6
|
+
if gname != group[:name]
|
7
|
+
yield group unless group[:methods].size == 0
|
8
|
+
group = {
|
9
|
+
:name => gname,
|
10
|
+
:methods => []
|
11
|
+
}
|
12
|
+
end
|
13
|
+
group[:methods].push(method)
|
14
|
+
end
|
15
|
+
yield group unless group[:methods].size == 0
|
16
|
+
end
|
17
|
+
|
18
|
+
protected
|
19
|
+
def group_name name
|
20
|
+
if match = name.match(/^([a-z])/i)
|
21
|
+
match[1].upcase
|
22
|
+
else
|
23
|
+
'#'
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
data/lib/sdoc/merge.rb
CHANGED
@@ -97,7 +97,7 @@ class SDoc::Merge
|
|
97
97
|
searchIndex = subindex["index"]["searchIndex"]
|
98
98
|
longSearchIndex = subindex["index"]["longSearchIndex"]
|
99
99
|
subindex["index"]["info"].each_with_index do |info, j|
|
100
|
-
info[2] = name + '/' +
|
100
|
+
info[2] = name + '/' + extract_index_path(dir)
|
101
101
|
info[6] = i
|
102
102
|
items << {
|
103
103
|
:info => info,
|
@@ -128,10 +128,21 @@ class SDoc::Merge
|
|
128
128
|
end
|
129
129
|
end
|
130
130
|
|
131
|
+
def extract_index_path dir
|
132
|
+
filename = File.join dir, 'index.html'
|
133
|
+
content = File.open(filename) { |f| f.read }
|
134
|
+
match = content.match(/<frame\s+src="([^"]+)"\s+name="docwin"/mi)
|
135
|
+
if match
|
136
|
+
match[1]
|
137
|
+
else
|
138
|
+
''
|
139
|
+
end
|
140
|
+
end
|
141
|
+
|
131
142
|
def generate_index_file
|
132
143
|
templatefile = @template_dir + 'index.rhtml'
|
133
144
|
outfile = @outputdir + 'index.html'
|
134
|
-
index_path = @
|
145
|
+
index_path = @names[0] + '/' + extract_index_path(@directories[0])
|
135
146
|
|
136
147
|
render_template templatefile, binding(), outfile
|
137
148
|
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.1
|
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-04-
|
12
|
+
date: 2009-04-06 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -51,6 +51,27 @@ files:
|
|
51
51
|
- lib/sdoc/generator
|
52
52
|
- lib/sdoc/generator/shtml.rb
|
53
53
|
- lib/sdoc/generator/template
|
54
|
+
- lib/sdoc/generator/template/direct
|
55
|
+
- lib/sdoc/generator/template/direct/_context.rhtml
|
56
|
+
- lib/sdoc/generator/template/direct/class.rhtml
|
57
|
+
- lib/sdoc/generator/template/direct/file.rhtml
|
58
|
+
- lib/sdoc/generator/template/direct/index.rhtml
|
59
|
+
- lib/sdoc/generator/template/direct/resources
|
60
|
+
- lib/sdoc/generator/template/direct/resources/css
|
61
|
+
- lib/sdoc/generator/template/direct/resources/css/main.css
|
62
|
+
- lib/sdoc/generator/template/direct/resources/css/panel.css
|
63
|
+
- lib/sdoc/generator/template/direct/resources/css/reset.css
|
64
|
+
- lib/sdoc/generator/template/direct/resources/i
|
65
|
+
- lib/sdoc/generator/template/direct/resources/i/arrows.png
|
66
|
+
- lib/sdoc/generator/template/direct/resources/i/results_bg.png
|
67
|
+
- lib/sdoc/generator/template/direct/resources/i/tree_bg.png
|
68
|
+
- lib/sdoc/generator/template/direct/resources/js
|
69
|
+
- lib/sdoc/generator/template/direct/resources/js/jquery-1.3.2.min.js
|
70
|
+
- lib/sdoc/generator/template/direct/resources/js/jquery-effect.js
|
71
|
+
- lib/sdoc/generator/template/direct/resources/js/main.js
|
72
|
+
- lib/sdoc/generator/template/direct/resources/js/searchdoc.js
|
73
|
+
- lib/sdoc/generator/template/direct/resources/panel
|
74
|
+
- lib/sdoc/generator/template/direct/resources/panel/index.html
|
54
75
|
- lib/sdoc/generator/template/merge
|
55
76
|
- lib/sdoc/generator/template/merge/index.rhtml
|
56
77
|
- lib/sdoc/generator/template/shtml
|
@@ -74,6 +95,7 @@ files:
|
|
74
95
|
- lib/sdoc/generator/template/shtml/resources/panel
|
75
96
|
- lib/sdoc/generator/template/shtml/resources/panel/index.html
|
76
97
|
- lib/sdoc/github.rb
|
98
|
+
- lib/sdoc/helpers.rb
|
77
99
|
- lib/sdoc/merge.rb
|
78
100
|
- lib/sdoc/templatable.rb
|
79
101
|
- lib/sdoc.rb
|