sdoc 1.0.0.rc1 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.gitignore +1 -1
- data/.travis.yml +15 -11
- data/CHANGELOG.md +24 -0
- data/Gemfile +1 -1
- data/LICENSE +2 -1
- data/README.md +15 -5
- data/Rakefile +1 -2
- data/bin/sdoc +1 -1
- data/bin/sdoc-merge +1 -1
- data/lib/rdoc/discover.rb +1 -1
- data/lib/rdoc/generator/template/merge/index.rhtml +3 -5
- data/lib/rdoc/generator/template/rails/_context.rhtml +216 -0
- data/lib/rdoc/generator/template/rails/_head.rhtml +39 -0
- data/lib/rdoc/generator/template/rails/_panel.rhtml +14 -0
- data/lib/rdoc/generator/template/rails/class.rhtml +54 -0
- data/lib/rdoc/generator/template/rails/file.rhtml +38 -0
- data/lib/rdoc/generator/template/rails/index.rhtml +33 -0
- data/lib/rdoc/generator/template/rails/resources/apple-touch-icon.png +0 -0
- data/lib/rdoc/generator/template/rails/resources/css/github.css +123 -0
- data/lib/rdoc/generator/template/rails/resources/css/main.css +378 -0
- data/lib/rdoc/generator/template/rails/resources/css/panel.css +365 -0
- data/lib/rdoc/generator/template/rails/resources/css/reset.css +48 -0
- data/lib/rdoc/generator/template/rails/resources/favicon.ico +0 -0
- data/lib/rdoc/generator/template/rails/resources/i/arrow-down.svg +8 -0
- data/lib/rdoc/generator/template/rails/resources/i/arrow-right.svg +8 -0
- data/lib/rdoc/generator/template/rails/resources/i/search.svg +12 -0
- data/lib/rdoc/generator/template/rails/resources/i/tree_bg.svg +8 -0
- data/lib/rdoc/generator/template/rails/resources/js/highlight.pack.js +1 -0
- data/lib/rdoc/generator/template/rails/resources/js/jquery-3.5.1.min.js +2 -0
- data/lib/rdoc/generator/template/rails/resources/js/main.js +41 -0
- data/lib/rdoc/generator/template/rails/resources/js/searchdoc.js +484 -0
- data/lib/rdoc/generator/template/rails/resources/js/turbolinks.js +6 -0
- data/lib/rdoc/generator/template/rails/search_index.rhtml +8 -0
- data/lib/rdoc/generator/template/sdoc/_context.rhtml +5 -5
- data/lib/rdoc/generator/template/sdoc/_head.rhtml +0 -1
- data/lib/rdoc/generator/template/sdoc/class.rhtml +13 -0
- data/lib/rdoc/generator/template/sdoc/file.rhtml +0 -0
- data/lib/rdoc/generator/template/sdoc/index.rhtml +0 -0
- data/lib/rdoc/generator/template/sdoc/resources/css/main.css +11 -1
- data/lib/rdoc/generator/template/sdoc/resources/css/panel.css +0 -0
- data/lib/rdoc/generator/template/sdoc/resources/css/reset.css +0 -0
- data/lib/rdoc/generator/template/sdoc/resources/i/arrows.png +0 -0
- data/lib/rdoc/generator/template/sdoc/resources/i/results_bg.png +0 -0
- data/lib/rdoc/generator/template/sdoc/resources/i/tree_bg.png +0 -0
- data/lib/rdoc/generator/template/sdoc/resources/js/highlight.pack.js +0 -0
- data/lib/rdoc/generator/template/sdoc/resources/js/jquery-1.3.2.min.js +0 -0
- data/lib/rdoc/generator/template/sdoc/resources/js/main.js +7 -1
- data/lib/rdoc/generator/template/sdoc/resources/js/searchdoc.js +21 -2
- data/lib/rdoc/generator/template/sdoc/resources/panel/index.html +2 -6
- data/lib/sdoc.rb +0 -2
- data/lib/sdoc/generator.rb +65 -212
- data/lib/sdoc/github.rb +13 -14
- data/lib/sdoc/helpers.rb +22 -0
- data/lib/sdoc/templatable.rb +5 -1
- data/lib/sdoc/version.rb +1 -1
- data/sdoc.gemspec +1 -1
- data/spec/helpers_spec.rb +32 -0
- data/spec/rdoc_generator_spec.rb +5 -19
- data/spec/spec_helper.rb +0 -3
- metadata +15 -15
- data/lib/rdoc/generator/template/sdoc/resources/js/jquery-effect.js +0 -593
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: b0a5ef96afe19af3c04df6786dd1f19d1e1e90095b1f70bcb46f83ff112d878b
|
4
|
+
data.tar.gz: 58e3d4872fdbaa31b38dfb5ce3b6d0ea4068997865abba32bf1f4abadb840ab6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0b97b7813e587ac4c281521f1616c522762618071f473ea485f9eae66a3d10578899ce92fe2ec086d83bd9716265e1fea15b8ea770e1d87a8438fb34b6b75ec7
|
7
|
+
data.tar.gz: d59c92d8a448f39d10e6ecd404dae0a1fe38905c0fcd2a7c960d299549cad68b85982caf1d5ece2a5f4801a58a873d908329bd40e9de8bd60b14f436d0f515a4
|
data/.gitignore
CHANGED
data/.travis.yml
CHANGED
@@ -1,26 +1,30 @@
|
|
1
|
-
|
1
|
+
language: ruby
|
2
|
+
cache: bundler
|
2
3
|
before_install:
|
3
|
-
- gem
|
4
|
+
- gem update --system || gem update --system 2.7.8
|
5
|
+
- gem install bundler || gem install bundler -v 1.17.3
|
4
6
|
rvm:
|
5
7
|
- 1.9.3
|
6
8
|
- 2.0.0
|
7
9
|
- 2.1.0
|
8
|
-
- 2.2.
|
9
|
-
- 2.3.
|
10
|
+
- 2.2.10
|
11
|
+
- 2.3.7
|
12
|
+
- 2.4.4
|
13
|
+
- 2.5.1
|
14
|
+
- 2.6.0
|
10
15
|
- ruby-head
|
11
|
-
- jruby-19mode
|
12
16
|
- jruby-head
|
13
17
|
matrix:
|
14
18
|
allow_failures:
|
15
19
|
- env: rdoc=master
|
20
|
+
- rvm: jruby-head
|
16
21
|
include:
|
17
|
-
- { rvm:
|
18
|
-
- { rvm: 2.
|
19
|
-
- { rvm: 2.
|
20
|
-
- { rvm: 2.
|
21
|
-
- { rvm: 2.
|
22
|
+
- { rvm: 2.2.10, env: rdoc=master }
|
23
|
+
- { rvm: 2.3.7, env: rdoc=master }
|
24
|
+
- { rvm: 2.4.4, env: rdoc=master }
|
25
|
+
- { rvm: 2.5.1, env: rdoc=master }
|
26
|
+
- { rvm: 2.6.0, env: rdoc=master }
|
22
27
|
- { rvm: ruby-head, env: rdoc=master }
|
23
|
-
- { rvm: jruby-19mode, env: rdoc=master }
|
24
28
|
- { rvm: jruby-head, env: rdoc=master }
|
25
29
|
notifications:
|
26
30
|
email:
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,27 @@
|
|
1
|
+
2.0.0
|
2
|
+
=====
|
3
|
+
|
4
|
+
* #137 Replace frames based implementation with a css
|
5
|
+
* #132 Deprecate safe_level of ERB.new in Ruby 2.6
|
6
|
+
|
7
|
+
1.1.0
|
8
|
+
=====
|
9
|
+
|
10
|
+
* #138 - Fix panel header overflow on Chrome
|
11
|
+
* 39e6cae9 - Display version using `-v` or `--version` flags
|
12
|
+
|
13
|
+
1.0.0
|
14
|
+
=====
|
15
|
+
|
16
|
+
* #110 - Strip out HTML tags from search results description
|
17
|
+
* #109 - Add basic SEO tags
|
18
|
+
* #108 - Tiny refresh of the Rails theme
|
19
|
+
* e6f02b91 - Remove the jQuery effect library
|
20
|
+
* 73ace366 - Remove the `--without-search` option
|
21
|
+
* b1d429f2 - Produce HTML 5 output
|
22
|
+
* 38d06095 - Support only RDoc 5 and up
|
23
|
+
* #96 - Require at least Ruby 1.9.3
|
24
|
+
|
1
25
|
0.4.2
|
2
26
|
=====
|
3
27
|
|
data/Gemfile
CHANGED
data/LICENSE
CHANGED
@@ -1,4 +1,5 @@
|
|
1
|
-
Copyright (c) 2014
|
1
|
+
Copyright (c) 2014 Vladimir Kolesnikov, and Nathan Broadbent
|
2
|
+
Copyright (c) 2014-2017 Zachary Scott
|
2
3
|
|
3
4
|
Permission is hereby granted, free of charge, to any person obtaining
|
4
5
|
a copy of this software and associated documentation files (the
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# SDoc
|
2
2
|
|
3
|
-
[![Build Status](https://travis-ci.org/zzak/sdoc.
|
3
|
+
[![Build Status](https://travis-ci.org/zzak/sdoc.svg?branch=master)](https://travis-ci.org/zzak/sdoc)
|
4
4
|
|
5
5
|
**Powering http://api.rubyonrails.org/**
|
6
6
|
|
@@ -62,9 +62,9 @@ require 'sdoc' # and use your RDoc task the same way you used it before
|
|
62
62
|
require 'rdoc/task' # ensure this file is also required in order to use `RDoc::Task`
|
63
63
|
|
64
64
|
RDoc::Task.new do |rdoc|
|
65
|
-
rdoc.rdoc_dir = 'doc/rdoc'
|
66
|
-
rdoc.
|
67
|
-
rdoc.template = 'rails'
|
65
|
+
rdoc.rdoc_dir = 'doc/rdoc' # name of output directory
|
66
|
+
rdoc.options << '--format=sdoc' # explictly set the sdoc generator
|
67
|
+
rdoc.template = 'rails' # template used on api.rubyonrails.org
|
68
68
|
end
|
69
69
|
```
|
70
70
|
|
@@ -78,7 +78,7 @@ Alternatively you can pass this command a path to the project you wish to compil
|
|
78
78
|
|
79
79
|
As mentioned before, SDoc is built on top of the RDoc project.
|
80
80
|
|
81
|
-
If you notice any bugs in the output of your documentation, it may be RDoc's fault and should be [reported upstream](https://github.com/
|
81
|
+
If you notice any bugs in the output of your documentation, it may be RDoc's fault and should be [reported upstream](https://github.com/ruby/rdoc/issues/new).
|
82
82
|
|
83
83
|
An example of an SDoc bug would be:
|
84
84
|
|
@@ -90,6 +90,16 @@ Please feel free to still report issues here for both projects, especially if yo
|
|
90
90
|
|
91
91
|
As maintainer of both projects, I'll see if I can identify the root of the cause :bow: :bow: :bow:
|
92
92
|
|
93
|
+
## Contributing
|
94
|
+
|
95
|
+
If you'd like to contribute you can generate the Rails documentation by running:
|
96
|
+
|
97
|
+
```bash
|
98
|
+
rake test:rails
|
99
|
+
```
|
100
|
+
|
101
|
+
This task will generate documentation for the Rails master branch.
|
102
|
+
Since the task doesn't do any file filtering it contains a lot of extra pages.
|
93
103
|
|
94
104
|
### Who?
|
95
105
|
|
data/Rakefile
CHANGED
data/bin/sdoc
CHANGED
data/bin/sdoc-merge
CHANGED
data/lib/rdoc/discover.rb
CHANGED
@@ -1,9 +1,7 @@
|
|
1
|
-
<!DOCTYPE html
|
2
|
-
|
3
|
-
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
|
4
|
-
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html lang="en">
|
5
3
|
<head>
|
6
|
-
<meta
|
4
|
+
<meta charset="utf-8">
|
7
5
|
|
8
6
|
<title><%= @title %></title>
|
9
7
|
</head>
|
@@ -0,0 +1,216 @@
|
|
1
|
+
<div id="content">
|
2
|
+
<% unless (description = context.description).empty? %>
|
3
|
+
<div class="description">
|
4
|
+
<%= description %>
|
5
|
+
</div>
|
6
|
+
<% end %>
|
7
|
+
|
8
|
+
|
9
|
+
<% unless context.requires.empty? %>
|
10
|
+
<!-- File only: requires -->
|
11
|
+
<div class="sectiontitle">Required Files</div>
|
12
|
+
<ul>
|
13
|
+
<% context.requires.each do |req| %>
|
14
|
+
<li><%= h req.name %></li>
|
15
|
+
<% end %>
|
16
|
+
</ul>
|
17
|
+
<% end %>
|
18
|
+
|
19
|
+
|
20
|
+
<% sections = context.sections.select { |s| s.title }.sort_by{ |s| s.title.to_s } %>
|
21
|
+
<% unless sections.empty? then %>
|
22
|
+
<!-- Sections -->
|
23
|
+
<div class="sectiontitle">Sections</div>
|
24
|
+
<ul>
|
25
|
+
<% sections.each do |section| %>
|
26
|
+
<li><a href="#<%= section.aref %>"><%= h section.title %></a></li>
|
27
|
+
<% end %>
|
28
|
+
</ul>
|
29
|
+
<% end %>
|
30
|
+
|
31
|
+
|
32
|
+
<% unless context.classes_and_modules.empty? %>
|
33
|
+
<!-- Namespace -->
|
34
|
+
<div class="sectiontitle">Namespace</div>
|
35
|
+
<ul>
|
36
|
+
<% (context.modules.sort + context.classes.sort).each do |mod| %>
|
37
|
+
<li>
|
38
|
+
<span class="type"><%= mod.type.upcase %></span>
|
39
|
+
<a href="<%= context.aref_to mod.path %>"><%= mod.full_name %></a>
|
40
|
+
</li>
|
41
|
+
<% end %>
|
42
|
+
</ul>
|
43
|
+
<% end %>
|
44
|
+
|
45
|
+
|
46
|
+
<% unless context.method_list.empty? %>
|
47
|
+
<!-- Method ref -->
|
48
|
+
<div class="sectiontitle">Methods</div>
|
49
|
+
<dl class="methods">
|
50
|
+
<% each_letter_group(context.method_list) do |group| %>
|
51
|
+
<dt><%= group[:name] %></dt>
|
52
|
+
<dd>
|
53
|
+
<ul>
|
54
|
+
<% group[:methods].each_with_index do |method, i| %>
|
55
|
+
<%
|
56
|
+
comma = group[:methods].size == i+1 ? '' : ','
|
57
|
+
%>
|
58
|
+
<li>
|
59
|
+
<a href="#<%= method.aref %>"><%= h method.name %></a><%= comma %>
|
60
|
+
</li>
|
61
|
+
<% end %>
|
62
|
+
</ul>
|
63
|
+
</dd>
|
64
|
+
<% end %>
|
65
|
+
</dl>
|
66
|
+
<% end %>
|
67
|
+
|
68
|
+
<% unless context.includes.empty? %>
|
69
|
+
<!-- Includes -->
|
70
|
+
<div class="sectiontitle">Included Modules</div>
|
71
|
+
<ul>
|
72
|
+
<% context.includes.each do |inc| %>
|
73
|
+
<li>
|
74
|
+
<% unless String === inc.module %>
|
75
|
+
<a href="<%= context.aref_to inc.module.path %>">
|
76
|
+
<%= h inc.module.full_name %>
|
77
|
+
</a>
|
78
|
+
<% else %>
|
79
|
+
<%= h inc.name %>
|
80
|
+
<% end %>
|
81
|
+
</li>
|
82
|
+
<% end %>
|
83
|
+
</ul>
|
84
|
+
<% end %>
|
85
|
+
|
86
|
+
|
87
|
+
|
88
|
+
<% context.each_section do |section, constants, attributes| %>
|
89
|
+
|
90
|
+
<% if section.title then %>
|
91
|
+
<div class="contenttitle" id="<%= h section.aref %>">
|
92
|
+
<%= h section.title %>
|
93
|
+
</div>
|
94
|
+
<% end %>
|
95
|
+
|
96
|
+
<% if section.comment then %>
|
97
|
+
<div class="description">
|
98
|
+
<%= section.description %>
|
99
|
+
</div>
|
100
|
+
<% end %>
|
101
|
+
|
102
|
+
<% unless constants.empty? %>
|
103
|
+
<!-- Section constants -->
|
104
|
+
<div class="sectiontitle">Constants</div>
|
105
|
+
<table border='0' cellpadding='5'>
|
106
|
+
<% constants.each do |const| %>
|
107
|
+
<tr valign='top'>
|
108
|
+
<td class="attr-name"><%= h const.name %></td>
|
109
|
+
<td>=</td>
|
110
|
+
<td class="attr-value"><%= h const.value %></td>
|
111
|
+
</tr>
|
112
|
+
<% if const.comment %>
|
113
|
+
<tr valign='top'>
|
114
|
+
<td> </td>
|
115
|
+
<td colspan="2" class="attr-desc"><%= const.description.strip %></td>
|
116
|
+
</tr>
|
117
|
+
<% end %>
|
118
|
+
<% end %>
|
119
|
+
</table>
|
120
|
+
<% end %>
|
121
|
+
|
122
|
+
|
123
|
+
<% unless attributes.empty? %>
|
124
|
+
<!-- Section attributes -->
|
125
|
+
<div class="sectiontitle">Attributes</div>
|
126
|
+
<table border='0' cellpadding='5'>
|
127
|
+
<% attributes.each do |attrib| %>
|
128
|
+
<tr valign='top'>
|
129
|
+
<td class='attr-rw'>
|
130
|
+
[<%= attrib.rw %>]
|
131
|
+
</td>
|
132
|
+
<td class='attr-name'><%= h attrib.name %></td>
|
133
|
+
<td class='attr-desc'><%= attrib.description.strip %></td>
|
134
|
+
</tr>
|
135
|
+
<% end %>
|
136
|
+
</table>
|
137
|
+
<% end %>
|
138
|
+
|
139
|
+
|
140
|
+
<!-- Methods -->
|
141
|
+
<%
|
142
|
+
context.methods_by_type(section).each do |type, visibilities|
|
143
|
+
next if visibilities.empty?
|
144
|
+
|
145
|
+
visibilities.each do |visibility, methods|
|
146
|
+
next if methods.empty?
|
147
|
+
%>
|
148
|
+
<div class="sectiontitle"><%= type.capitalize %> <%= visibility.to_s.capitalize %> methods</div>
|
149
|
+
<% methods.each do |method| %>
|
150
|
+
<div class="method">
|
151
|
+
<div class="title method-title" id="<%= method.aref %>">
|
152
|
+
<% if method.call_seq %>
|
153
|
+
<b><%= method.call_seq.gsub(/->/, '→').gsub(/\n(.)/, '<br />\1') %></b>
|
154
|
+
<% else %>
|
155
|
+
<b><%= h method.name %></b><%= h method.params %>
|
156
|
+
<% end %>
|
157
|
+
<a href="<%= "#{rel_prefix}/#{context.path}##{method.aref}"%>" name="<%= method.aref %>" class="permalink">Link</a>
|
158
|
+
</div>
|
159
|
+
|
160
|
+
<% if method.comment %>
|
161
|
+
<div class="description">
|
162
|
+
<%= method.description.strip %>
|
163
|
+
</div>
|
164
|
+
<% end %>
|
165
|
+
|
166
|
+
<% unless method.aliases.empty? %>
|
167
|
+
<div class="aka">
|
168
|
+
Also aliased as: <%= method.aliases.map do |aka|
|
169
|
+
if aka.parent then # HACK lib/rexml/encodings
|
170
|
+
%{<a href="#{context.aref_to aka.path}">#{h aka.name}</a>}
|
171
|
+
else
|
172
|
+
h aka.name
|
173
|
+
end
|
174
|
+
end.join ", " %>
|
175
|
+
</div>
|
176
|
+
<% end %>
|
177
|
+
|
178
|
+
<% if method.is_alias_for then %>
|
179
|
+
<div class="aka">
|
180
|
+
Alias for: <a href="<%= context.aref_to method.is_alias_for.path %>"><%= h method.is_alias_for.name %></a>
|
181
|
+
</div>
|
182
|
+
<% end %>
|
183
|
+
|
184
|
+
<% if method.token_stream %>
|
185
|
+
<% markup = method.markup_code %>
|
186
|
+
<div class="sourcecode">
|
187
|
+
<%
|
188
|
+
# generate github link
|
189
|
+
github = if options.github
|
190
|
+
if markup =~ /File\s(\S+), line (\d+)/
|
191
|
+
path = $1
|
192
|
+
line = $2.to_i
|
193
|
+
end
|
194
|
+
path && github_url(path)
|
195
|
+
else
|
196
|
+
false
|
197
|
+
end
|
198
|
+
%>
|
199
|
+
<p class="source-link">
|
200
|
+
Source:
|
201
|
+
<a href="javascript:toggleSource('<%= method.aref %>_source')" id="l_<%= method.aref %>_source">show</a>
|
202
|
+
<% if github %>
|
203
|
+
| <a href="<%= "#{github}#L#{line}" %>" target="_blank" class="github_url">on GitHub</a>
|
204
|
+
<% end %>
|
205
|
+
</p>
|
206
|
+
<div id="<%= method.aref %>_source" class="dyn-source">
|
207
|
+
<pre><%= markup %></pre>
|
208
|
+
</div>
|
209
|
+
</div>
|
210
|
+
<% end %>
|
211
|
+
</div>
|
212
|
+
<% end %><%# methods.each %>
|
213
|
+
<% end %><%# visibilities.each %>
|
214
|
+
<% end %><%# context.methods_by_type %>
|
215
|
+
<% end %><%# context.each_section %>
|
216
|
+
</div>
|
@@ -0,0 +1,39 @@
|
|
1
|
+
<%
|
2
|
+
# Turbolinks does not consider relative urls similar, resulting in page
|
3
|
+
# reloads and losing the context of the panel. Emptying the rel_prefix makes
|
4
|
+
# asset paths absolute. This breaks opening the docs locally. Maybe all
|
5
|
+
# generated docs should be in the same folder?
|
6
|
+
rel_prefix = ''
|
7
|
+
%>
|
8
|
+
<link rel="stylesheet" href="<%= "#{rel_prefix}/css/reset.css" %>" type="text/css" media="screen" data-turbolinks-track="reload" />
|
9
|
+
<link rel="stylesheet" href="<%= "#{rel_prefix}/css/panel.css" %>" type="text/css" media="screen" data-turbolinks-track="reload" />
|
10
|
+
<link rel="stylesheet" href="<%= "#{rel_prefix}/css/main.css" %>" type="text/css" media="screen" data-turbolinks-track="reload" />
|
11
|
+
<link rel="stylesheet" href="<%= "#{rel_prefix}/css/github.css" %>" type="text/css" media="screen" data-turbolinks-track="reload" />
|
12
|
+
<script src="<%= "#{rel_prefix}/js/jquery-3.5.1.min.js" %>" type="text/javascript" charset="utf-8" data-turbolinks-track="reload"></script>
|
13
|
+
<script src="<%= "#{rel_prefix}/js/main.js" %>" type="text/javascript" charset="utf-8" data-turbolinks-track="reload"></script>
|
14
|
+
<script src="<%= "#{rel_prefix}/js/highlight.pack.js" %>" type="text/javascript" charset="utf-8" data-turbolinks-track="reload"></script>
|
15
|
+
<script src="<%= rel_prefix %>/js/turbolinks.js" type="text/javascript" charset="utf-8" data-turbolinks-track="reload"></script>
|
16
|
+
<script src="<%= rel_prefix %>/js/search_index.js" type="text/javascript" charset="utf-8" data-turbolinks-track="reload"></script>
|
17
|
+
<script src="<%= rel_prefix %>/js/searcher.js" type="text/javascript" charset="utf-8" data-turbolinks-track="reload"></script>
|
18
|
+
<script src="<%= rel_prefix %>/panel/tree.js" type="text/javascript" charset="utf-8" data-turbolinks-track="reload"></script>
|
19
|
+
<script src="<%= rel_prefix %>/js/searchdoc.js" type="text/javascript" charset="utf-8" data-turbolinks-track="reload"></script>
|
20
|
+
<script type="text/javascript" charset="utf-8">
|
21
|
+
document.addEventListener("turbolinks:load", function() {
|
22
|
+
// Only initialize panel if not yet initialized
|
23
|
+
if(!$('#panel .tree ul li').length) {
|
24
|
+
$('#links').hide();
|
25
|
+
var panel = new Searchdoc.Panel($('#panel'), search_data, tree, '<%= rel_prefix %>/');
|
26
|
+
$('#search').focus();
|
27
|
+
var s = window.location.search.match(/\?q=([^&]+)/);
|
28
|
+
if (s) {
|
29
|
+
s = decodeURIComponent(s[1]).replace(/\+/g, ' ');
|
30
|
+
if (s.length > 0) {
|
31
|
+
$('#search').val(s);
|
32
|
+
panel.search(s, true);
|
33
|
+
}
|
34
|
+
}
|
35
|
+
panel.toggle(<%= tree_keys %>);
|
36
|
+
}
|
37
|
+
})
|
38
|
+
</script>
|
39
|
+
|