sdoc 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/sdoc/generator.rb +34 -11
- data/lib/sdoc/generator/template/direct/_context.rhtml +1 -1
- data/lib/sdoc/generator/template/direct/_head.rhtml +7 -0
- data/lib/sdoc/generator/template/direct/class.rhtml +4 -5
- data/lib/sdoc/generator/template/direct/file.rhtml +4 -5
- data/lib/sdoc/generator/template/direct/index.rhtml +1 -2
- data/lib/sdoc/generator/template/direct/resources/css/github.css +129 -0
- data/lib/sdoc/generator/template/direct/resources/js/highlight.pack.js +1 -0
- data/lib/sdoc/generator/template/direct/resources/js/main.js +15 -13
- data/lib/sdoc/generator/template/direct/resources/panel/index.html +32 -31
- data/lib/sdoc/generator/template/direct/se_index.rhtml +8 -0
- data/sdoc.gemspec +2 -2
- metadata +8 -20
- data/lib/sdoc/generator/template/shtml/_context.rhtml +0 -163
- data/lib/sdoc/generator/template/shtml/class.rhtml +0 -46
- data/lib/sdoc/generator/template/shtml/file.rhtml +0 -37
- data/lib/sdoc/generator/template/shtml/index.rhtml +0 -14
- data/lib/sdoc/generator/template/shtml/resources/apple-touch-icon.png +0 -0
- data/lib/sdoc/generator/template/shtml/resources/css/main.css +0 -191
- data/lib/sdoc/generator/template/shtml/resources/css/panel.css +0 -383
- data/lib/sdoc/generator/template/shtml/resources/css/reset.css +0 -53
- data/lib/sdoc/generator/template/shtml/resources/favicon.ico +0 -0
- data/lib/sdoc/generator/template/shtml/resources/i/arrows.png +0 -0
- data/lib/sdoc/generator/template/shtml/resources/i/results_bg.png +0 -0
- data/lib/sdoc/generator/template/shtml/resources/i/tree_bg.png +0 -0
- data/lib/sdoc/generator/template/shtml/resources/js/jquery-1.3.2.min.js +0 -19
- data/lib/sdoc/generator/template/shtml/resources/js/main.js +0 -34
- data/lib/sdoc/generator/template/shtml/resources/js/searchdoc.js +0 -628
- data/lib/sdoc/generator/template/shtml/resources/panel/index.html +0 -71
data/lib/sdoc/generator.rb
CHANGED
@@ -28,6 +28,7 @@ end
|
|
28
28
|
|
29
29
|
class RDoc::Options
|
30
30
|
attr_accessor :github
|
31
|
+
attr_accessor :se_index
|
31
32
|
end
|
32
33
|
|
33
34
|
class RDoc::Generator::SDoc
|
@@ -56,12 +57,12 @@ class RDoc::Generator::SDoc
|
|
56
57
|
RESOURCES_DIR = File.join('resources', '.')
|
57
58
|
|
58
59
|
attr_reader :basedir
|
59
|
-
|
60
|
+
|
60
61
|
attr_reader :options
|
61
62
|
|
62
63
|
def self.setup_options(options)
|
63
64
|
@github = false
|
64
|
-
options.
|
65
|
+
options.se_index = true
|
65
66
|
|
66
67
|
opt = options.option_parser
|
67
68
|
opt.separator nil
|
@@ -71,7 +72,19 @@ class RDoc::Generator::SDoc
|
|
71
72
|
"Generate links to github.") do |value|
|
72
73
|
options.github = true
|
73
74
|
end
|
75
|
+
opt.separator nil
|
74
76
|
|
77
|
+
opt.on("--no-se-index", "-ns",
|
78
|
+
"Do not generated index file for search engines.",
|
79
|
+
"",
|
80
|
+
"SDoc uses javascript to refrence individual documentation pages.",
|
81
|
+
"Search engine crawlers are not smart enough to find all the",
|
82
|
+
"referenced pages.",
|
83
|
+
"To help them SDoc generates a static file with links to every",
|
84
|
+
"documentation page. This file is not shown to the user."
|
85
|
+
) do |value|
|
86
|
+
options.se_index = false
|
87
|
+
end
|
75
88
|
opt.separator nil
|
76
89
|
end
|
77
90
|
|
@@ -81,8 +94,8 @@ class RDoc::Generator::SDoc
|
|
81
94
|
@options.diagram = false
|
82
95
|
end
|
83
96
|
@github_url_cache = {}
|
84
|
-
|
85
|
-
template = @options.template
|
97
|
+
@options.template = 'direct' if @options.template == 'sdoc'
|
98
|
+
template = @options.template
|
86
99
|
|
87
100
|
templ_dir = self.class.template_dir_for template
|
88
101
|
|
@@ -105,6 +118,7 @@ class RDoc::Generator::SDoc
|
|
105
118
|
generate_file_files
|
106
119
|
generate_class_files
|
107
120
|
generate_index_file
|
121
|
+
generate_se_index if @options.se_index
|
108
122
|
end
|
109
123
|
|
110
124
|
def class_dir
|
@@ -231,14 +245,14 @@ class RDoc::Generator::SDoc
|
|
231
245
|
|
232
246
|
list = @classes.map do |klass|
|
233
247
|
klass.method_list
|
234
|
-
end.flatten.sort do |a, b|
|
235
|
-
a.name == b.name ?
|
236
|
-
a.parent.full_name <=> b.parent.full_name :
|
237
|
-
a.name <=> b.name
|
248
|
+
end.flatten.sort do |a, b|
|
249
|
+
a.name == b.name ?
|
250
|
+
a.parent.full_name <=> b.parent.full_name :
|
251
|
+
a.name <=> b.name
|
238
252
|
end.select do |method|
|
239
253
|
method.document_self
|
240
|
-
end.find_all do |m|
|
241
|
-
m.visibility == :public || m.visibility == :protected ||
|
254
|
+
end.find_all do |m|
|
255
|
+
m.visibility == :public || m.visibility == :protected ||
|
242
256
|
m.force_documentation
|
243
257
|
end
|
244
258
|
|
@@ -299,7 +313,16 @@ class RDoc::Generator::SDoc
|
|
299
313
|
debug_msg "Generating index file in #@outputdir"
|
300
314
|
templatefile = @template_dir + 'index.rhtml'
|
301
315
|
outfile = @outputdir + 'index.html'
|
302
|
-
index_path
|
316
|
+
index_path = index_file.path
|
317
|
+
|
318
|
+
self.render_template( templatefile, binding(), outfile )
|
319
|
+
end
|
320
|
+
|
321
|
+
### Generate file with links for the search engine
|
322
|
+
def generate_se_index
|
323
|
+
debug_msg "Generating search engine index in #@outputdir"
|
324
|
+
templatefile = @template_dir + 'se_index.rhtml'
|
325
|
+
outfile = @outputdir + 'panel/links.html'
|
303
326
|
|
304
327
|
self.render_template( templatefile, binding(), outfile )
|
305
328
|
end
|
@@ -158,7 +158,7 @@
|
|
158
158
|
| <a href="<%= "#{github}#L#{line}" %>" target="_blank" class="github_url">on GitHub</a>
|
159
159
|
<% end end %>
|
160
160
|
</p>
|
161
|
-
<div id="<%= method.aref %>_source" class="dyn-source">
|
161
|
+
<div id="<%= method.aref %>_source" class="dyn-source x">
|
162
162
|
<pre><%= method.markup_code %></pre>
|
163
163
|
</div>
|
164
164
|
</div>
|
@@ -0,0 +1,7 @@
|
|
1
|
+
<link rel="stylesheet" href="<%= "#{rel_prefix}/css/reset.css" %>" type="text/css" media="screen" />
|
2
|
+
<link rel="stylesheet" href="<%= "#{rel_prefix}/css/main.css" %>" type="text/css" media="screen" />
|
3
|
+
<link rel="stylesheet" href="<%= "#{rel_prefix}/css/github.css" %>" type="text/css" media="screen" />
|
4
|
+
<script src="<%= "#{rel_prefix}/js/jquery-1.3.2.min.js" %>" type="text/javascript" charset="utf-8"></script>
|
5
|
+
<script src="<%= "#{rel_prefix}/js/jquery-effect.js" %>" type="text/javascript" charset="utf-8"></script>
|
6
|
+
<script src="<%= "#{rel_prefix}/js/main.js" %>" type="text/javascript" charset="utf-8"></script>
|
7
|
+
<script src="<%= "#{rel_prefix}/js/highlight.pack.js" %>" type="text/javascript" charset="utf-8"></script>
|
@@ -5,15 +5,14 @@
|
|
5
5
|
<head>
|
6
6
|
<title><%= h klass.full_name %></title>
|
7
7
|
<meta http-equiv="Content-Type" content="text/html; charset=<%= @options.charset %>" />
|
8
|
-
|
9
|
-
<link rel="stylesheet" href="<%= "#{rel_prefix}/css/main.css" %>" type="text/css" media="screen" />
|
10
|
-
<script src="<%= "#{rel_prefix}/js/jquery-1.3.2.min.js" %>" type="text/javascript" charset="utf-8"></script>
|
11
|
-
<script src="<%= "#{rel_prefix}/js/jquery-effect.js" %>" type="text/javascript" charset="utf-8"></script>
|
12
|
-
<script src="<%= "#{rel_prefix}/js/main.js" %>" type="text/javascript" charset="utf-8"></script>
|
8
|
+
<%= include_template '_head.rhtml', {:rel_prefix => rel_prefix} %>
|
13
9
|
</head>
|
14
10
|
|
15
11
|
<body>
|
16
12
|
<div class="banner">
|
13
|
+
<% if ENV['HORO_PROJECT_NAME'] %>
|
14
|
+
<span><%= ERB::Util.html_escape(ENV['HORO_PROJECT_NAME']) %> <%= ERB::Util.html_escape(ENV['HORO_PROJECT_VERSION']) %></span><br />
|
15
|
+
<% end %>
|
17
16
|
<h1>
|
18
17
|
<span class="type"><%= klass.module? ? 'Module' : 'Class' %></span>
|
19
18
|
<%= h klass.full_name %>
|
@@ -5,15 +5,14 @@
|
|
5
5
|
<head>
|
6
6
|
<title><%= h file.name %></title>
|
7
7
|
<meta http-equiv="Content-Type" content="text/html; charset=<%= @options.charset %>" />
|
8
|
-
|
9
|
-
<link rel="stylesheet" href="<%= "#{rel_prefix}/css/main.css" %>" type="text/css" media="screen" />
|
10
|
-
<script src="<%= "#{rel_prefix}/js/jquery-1.3.2.min.js" %>" type="text/javascript" charset="utf-8"></script>
|
11
|
-
<script src="<%= "#{rel_prefix}/js/jquery-effect.js" %>" type="text/javascript" charset="utf-8"></script>
|
12
|
-
<script src="<%= "#{rel_prefix}/js/main.js" %>" type="text/javascript" charset="utf-8"></script>
|
8
|
+
<%= include_template '_head.rhtml', {:rel_prefix => rel_prefix} %>
|
13
9
|
</head>
|
14
10
|
|
15
11
|
<body>
|
16
12
|
<div class="banner">
|
13
|
+
<% if ENV['HORO_PROJECT_NAME'] %>
|
14
|
+
<span><%= ERB::Util.html_escape(ENV['HORO_PROJECT_NAME']) %> <%= ERB::Util.html_escape(ENV['HORO_PROJECT_VERSION']) %></span><br />
|
15
|
+
<% end %>
|
17
16
|
<h1>
|
18
17
|
<%= h file.name %>
|
19
18
|
</h1>
|
@@ -4,8 +4,7 @@
|
|
4
4
|
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
5
5
|
<head>
|
6
6
|
<meta http-equiv="Content-Type" content="text/html; charset=<%= @options.charset %>" />
|
7
|
-
|
8
|
-
<title><%= @options.title %></title>
|
7
|
+
<title><%= @options.title %></title>
|
9
8
|
</head>
|
10
9
|
<frameset cols="300,*" frameborder="1" border="1" bordercolor="#666666" framespacing="1">
|
11
10
|
<frame src="panel/index.html" title="Search" name="panel" />
|
@@ -0,0 +1,129 @@
|
|
1
|
+
/*
|
2
|
+
|
3
|
+
github.com style (c) Vasily Polovnyov <vast@whiteants.net>
|
4
|
+
|
5
|
+
*/
|
6
|
+
|
7
|
+
pre code {
|
8
|
+
display: block; padding: 0.5em;
|
9
|
+
color: #000;
|
10
|
+
background: #f8f8ff
|
11
|
+
}
|
12
|
+
|
13
|
+
pre .comment,
|
14
|
+
pre .template_comment,
|
15
|
+
pre .diff .header,
|
16
|
+
pre .javadoc {
|
17
|
+
color: #998;
|
18
|
+
font-style: italic
|
19
|
+
}
|
20
|
+
|
21
|
+
pre .keyword,
|
22
|
+
pre .css .rule .keyword,
|
23
|
+
pre .winutils,
|
24
|
+
pre .javascript .title,
|
25
|
+
pre .lisp .title,
|
26
|
+
pre .subst {
|
27
|
+
color: #000;
|
28
|
+
font-weight: bold
|
29
|
+
}
|
30
|
+
|
31
|
+
pre .number,
|
32
|
+
pre .hexcolor {
|
33
|
+
color: #40a070
|
34
|
+
}
|
35
|
+
|
36
|
+
pre .string,
|
37
|
+
pre .tag .value,
|
38
|
+
pre .phpdoc,
|
39
|
+
pre .tex .formula {
|
40
|
+
color: #d14
|
41
|
+
}
|
42
|
+
|
43
|
+
pre .title,
|
44
|
+
pre .id {
|
45
|
+
color: #900;
|
46
|
+
font-weight: bold
|
47
|
+
}
|
48
|
+
|
49
|
+
pre .javascript .title,
|
50
|
+
pre .lisp .title,
|
51
|
+
pre .subst {
|
52
|
+
font-weight: normal
|
53
|
+
}
|
54
|
+
|
55
|
+
pre .class .title,
|
56
|
+
pre .haskell .label,
|
57
|
+
pre .tex .command {
|
58
|
+
color: #458;
|
59
|
+
font-weight: bold
|
60
|
+
}
|
61
|
+
|
62
|
+
pre .tag,
|
63
|
+
pre .tag .title,
|
64
|
+
pre .rules .property,
|
65
|
+
pre .django .tag .keyword {
|
66
|
+
color: #000080;
|
67
|
+
font-weight: normal
|
68
|
+
}
|
69
|
+
|
70
|
+
pre .attribute,
|
71
|
+
pre .variable,
|
72
|
+
pre .instancevar,
|
73
|
+
pre .lisp .body {
|
74
|
+
color: #008080
|
75
|
+
}
|
76
|
+
|
77
|
+
pre .regexp {
|
78
|
+
color: #009926
|
79
|
+
}
|
80
|
+
|
81
|
+
pre .class {
|
82
|
+
color: #458;
|
83
|
+
font-weight: bold
|
84
|
+
}
|
85
|
+
|
86
|
+
pre .symbol,
|
87
|
+
pre .ruby .symbol .string,
|
88
|
+
pre .ruby .symbol .keyword,
|
89
|
+
pre .ruby .symbol .keymethods,
|
90
|
+
pre .lisp .keyword,
|
91
|
+
pre .tex .special,
|
92
|
+
pre .input_number {
|
93
|
+
color: #990073
|
94
|
+
}
|
95
|
+
|
96
|
+
pre .builtin,
|
97
|
+
pre .built_in,
|
98
|
+
pre .lisp .title {
|
99
|
+
color: #0086b3
|
100
|
+
}
|
101
|
+
|
102
|
+
pre .preprocessor,
|
103
|
+
pre .pi,
|
104
|
+
pre .doctype,
|
105
|
+
pre .shebang,
|
106
|
+
pre .cdata {
|
107
|
+
color: #999;
|
108
|
+
font-weight: bold
|
109
|
+
}
|
110
|
+
|
111
|
+
pre .deletion {
|
112
|
+
background: #fdd
|
113
|
+
}
|
114
|
+
|
115
|
+
pre .addition {
|
116
|
+
background: #dfd
|
117
|
+
}
|
118
|
+
|
119
|
+
pre .diff .change {
|
120
|
+
background: #0086b3
|
121
|
+
}
|
122
|
+
|
123
|
+
pre .chunk {
|
124
|
+
color: #aaa
|
125
|
+
}
|
126
|
+
|
127
|
+
pre .tex .formula {
|
128
|
+
opacity: 0.5;
|
129
|
+
}
|
@@ -0,0 +1 @@
|
|
1
|
+
var hljs=new function(){function l(o){return o.replace(/&/gm,"&").replace(/</gm,"<")}function c(q,p,o){return RegExp(p,"m"+(q.cI?"i":"")+(o?"g":""))}function i(q){for(var o=0;o<q.childNodes.length;o++){var p=q.childNodes[o];if(p.nodeName=="CODE"){return p}if(!(p.nodeType==3&&p.nodeValue.match(/\s+/))){break}}}function g(s,r){var q="";for(var p=0;p<s.childNodes.length;p++){if(s.childNodes[p].nodeType==3){var o=s.childNodes[p].nodeValue;if(r){o=o.replace(/\n/g,"")}q+=o}else{if(s.childNodes[p].nodeName=="BR"){q+="\n"}else{q+=g(s.childNodes[p])}}}if(/MSIE [678]/.test(navigator.userAgent)){q=q.replace(/\r/g,"\n")}return q}function a(r){var p=r.className.split(/\s+/);p=p.concat(r.parentNode.className.split(/\s+/));for(var o=0;o<p.length;o++){var q=p[o].replace(/^language-/,"");if(d[q]||q=="no-highlight"){return q}}}function b(o){var p=[];(function(r,s){for(var q=0;q<r.childNodes.length;q++){if(r.childNodes[q].nodeType==3){s+=r.childNodes[q].nodeValue.length}else{if(r.childNodes[q].nodeName=="BR"){s+=1}else{p.push({event:"start",offset:s,node:r.childNodes[q]});s=arguments.callee(r.childNodes[q],s);p.push({event:"stop",offset:s,node:r.childNodes[q]})}}}return s})(o,0);return p}function k(x,y,w){var q=0;var v="";var s=[];function t(){if(x.length&&y.length){if(x[0].offset!=y[0].offset){return(x[0].offset<y[0].offset)?x:y}else{return y[0].event=="start"?x:y}}else{return x.length?x:y}}function r(B){var C="<"+B.nodeName.toLowerCase();for(var z=0;z<B.attributes.length;z++){var A=B.attributes[z];C+=" "+A.nodeName.toLowerCase();if(A.nodeValue!=undefined){C+='="'+l(A.nodeValue)+'"'}}return C+">"}while(x.length||y.length){var u=t().splice(0,1)[0];v+=l(w.substr(q,u.offset-q));q=u.offset;if(u.event=="start"){v+=r(u.node);s.push(u.node)}else{if(u.event=="stop"){var p=s.length;do{p--;var o=s[p];v+=("</"+o.nodeName.toLowerCase()+">")}while(o!=u.node);s.splice(p,1);while(p<s.length){v+=r(s[p]);p++}}}}v+=w.substr(q);return v}function f(I,C){function y(r,L){for(var K=0;K<L.c.length;K++){if(L.c[K].bR.test(r)){return L.c[K]}}}function v(K,r){if(B[K].e&&B[K].eR.test(r)){return 1}if(B[K].eW){var L=v(K-1,r);return L?L+1:0}return 0}function w(r,K){return K.iR&&K.iR.test(r)}function z(N,M){var L=[];for(var K=0;K<N.c.length;K++){L.push(N.c[K].b)}var r=B.length-1;do{if(B[r].e){L.push(B[r].e)}r--}while(B[r+1].eW);if(N.i){L.push(N.i)}return c(M,"("+L.join("|")+")",true)}function q(L,K){var M=B[B.length-1];if(!M.t){M.t=z(M,G)}M.t.lastIndex=K;var r=M.t.exec(L);if(r){return[L.substr(K,r.index-K),r[0],false]}else{return[L.substr(K),"",true]}}function o(N,r){var K=G.cI?r[0].toLowerCase():r[0];for(var M in N.kG){if(!N.kG.hasOwnProperty(M)){continue}var L=N.kG[M].hasOwnProperty(K);if(L){return[M,L]}}return false}function E(L,N){if(!N.k){return l(L)}var M="";var O=0;N.lR.lastIndex=0;var K=N.lR.exec(L);while(K){M+=l(L.substr(O,K.index-O));var r=o(N,K);if(r){s+=r[1];M+='<span class="'+r[0]+'">'+l(K[0])+"</span>"}else{M+=l(K[0])}O=N.lR.lastIndex;K=N.lR.exec(L)}M+=l(L.substr(O,L.length-O));return M}function J(r,L){if(L.sL&&d[L.sL]){var K=f(L.sL,r);s+=K.keyword_count;return K.value}else{return E(r,L)}}function H(L,r){var K=L.cN?'<span class="'+L.cN+'">':"";if(L.rB){p+=K;L.buffer=""}else{if(L.eB){p+=l(r)+K;L.buffer=""}else{p+=K;L.buffer=r}}B.push(L);A+=L.r}function D(N,K,P){var Q=B[B.length-1];if(P){p+=J(Q.buffer+N,Q);return false}var L=y(K,Q);if(L){p+=J(Q.buffer+N,Q);H(L,K);return L.rB}var r=v(B.length-1,K);if(r){var M=Q.cN?"</span>":"";if(Q.rE){p+=J(Q.buffer+N,Q)+M}else{if(Q.eE){p+=J(Q.buffer+N,Q)+M+l(K)}else{p+=J(Q.buffer+N+K,Q)+M}}while(r>1){M=B[B.length-2].cN?"</span>":"";p+=M;r--;B.length--}var O=B[B.length-1];B.length--;B[B.length-1].buffer="";if(O.starts){H(O.starts,"")}return Q.rE}if(w(K,Q)){throw"Illegal"}}var G=d[I];var B=[G.dM];var A=0;var s=0;var p="";try{var u=0;G.dM.buffer="";do{var x=q(C,u);var t=D(x[0],x[1],x[2]);u+=x[0].length;if(!t){u+=x[1].length}}while(!x[2]);if(B.length>1){throw"Illegal"}return{language:I,r:A,keyword_count:s,value:p}}catch(F){if(F=="Illegal"){return{language:null,r:0,keyword_count:0,value:l(C)}}else{throw F}}}function h(){function o(t,s,u){if(t.compiled){return}if(!u){t.bR=c(s,t.b?t.b:"\\B|\\b");if(!t.e&&!t.eW){t.e="\\B|\\b"}if(t.e){t.eR=c(s,t.e)}}if(t.i){t.iR=c(s,t.i)}if(t.r==undefined){t.r=1}if(t.k){t.lR=c(s,t.l||hljs.IR,true)}for(var r in t.k){if(!t.k.hasOwnProperty(r)){continue}if(t.k[r] instanceof Object){t.kG=t.k}else{t.kG={keyword:t.k}}break}if(!t.c){t.c=[]}t.compiled=true;for(var q=0;q<t.c.length;q++){o(t.c[q],s,false)}if(t.starts){o(t.starts,s,false)}}for(var p in d){if(!d.hasOwnProperty(p)){continue}o(d[p].dM,d[p],true)}}function e(){if(e.called){return}e.called=true;h()}function n(t,y,p){e();var A=g(t,p);var r=a(t);if(r=="no-highlight"){return}if(r){var w=f(r,A)}else{var w={language:"",keyword_count:0,r:0,value:l(A)};var x=w;for(var z in d){if(!d.hasOwnProperty(z)){continue}var u=f(z,A);if(u.keyword_count+u.r>x.keyword_count+x.r){x=u}if(u.keyword_count+u.r>w.keyword_count+w.r){x=w;w=u}}}var s=t.className;if(!s.match(w.language)){s=s?(s+" "+w.language):w.language}var o=b(t);if(o.length){var q=document.createElement("pre");q.innerHTML=w.value;w.value=k(o,b(q),A)}if(y){w.value=w.value.replace(/^((<[^>]+>|\t)+)/gm,function(B,E,D,C){return E.replace(/\t/g,y)})}if(p){w.value=w.value.replace(/\n/g,"<br>")}if(/MSIE [678]/.test(navigator.userAgent)&&t.tagName=="CODE"&&t.parentNode.tagName=="PRE"){var q=t.parentNode;var v=document.createElement("div");v.innerHTML="<pre><code>"+w.value+"</code></pre>";t=v.firstChild.firstChild;v.firstChild.cN=q.cN;q.parentNode.replaceChild(v.firstChild,q)}else{t.innerHTML=w.value}t.className=s;t.dataset={};t.dataset.result={language:w.language,kw:w.keyword_count,re:w.r};if(x&&x.language){t.dataset.second_best={language:x.language,kw:x.keyword_count,re:x.r}}}function j(){if(j.called){return}j.called=true;e();var q=document.getElementsByTagName("pre");for(var o=0;o<q.length;o++){var p=i(q[o]);if(p){n(p,hljs.tabReplace)}}}function m(){var o=arguments;var p=function(){j.apply(null,o)};if(window.addEventListener){window.addEventListener("DOMContentLoaded",p,false);window.addEventListener("load",p,false)}else{if(window.attachEvent){window.attachEvent("onload",p)}else{window.onload=p}}}var d={};this.LANGUAGES=d;this.initHighlightingOnLoad=m;this.highlightBlock=n;this.initHighlighting=j;this.IR="[a-zA-Z][a-zA-Z0-9_]*";this.UIR="[a-zA-Z_][a-zA-Z0-9_]*";this.NR="\\b\\d+(\\.\\d+)?";this.CNR="\\b(0x[A-Za-z0-9]+|\\d+(\\.\\d+)?)";this.RSR="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|\\.|-|-=|/|/=|:|;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~";this.BE={b:"\\\\.",r:0};this.ASM={cN:"string",b:"'",e:"'",i:"\\n",c:[this.BE],r:0};this.QSM={cN:"string",b:'"',e:'"',i:"\\n",c:[this.BE],r:0};this.CLCM={cN:"comment",b:"//",e:"$"};this.CBLCLM={cN:"comment",b:"/\\*",e:"\\*/"};this.HCM={cN:"comment",b:"#",e:"$"};this.NM={cN:"number",b:this.NR,r:0};this.CNM={cN:"number",b:this.CNR,r:0};this.inherit=function(o,r){var q={};for(var p in o){q[p]=o[p]}if(r){for(var p in r){q[p]=r[p]}}return q}}();hljs.LANGUAGES.ruby=function(){var g="[a-zA-Z_][a-zA-Z0-9_]*(\\!|\\?)?";var a="[a-zA-Z_]\\w*[!?=]?|[-+~]\\@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?";var n={keyword:{and:1,"false":1,then:1,defined:1,module:1,"in":1,"return":1,redo:1,"if":1,BEGIN:1,retry:1,end:1,"for":1,"true":1,self:1,when:1,next:1,until:1,"do":1,begin:1,unless:1,END:1,rescue:1,nil:1,"else":1,"break":1,undef:1,not:1,"super":1,"class":1,"case":1,require:1,yield:1,alias:1,"while":1,ensure:1,elsif:1,or:1,def:1},keymethods:{__id__:1,__send__:1,abort:1,abs:1,"all?":1,allocate:1,ancestors:1,"any?":1,arity:1,assoc:1,at:1,at_exit:1,autoload:1,"autoload?":1,"between?":1,binding:1,binmode:1,"block_given?":1,call:1,callcc:1,caller:1,capitalize:1,"capitalize!":1,casecmp:1,"catch":1,ceil:1,center:1,chomp:1,"chomp!":1,chop:1,"chop!":1,chr:1,"class":1,class_eval:1,"class_variable_defined?":1,class_variables:1,clear:1,clone:1,close:1,close_read:1,close_write:1,"closed?":1,coerce:1,collect:1,"collect!":1,compact:1,"compact!":1,concat:1,"const_defined?":1,const_get:1,const_missing:1,const_set:1,constants:1,count:1,crypt:1,"default":1,default_proc:1,"delete":1,"delete!":1,delete_at:1,delete_if:1,detect:1,display:1,div:1,divmod:1,downcase:1,"downcase!":1,downto:1,dump:1,dup:1,each:1,each_byte:1,each_index:1,each_key:1,each_line:1,each_pair:1,each_value:1,each_with_index:1,"empty?":1,entries:1,eof:1,"eof?":1,"eql?":1,"equal?":1,"eval":1,exec:1,exit:1,"exit!":1,extend:1,fail:1,fcntl:1,fetch:1,fileno:1,fill:1,find:1,find_all:1,first:1,flatten:1,"flatten!":1,floor:1,flush:1,for_fd:1,foreach:1,fork:1,format:1,freeze:1,"frozen?":1,fsync:1,getc:1,gets:1,global_variables:1,grep:1,gsub:1,"gsub!":1,"has_key?":1,"has_value?":1,hash:1,hex:1,id:1,include:1,"include?":1,included_modules:1,index:1,indexes:1,indices:1,induced_from:1,inject:1,insert:1,inspect:1,instance_eval:1,instance_method:1,instance_methods:1,"instance_of?":1,"instance_variable_defined?":1,instance_variable_get:1,instance_variable_set:1,instance_variables:1,"integer?":1,intern:1,invert:1,ioctl:1,"is_a?":1,isatty:1,"iterator?":1,join:1,"key?":1,keys:1,"kind_of?":1,lambda:1,last:1,length:1,lineno:1,ljust:1,load:1,local_variables:1,loop:1,lstrip:1,"lstrip!":1,map:1,"map!":1,match:1,max:1,"member?":1,merge:1,"merge!":1,method:1,"method_defined?":1,method_missing:1,methods:1,min:1,module_eval:1,modulo:1,name:1,nesting:1,"new":1,next:1,"next!":1,"nil?":1,nitems:1,"nonzero?":1,object_id:1,oct:1,open:1,pack:1,partition:1,pid:1,pipe:1,pop:1,popen:1,pos:1,prec:1,prec_f:1,prec_i:1,print:1,printf:1,private_class_method:1,private_instance_methods:1,"private_method_defined?":1,private_methods:1,proc:1,protected_instance_methods:1,"protected_method_defined?":1,protected_methods:1,public_class_method:1,public_instance_methods:1,"public_method_defined?":1,public_methods:1,push:1,putc:1,puts:1,quo:1,raise:1,rand:1,rassoc:1,read:1,read_nonblock:1,readchar:1,readline:1,readlines:1,readpartial:1,rehash:1,reject:1,"reject!":1,remainder:1,reopen:1,replace:1,require:1,"respond_to?":1,reverse:1,"reverse!":1,reverse_each:1,rewind:1,rindex:1,rjust:1,round:1,rstrip:1,"rstrip!":1,scan:1,seek:1,select:1,send:1,set_trace_func:1,shift:1,singleton_method_added:1,singleton_methods:1,size:1,sleep:1,slice:1,"slice!":1,sort:1,"sort!":1,sort_by:1,split:1,sprintf:1,squeeze:1,"squeeze!":1,srand:1,stat:1,step:1,store:1,strip:1,"strip!":1,sub:1,"sub!":1,succ:1,"succ!":1,sum:1,superclass:1,swapcase:1,"swapcase!":1,sync:1,syscall:1,sysopen:1,sysread:1,sysseek:1,system:1,syswrite:1,taint:1,"tainted?":1,tell:1,test:1,"throw":1,times:1,to_a:1,to_ary:1,to_f:1,to_hash:1,to_i:1,to_int:1,to_io:1,to_proc:1,to_s:1,to_str:1,to_sym:1,tr:1,"tr!":1,tr_s:1,"tr_s!":1,trace_var:1,transpose:1,trap:1,truncate:1,"tty?":1,type:1,ungetc:1,uniq:1,"uniq!":1,unpack:1,unshift:1,untaint:1,untrace_var:1,upcase:1,"upcase!":1,update:1,upto:1,"value?":1,values:1,values_at:1,warn:1,write:1,write_nonblock:1,"zero?":1,zip:1}};var h={cN:"yardoctag",b:"@[A-Za-z]+"};var d={cN:"comment",b:"#",e:"$",c:[h]};var c={cN:"comment",b:"^\\=begin",e:"^\\=end",c:[h],r:10};var b={cN:"comment",b:"^__END__",e:"\\n$"};var u={cN:"subst",b:"#\\{",e:"}",l:g,k:n};var p=[hljs.BE,u];var s={cN:"string",b:"'",e:"'",c:p,r:0};var r={cN:"string",b:'"',e:'"',c:p,r:0};var q={cN:"string",b:"%[qw]?\\(",e:"\\)",c:p,r:10};var o={cN:"string",b:"%[qw]?\\[",e:"\\]",c:p,r:10};var m={cN:"string",b:"%[qw]?{",e:"}",c:p,r:10};var l={cN:"string",b:"%[qw]?<",e:">",c:p,r:10};var k={cN:"string",b:"%[qw]?/",e:"/",c:p,r:10};var j={cN:"string",b:"%[qw]?%",e:"%",c:p,r:10};var i={cN:"string",b:"%[qw]?-",e:"-",c:p,r:10};var t={cN:"string",b:"%[qw]?\\|",e:"\\|",c:p,r:10};var e={cN:"function",b:"\\bdef\\s+",e:" |$|;",l:g,k:n,c:[{cN:"title",b:a,l:g,k:n},{cN:"params",b:"\\(",e:"\\)",l:g,k:n},d,c,b]};var f={cN:"identifier",b:g,l:g,k:n,r:0};var v=[d,c,b,s,r,q,o,m,l,k,j,i,t,{cN:"class",b:"\\b(class|module)\\b",e:"$|;",k:{"class":1,module:1},c:[{cN:"title",b:"[A-Za-z_]\\w*(::\\w+)*(\\?|\\!)?",r:0},{cN:"inheritance",b:"<\\s*",c:[{cN:"parent",b:"("+hljs.IR+"::)?"+hljs.IR}]},d,c,b]},e,{cN:"constant",b:"(::)?([A-Z]\\w*(::)?)+",r:0},{cN:"symbol",b:":",c:[s,r,q,o,m,l,k,j,i,t,f],r:0},{cN:"number",b:"(\\b0[0-7_]+)|(\\b0x[0-9a-fA-F_]+)|(\\b[1-9][0-9_]*(\\.[0-9_]+)?)|[0_]\\b",r:0},{cN:"number",b:"\\?\\w"},{cN:"variable",b:"(\\$\\W)|((\\$|\\@\\@?)(\\w+))"},f,{b:"("+hljs.RSR+")\\s*",c:[d,c,b,{cN:"regexp",b:"/",e:"/[a-z]*",i:"\\n",c:[hljs.BE]}],r:0}];u.c=v;e.c[1].c=v;return{dM:{l:g,k:n,c:v}}}();hljs.LANGUAGES.javascript={dM:{k:{keyword:{"in":1,"if":1,"for":1,"while":1,"finally":1,"var":1,"new":1,"function":1,"do":1,"return":1,"void":1,"else":1,"break":1,"catch":1,"instanceof":1,"with":1,"throw":1,"case":1,"default":1,"try":1,"this":1,"switch":1,"continue":1,"typeof":1,"delete":1},literal:{"true":1,"false":1,"null":1}},c:[hljs.ASM,hljs.QSM,hljs.CLCM,hljs.CBLCLM,hljs.CNM,{b:"("+hljs.RSR+"|case|return|throw)\\s*",k:{"return":1,"throw":1,"case":1},c:[hljs.CLCM,hljs.CBLCLM,{cN:"regexp",b:"/.*?[^\\\\/]/[gim]*"}],r:0},{cN:"function",b:"\\bfunction\\b",e:"{",k:{"function":1},c:[{cN:"title",b:"[A-Za-z$_][0-9A-Za-z$_]*"},{cN:"params",b:"\\(",e:"\\)",c:[hljs.ASM,hljs.QSM,hljs.CLCM,hljs.CBLCLM]}]}]}};hljs.LANGUAGES.css=function(){var a={cN:"function",b:hljs.IR+"\\(",e:"\\)",c:[{eW:true,eE:true,c:[hljs.NM,hljs.ASM,hljs.QSM]}]};return{cI:true,dM:{i:"[=/|']",c:[hljs.CBLCLM,{cN:"id",b:"\\#[A-Za-z0-9_-]+"},{cN:"class",b:"\\.[A-Za-z0-9_-]+",r:0},{cN:"attr_selector",b:"\\[",e:"\\]",i:"$"},{cN:"pseudo",b:":(:)?[a-zA-Z0-9\\_\\-\\+\\(\\)\\\"\\']+"},{cN:"at_rule",b:"@font-face",l:"[a-z-]+",k:{"font-face":1}},{cN:"at_rule",b:"@",e:"[{;]",eE:true,k:{"import":1,page:1,media:1,charset:1},c:[a,hljs.ASM,hljs.QSM,hljs.NM]},{cN:"tag",b:hljs.IR,r:0},{cN:"rules",b:"{",e:"}",i:"[^\\s]",r:0,c:[hljs.CBLCLM,{cN:"rule",b:"[^\\s]",rB:true,e:";",eW:true,c:[{cN:"attribute",b:"[A-Z\\_\\.\\-]+",e:":",eE:true,i:"[^\\s]",starts:{cN:"value",eW:true,eE:true,c:[a,hljs.NM,hljs.QSM,hljs.ASM,hljs.CBLCLM,{cN:"hexcolor",b:"\\#[0-9A-F]+"},{cN:"important",b:"!important"}]}}]}]}]}}}();hljs.LANGUAGES.xml=function(){var b="[A-Za-z0-9\\._:-]+";var a={eW:true,c:[{cN:"attribute",b:b,r:0},{b:'="',rB:true,e:'"',c:[{cN:"value",b:'"',eW:true}]},{b:"='",rB:true,e:"'",c:[{cN:"value",b:"'",eW:true}]},{b:"=",c:[{cN:"value",b:"[^\\s/>]+"}]}]};return{cI:true,dM:{c:[{cN:"pi",b:"<\\?",e:"\\?>",r:10},{cN:"doctype",b:"<!DOCTYPE",e:">",r:10},{cN:"comment",b:"<!--",e:"-->",r:10},{cN:"cdata",b:"<\\!\\[CDATA\\[",e:"\\]\\]>",r:10},{cN:"tag",b:"<style",e:">",k:{title:{style:1}},c:[a],starts:{cN:"css",e:"</style>",rE:true,sL:"css"}},{cN:"tag",b:"<script",e:">",k:{title:{script:1}},c:[a],starts:{cN:"javascript",e:"<\/script>",rE:true,sL:"javascript"}},{cN:"vbscript",b:"<%",e:"%>",sL:"vbscript"},{cN:"tag",b:"</?",e:"/?>",c:[{cN:"title",b:"[^ />]+"},a]}]}}}();hljs.LANGUAGES.cpp=function(){var b={keyword:{"false":1,"int":1,"float":1,"while":1,"private":1,"char":1,"catch":1,"export":1,virtual:1,operator:2,sizeof:2,dynamic_cast:2,typedef:2,const_cast:2,"const":1,struct:1,"for":1,static_cast:2,union:1,namespace:1,unsigned:1,"long":1,"throw":1,"volatile":2,"static":1,"protected":1,bool:1,template:1,mutable:1,"if":1,"public":1,friend:2,"do":1,"return":1,"goto":1,auto:1,"void":2,"enum":1,"else":1,"break":1,"new":1,extern:1,using:1,"true":1,"class":1,asm:1,"case":1,typeid:1,"short":1,reinterpret_cast:2,"default":1,"double":1,register:1,explicit:1,signed:1,typename:1,"try":1,"this":1,"switch":1,"continue":1,wchar_t:1,inline:1,"delete":1,alignof:1,char16_t:1,char32_t:1,constexpr:1,decltype:1,noexcept:1,nullptr:1,static_assert:1,thread_local:1},built_in:{std:1,string:1,cin:1,cout:1,cerr:1,clog:1,stringstream:1,istringstream:1,ostringstream:1,auto_ptr:1,deque:1,list:1,queue:1,stack:1,vector:1,map:1,set:1,bitset:1,multiset:1,multimap:1,unordered_set:1,unordered_map:1,unordered_multiset:1,unordered_multimap:1,array:1,shared_ptr:1}};var a={cN:"stl_container",b:"\\b(deque|list|queue|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array)\\s*<",e:">",k:b.built_in,r:10};a.c=[a];return{dM:{k:b,i:"</",c:[hljs.CLCM,hljs.CBLCLM,hljs.QSM,{cN:"string",b:"'",e:"[^\\\\]'",i:"[^\\\\][^']"},hljs.CNM,{cN:"preprocessor",b:"#",e:"$"},a]}}}();
|
@@ -1,22 +1,24 @@
|
|
1
1
|
function toggleSource( id )
|
2
2
|
{
|
3
|
-
var
|
4
|
-
|
3
|
+
var src = $('#' + id).toggle();
|
4
|
+
var isVisible = src.is(':visible');
|
5
|
+
$('#l_' + id).html(isVisible ? 'hide' : 'show');
|
6
|
+
if (!src.data('syntax-higlighted')) {
|
7
|
+
src.data('syntax-higlighted', 1);
|
8
|
+
hljs.highlightBlock(src[0]);
|
9
|
+
}
|
5
10
|
}
|
6
11
|
|
7
|
-
function openCode( url )
|
8
|
-
{
|
9
|
-
window.open( url, "SOURCE_CODE", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=480,width=750" ).focus();
|
10
|
-
}
|
11
|
-
|
12
|
-
|
13
12
|
window.highlight = function(url) {
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
13
|
+
var hash = url.match(/#([^#]+)$/)
|
14
|
+
if(hash) {
|
15
|
+
$('a[name=' + hash[1] + ']').parent().effect('highlight', {}, 'slow')
|
16
|
+
}
|
18
17
|
}
|
19
18
|
|
20
19
|
$(function() {
|
21
|
-
|
20
|
+
highlight('#' + location.hash);
|
21
|
+
$('.description pre').each(function() {
|
22
|
+
hljs.highlightBlock(this);
|
23
|
+
});
|
22
24
|
});
|
@@ -4,7 +4,7 @@
|
|
4
4
|
|
5
5
|
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
|
6
6
|
<head>
|
7
|
-
<title>
|
7
|
+
<title>search index</title>
|
8
8
|
<link rel="stylesheet" href="../css/reset.css" type="text/css" media="screen" charset="utf-8" />
|
9
9
|
<link rel="stylesheet" href="../css/panel.css" type="text/css" media="screen" charset="utf-8" />
|
10
10
|
<script src="search_index.js" type="text/javascript" charset="utf-8"></script>
|
@@ -12,39 +12,39 @@
|
|
12
12
|
<script src="../js/jquery-1.3.2.min.js" type="text/javascript" charset="utf-8"></script>
|
13
13
|
<script src="../js/searchdoc.js" type="text/javascript" charset="utf-8"></script>
|
14
14
|
<script type="text/javascript" charset="utf-8">
|
15
|
-
|
16
|
-
|
17
|
-
if (jQuery.browser.safari) return;
|
18
|
-
$('#search-label').click(function() {
|
19
|
-
$('#search').focus();
|
20
|
-
$('#search-label').hide();
|
21
|
-
});
|
15
|
+
function placeholder() {
|
16
|
+
if ($('<input type="text">')[0].placeholder !== undefined) return;
|
22
17
|
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
this.value == '' && $('#search-label').show()
|
28
|
-
});
|
18
|
+
$('#search-label').click(function() {
|
19
|
+
$('#search').focus();
|
20
|
+
$('#search-label').hide();
|
21
|
+
});
|
29
22
|
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
23
|
+
$('#search').focus(function() {
|
24
|
+
$('#search-label').hide();
|
25
|
+
});
|
26
|
+
$('#search').blur(function() {
|
27
|
+
this.value == '' && $('#search-label').show()
|
28
|
+
});
|
36
29
|
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
30
|
+
$('#search')[0].value == '' && $('#search-label').show();
|
31
|
+
}
|
32
|
+
$(function() {
|
33
|
+
placeholder();
|
34
|
+
$('#links').hide();
|
35
|
+
var panel = new Searchdoc.Panel($('#panel'), search_data, tree, top.frames[1]);
|
36
|
+
$('#search').focus();
|
37
|
+
|
38
|
+
var s = window.parent.location.search.match(/\?q=([^&]+)/);
|
39
|
+
if (s) {
|
40
|
+
s = decodeURIComponent(s[1]).replace(/\+/g, ' ');
|
41
|
+
if (s.length > 0)
|
42
|
+
{
|
43
|
+
$('#search').val(s);
|
44
|
+
panel.search(s, true);
|
45
|
+
}
|
46
|
+
}
|
47
|
+
})
|
48
48
|
</script>
|
49
49
|
</head>
|
50
50
|
<body>
|
@@ -67,5 +67,6 @@
|
|
67
67
|
</ul>
|
68
68
|
</div>
|
69
69
|
</div>
|
70
|
+
<a href="links.html" id="links">index</a>
|
70
71
|
</body>
|
71
72
|
</html>
|
data/sdoc.gemspec
CHANGED
@@ -2,11 +2,11 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = "sdoc"
|
5
|
-
s.version = "0.3.
|
5
|
+
s.version = "0.3.1"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = ["Vladimir Kolesnikov"]
|
9
|
-
s.date = %q{
|
9
|
+
s.date = %q{2011-09-24}
|
10
10
|
s.description = %q{rdoc generator html with javascript search index.}
|
11
11
|
s.summary = %q{rdoc html with javascript search index.}
|
12
12
|
s.homepage = %q{http://github.com/voloko/sdoc}
|