devcenter 0.0.9 → 0.0.10
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/devcenter/previewer/file_listener.rb +2 -2
- data/lib/devcenter/previewer/views/article.erb +23 -340
- data/lib/devcenter/previewer/views/layout.erb +314 -0
- data/lib/devcenter/previewer/views/not_found.erb +9 -0
- data/lib/devcenter/previewer/web_app.rb +11 -4
- data/lib/devcenter/version.rb +1 -1
- metadata +4 -2
@@ -6,7 +6,7 @@ module Devcenter::Previewer
|
|
6
6
|
def initialize(file_path, callback)
|
7
7
|
dir = File.dirname(file_path)
|
8
8
|
basename = File.basename(file_path)
|
9
|
-
@listener = Listen.to(dir)
|
9
|
+
@listener = Listen.to(dir, force_polling: true)
|
10
10
|
@listener.filter(%r{#{basename}})
|
11
11
|
@listener.change(&callback)
|
12
12
|
end
|
@@ -21,4 +21,4 @@ module Devcenter::Previewer
|
|
21
21
|
end
|
22
22
|
end
|
23
23
|
|
24
|
-
end
|
24
|
+
end
|
@@ -1,345 +1,28 @@
|
|
1
|
-
|
2
|
-
<
|
3
|
-
<head>
|
4
|
-
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
5
|
-
<title>Preview: <%= @article.metadata.title %></title>
|
6
|
-
<meta charset="utf-8">
|
7
|
-
<meta name="viewport" content="width=device-width, initial-scale=0.5">
|
8
|
-
<meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible">
|
9
|
-
<meta content="authenticity_token" name="csrf-param">
|
10
|
-
<link href="/assets/public.css" media="screen" rel="stylesheet" type="text/css">
|
11
|
-
<!--[if IE 6]>
|
12
|
-
<link href="https://universal-ie6-css.googlecode.com/files/ie6.0.3.css" media="screen" rel="stylesheet" type="text/css" />
|
13
|
-
<![endif]-->
|
14
|
-
<style>
|
15
|
-
.parsing-error, .parsing-error h4 {
|
16
|
-
color: red;
|
17
|
-
line-height: 1.8em;
|
18
|
-
}
|
19
|
-
.save {
|
20
|
-
margin: 2em 0;
|
21
|
-
}
|
22
|
-
.save textarea {
|
23
|
-
display:none;
|
24
|
-
}
|
25
|
-
.save input {
|
26
|
-
padding: 1em 2em;
|
27
|
-
}
|
28
|
-
</style>
|
29
|
-
<script>
|
30
|
-
try {
|
31
|
-
var es = new EventSource('/stream');
|
32
|
-
es.onmessage = function(e) {
|
33
|
-
document.location.reload();
|
34
|
-
};
|
35
|
-
es.onerror = function(error) {
|
36
|
-
es.close();
|
37
|
-
}
|
38
|
-
} catch (error) {
|
39
|
-
console.log("ERROR:");
|
40
|
-
console.log(error);
|
41
|
-
}
|
42
|
-
</script>
|
43
|
-
</head>
|
44
|
-
<body>
|
45
|
-
<div id="heroku-header">
|
46
|
-
<div id="heroku-header-hgroup">
|
47
|
-
<h1><a href="https://heroku.com">Heroku</a></h1>
|
48
|
-
</div>
|
49
|
-
<div id="heroku-header-nav">
|
50
|
-
<ul>
|
51
|
-
<li><a href="https://heroku.com/how/">How It Works</a></li>
|
52
|
-
<li><a href="https://heroku.com/pricing/">Pricing</a></li>
|
53
|
-
<li class="last"><a href="https://addons.heroku.com/">Add-ons</a></li>
|
54
|
-
</ul>
|
55
|
-
<ul class="group" id="heroku-header-aid">
|
56
|
-
<li><a href="https://devcenter.heroku.com/">Dev Center</a></li>
|
57
|
-
<li class="last"><a href="https://help.heroku.com">Help</a></li>
|
58
|
-
</ul>
|
59
|
-
<ul class="last group" id="heroku-header-my-heroku">
|
60
|
-
<li class="last"><a href="/auth/login?back_to=%2Farticles%2Fcedar">Login</a></li>
|
61
|
-
</ul>
|
62
|
-
</div>
|
63
|
-
|
64
|
-
<div id="heroku-header-quicknav">
|
65
|
-
<select><optgroup label="About">
|
66
|
-
<option value="https://heroku.com/how/">How It Works</option>
|
67
|
-
<option value="https://heroku.com/pricing/">Pricing</option>
|
68
|
-
<option value="https://addons.heroku.com/">Add-ons</option>
|
69
|
-
</optgroup>
|
70
|
-
<optgroup label="Support">
|
71
|
-
<option selected value="https://devcenter.heroku.com/">Dev Center</option>
|
72
|
-
<option value="https://help.heroku.com">Help</option>
|
73
|
-
</optgroup>
|
74
|
-
<optgroup label="My Heroku"><option value="/auth/logout?back_to=%2Farticles%2Fcedar">Login</option></optgroup></select><a href="#" onclick="return false;">Dev Center</a>
|
75
|
-
</div>
|
76
|
-
</div>
|
77
|
-
<script type="text/javascript">
|
78
|
-
</script><div id="sheet">
|
79
|
-
<div class="wrapper">
|
80
|
-
<div class="pie-clearfix" id="article">
|
81
|
-
<aside id="sidebar">
|
82
|
-
<select id="quicknav" class="nocontent"><option value="/">Home</option>
|
83
|
-
<optgroup label="Overview">
|
84
|
-
<option value="/categories/getting-started">
|
85
|
-
Getting Started
|
86
|
-
</option>
|
87
|
-
<option value="/categories/platform-architecture">
|
88
|
-
Platform Architecture
|
89
|
-
</option>
|
90
|
-
<option value="/categories/application-architecture">
|
91
|
-
Application Architecture
|
92
|
-
</option>
|
93
|
-
</optgroup>
|
94
|
-
<optgroup label="Reference">
|
95
|
-
<option value="/categories/platform-features" selected>
|
96
|
-
Platform Features
|
97
|
-
</option>
|
98
|
-
<option value="/categories/language-support">
|
99
|
-
Languages
|
100
|
-
</option>
|
101
|
-
<option value="/categories/command-line">
|
102
|
-
Command Line
|
103
|
-
</option>
|
104
|
-
<option value="/categories/collaboration">
|
105
|
-
Collaboration
|
106
|
-
</option>
|
107
|
-
<option value="/categories/deployment">
|
108
|
-
Deployment
|
109
|
-
</option>
|
110
|
-
<option value="/categories/troubleshooting">
|
111
|
-
Troubleshooting
|
112
|
-
</option>
|
113
|
-
<option value="/categories/devcenter">
|
114
|
-
Dev Center
|
115
|
-
</option>
|
116
|
-
<option value="/categories/aspen-bamboo">
|
117
|
-
Bamboo
|
118
|
-
</option>
|
119
|
-
<option value="/categories/labs">
|
120
|
-
Heroku Labs
|
121
|
-
</option>
|
122
|
-
<option value="/categories/buildpacks">
|
123
|
-
Buildpacks
|
124
|
-
</option>
|
125
|
-
<option value="/changelog">
|
126
|
-
Changelog
|
127
|
-
</option>
|
128
|
-
</optgroup>
|
129
|
-
<optgroup label="Languages">
|
130
|
-
<option value="/categories/ruby">
|
131
|
-
Ruby
|
132
|
-
</option>
|
133
|
-
<option value="/categories/java">
|
134
|
-
Java
|
135
|
-
</option>
|
136
|
-
<option value="/categories/python">
|
137
|
-
Python
|
138
|
-
</option>
|
139
|
-
<option value="/categories/clojure">
|
140
|
-
Clojure
|
141
|
-
</option>
|
142
|
-
<option value="/categories/scala">
|
143
|
-
Scala
|
144
|
-
</option>
|
145
|
-
<option value="/categories/nodejs">
|
146
|
-
Node.js
|
147
|
-
</option>
|
148
|
-
</optgroup>
|
149
|
-
<optgroup label="Tutorials">
|
150
|
-
<option value="/categories/features">
|
151
|
-
Adding Features
|
152
|
-
</option>
|
153
|
-
<option value="/categories/facebook">
|
154
|
-
Facebook
|
155
|
-
</option>
|
156
|
-
<option value="/categories/mobile">
|
157
|
-
Mobile
|
158
|
-
</option>
|
159
|
-
<option value="/categories/database">
|
160
|
-
Database
|
161
|
-
</option>
|
162
|
-
</optgroup>
|
163
|
-
<optgroup label="Accounts & Billing">
|
164
|
-
<option value="/categories/billing">
|
165
|
-
Accounts & Billing
|
166
|
-
</option>
|
167
|
-
<option value="/categories/support">
|
168
|
-
Support
|
169
|
-
</option>
|
170
|
-
</optgroup>
|
171
|
-
<optgroup label="Add-ons">
|
172
|
-
<option value="/categories/heroku-postgres">
|
173
|
-
Heroku Postgres
|
174
|
-
</option>
|
175
|
-
<option value="/categories/addon-overview">
|
176
|
-
Overview
|
177
|
-
</option>
|
178
|
-
<option value="/categories/add-on-documentation">
|
179
|
-
All Add-ons
|
180
|
-
</option>
|
181
|
-
</optgroup></select><ul id="nav" class="nocontent">
|
182
|
-
<li class="category-group">
|
183
|
-
<a class="category" href="#">Overview</a>
|
184
|
-
|
185
|
-
<ul class="tags" style="display:none;">
|
186
|
-
<li>
|
187
|
-
<a href="/categories/getting-started">Getting Started</a>
|
188
|
-
</li>
|
189
|
-
<li>
|
190
|
-
<a href="/categories/platform-architecture">Platform Architecture</a>
|
191
|
-
</li>
|
192
|
-
<li>
|
193
|
-
<a href="/categories/application-architecture">Application Architecture</a>
|
194
|
-
</li>
|
195
|
-
</ul>
|
196
|
-
</li>
|
197
|
-
<li class="category-group">
|
198
|
-
<a class="category" href="#">Reference</a>
|
199
|
-
|
200
|
-
<ul class="tags" style="display:block;">
|
201
|
-
<li class="active">
|
202
|
-
<a href="/categories/platform-features">Platform Features</a>
|
203
|
-
</li>
|
204
|
-
<li>
|
205
|
-
<a href="/categories/language-support">Languages</a>
|
206
|
-
</li>
|
207
|
-
<li>
|
208
|
-
<a href="/categories/command-line">Command Line</a>
|
209
|
-
</li>
|
210
|
-
<li>
|
211
|
-
<a href="/categories/collaboration">Collaboration</a>
|
212
|
-
</li>
|
213
|
-
<li>
|
214
|
-
<a href="/categories/deployment">Deployment</a>
|
215
|
-
</li>
|
216
|
-
<li>
|
217
|
-
<a href="/categories/troubleshooting">Troubleshooting</a>
|
218
|
-
</li>
|
219
|
-
<li>
|
220
|
-
<a href="/categories/devcenter">Dev Center</a>
|
221
|
-
</li>
|
222
|
-
<li>
|
223
|
-
<a href="/categories/aspen-bamboo">Bamboo</a>
|
224
|
-
</li>
|
225
|
-
<li>
|
226
|
-
<a href="/categories/labs">Heroku Labs</a>
|
227
|
-
</li>
|
228
|
-
<li>
|
229
|
-
<a href="/categories/buildpacks">Buildpacks</a>
|
230
|
-
</li>
|
231
|
-
<li>
|
232
|
-
<a href="/changelog">Changelog</a>
|
233
|
-
</li>
|
234
|
-
</ul>
|
235
|
-
</li>
|
236
|
-
<li class="category-group">
|
237
|
-
<a class="category" href="#">Languages</a>
|
238
|
-
|
239
|
-
<ul class="tags" style="display:none;">
|
240
|
-
<li>
|
241
|
-
<a href="/categories/ruby">Ruby</a>
|
242
|
-
</li>
|
243
|
-
<li>
|
244
|
-
<a href="/categories/java">Java</a>
|
245
|
-
</li>
|
246
|
-
<li>
|
247
|
-
<a href="/categories/python">Python</a>
|
248
|
-
</li>
|
249
|
-
<li>
|
250
|
-
<a href="/categories/clojure">Clojure</a>
|
251
|
-
</li>
|
252
|
-
<li>
|
253
|
-
<a href="/categories/scala">Scala</a>
|
254
|
-
</li>
|
255
|
-
<li>
|
256
|
-
<a href="/categories/nodejs">Node.js</a>
|
257
|
-
</li>
|
258
|
-
</ul>
|
259
|
-
</li>
|
260
|
-
<li class="category-group">
|
261
|
-
<a class="category" href="#">Tutorials</a>
|
262
|
-
|
263
|
-
<ul class="tags" style="display:none;">
|
264
|
-
<li>
|
265
|
-
<a href="/categories/features">Adding Features</a>
|
266
|
-
</li>
|
267
|
-
<li>
|
268
|
-
<a href="/categories/facebook">Facebook</a>
|
269
|
-
</li>
|
270
|
-
<li>
|
271
|
-
<a href="/categories/mobile">Mobile</a>
|
272
|
-
</li>
|
273
|
-
<li>
|
274
|
-
<a href="/categories/database">Database</a>
|
275
|
-
</li>
|
276
|
-
</ul>
|
277
|
-
</li>
|
278
|
-
<li class="category-group">
|
279
|
-
<a class="category" href="#">Accounts & Billing</a>
|
280
|
-
|
281
|
-
<ul class="tags" style="display:none;">
|
282
|
-
<li>
|
283
|
-
<a href="/categories/billing">Accounts & Billing</a>
|
284
|
-
</li>
|
285
|
-
<li>
|
286
|
-
<a href="/categories/support">Support</a>
|
287
|
-
</li>
|
288
|
-
</ul>
|
289
|
-
</li>
|
290
|
-
<li class="category-group">
|
291
|
-
<a class="category" href="#">Add-ons</a>
|
292
|
-
|
293
|
-
<ul class="tags" style="display:none;">
|
294
|
-
<li>
|
295
|
-
<a href="/categories/heroku-postgres">Heroku Postgres</a>
|
296
|
-
</li>
|
297
|
-
<li>
|
298
|
-
<a href="/categories/addon-overview">Overview</a>
|
299
|
-
</li>
|
300
|
-
<li>
|
301
|
-
<a href="/categories/add-on-documentation">All Add-ons</a>
|
302
|
-
</li>
|
303
|
-
</ul>
|
304
|
-
</li>
|
305
|
-
</ul></aside><section id="main"><div id="admin-tabs"></div>
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
<article><hgroup><h1><%= @article.metadata.title %></h1>
|
310
|
-
|
311
|
-
|
312
|
-
|
1
|
+
<article>
|
2
|
+
<hgroup><h1><%= @article.metadata.title %></h1>
|
313
3
|
<p class="meta">
|
314
4
|
Local preview.
|
315
5
|
</p>
|
316
|
-
|
317
6
|
</hgroup>
|
318
7
|
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
<%= @article.content.to_s.lstrip %>
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
</article>
|
340
|
-
</section>
|
341
|
-
</div>
|
342
|
-
|
343
|
-
|
344
|
-
</body>
|
345
|
-
</html>
|
8
|
+
<% if !@article.html.to_s.empty? %>
|
9
|
+
<%= @article.html %>
|
10
|
+
<% elsif @article.error %>
|
11
|
+
<div class="cli-preview-error">
|
12
|
+
<h4>Parsing error:</h4>
|
13
|
+
<p>
|
14
|
+
<%= @article.error %>
|
15
|
+
</p>
|
16
|
+
</div>
|
17
|
+
<% end %>
|
18
|
+
|
19
|
+
<form class="cli-save" action="<%= devcenter_base_url %>/admin/articles/update/<%= @article.metadata.id %>" method="POST">
|
20
|
+
<input name="_method" type="hidden" value="put">
|
21
|
+
<input type="hidden" name="article[title]" value="<%= @article.metadata.title %>">
|
22
|
+
<textarea style="display:none1" name="article[content]">
|
23
|
+
<%= @article.content.to_s.lstrip %>
|
24
|
+
</textarea>
|
25
|
+
<input type="submit" value="Save in Dev Center">
|
26
|
+
</form>
|
27
|
+
|
28
|
+
</article>
|
@@ -0,0 +1,314 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html class="no-js" dir="ltr" lang="en">
|
3
|
+
<head>
|
4
|
+
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
5
|
+
<title>Preview: <%= @page_title %></title>
|
6
|
+
<meta charset="utf-8">
|
7
|
+
<meta name="viewport" content="width=device-width, initial-scale=0.5">
|
8
|
+
<meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible">
|
9
|
+
<meta content="authenticity_token" name="csrf-param">
|
10
|
+
<link href="/assets/public.css" media="screen" rel="stylesheet" type="text/css">
|
11
|
+
<!--[if IE 6]>
|
12
|
+
<link href="https://universal-ie6-css.googlecode.com/files/ie6.0.3.css" media="screen" rel="stylesheet" type="text/css" />
|
13
|
+
<![endif]-->
|
14
|
+
<style>
|
15
|
+
.cli-preview-error, .cli-preview-error h4 {
|
16
|
+
color: red;
|
17
|
+
line-height: 1.8em;
|
18
|
+
}
|
19
|
+
.cli-save {
|
20
|
+
margin: 2em 0;
|
21
|
+
}
|
22
|
+
.cli-save textarea {
|
23
|
+
display:none;
|
24
|
+
}
|
25
|
+
.cli-save input {
|
26
|
+
padding: 1em 2em;
|
27
|
+
}
|
28
|
+
</style>
|
29
|
+
<script>
|
30
|
+
try {
|
31
|
+
var es = new EventSource('/stream');
|
32
|
+
es.onmessage = function(e) {
|
33
|
+
document.location.reload();
|
34
|
+
};
|
35
|
+
es.onerror = function(error) {
|
36
|
+
es.close();
|
37
|
+
}
|
38
|
+
} catch (error) {
|
39
|
+
console.log("ERROR:");
|
40
|
+
console.log(error);
|
41
|
+
}
|
42
|
+
</script>
|
43
|
+
</head>
|
44
|
+
<body>
|
45
|
+
<div id="heroku-header">
|
46
|
+
<div id="heroku-header-hgroup">
|
47
|
+
<h1><a href="https://heroku.com">Heroku</a></h1>
|
48
|
+
</div>
|
49
|
+
<div id="heroku-header-nav">
|
50
|
+
<ul>
|
51
|
+
<li><a href="https://heroku.com/how/">How It Works</a></li>
|
52
|
+
<li><a href="https://heroku.com/pricing/">Pricing</a></li>
|
53
|
+
<li class="last"><a href="https://addons.heroku.com/">Add-ons</a></li>
|
54
|
+
</ul>
|
55
|
+
<ul class="group" id="heroku-header-aid">
|
56
|
+
<li><a href="https://devcenter.heroku.com/">Dev Center</a></li>
|
57
|
+
<li class="last"><a href="https://help.heroku.com">Help</a></li>
|
58
|
+
</ul>
|
59
|
+
<ul class="last group" id="heroku-header-my-heroku">
|
60
|
+
<li class="last"><a href="/auth/login?back_to=%2Farticles%2Fcedar">Login</a></li>
|
61
|
+
</ul>
|
62
|
+
</div>
|
63
|
+
|
64
|
+
<div id="heroku-header-quicknav">
|
65
|
+
<select><optgroup label="About">
|
66
|
+
<option value="https://heroku.com/how/">How It Works</option>
|
67
|
+
<option value="https://heroku.com/pricing/">Pricing</option>
|
68
|
+
<option value="https://addons.heroku.com/">Add-ons</option>
|
69
|
+
</optgroup>
|
70
|
+
<optgroup label="Support">
|
71
|
+
<option selected value="https://devcenter.heroku.com/">Dev Center</option>
|
72
|
+
<option value="https://help.heroku.com">Help</option>
|
73
|
+
</optgroup>
|
74
|
+
<optgroup label="My Heroku"><option value="/auth/logout?back_to=%2Farticles%2Fcedar">Login</option></optgroup></select><a href="#" onclick="return false;">Dev Center</a>
|
75
|
+
</div>
|
76
|
+
</div>
|
77
|
+
<script type="text/javascript">
|
78
|
+
</script><div id="sheet">
|
79
|
+
<div class="wrapper">
|
80
|
+
<div class="pie-clearfix" id="article">
|
81
|
+
<aside id="sidebar">
|
82
|
+
<select id="quicknav" class="nocontent"><option value="/">Home</option>
|
83
|
+
<optgroup label="Overview">
|
84
|
+
<option value="/categories/getting-started">
|
85
|
+
Getting Started
|
86
|
+
</option>
|
87
|
+
<option value="/categories/platform-architecture">
|
88
|
+
Platform Architecture
|
89
|
+
</option>
|
90
|
+
<option value="/categories/application-architecture">
|
91
|
+
Application Architecture
|
92
|
+
</option>
|
93
|
+
</optgroup>
|
94
|
+
<optgroup label="Reference">
|
95
|
+
<option value="/categories/platform-features" selected>
|
96
|
+
Platform Features
|
97
|
+
</option>
|
98
|
+
<option value="/categories/language-support">
|
99
|
+
Languages
|
100
|
+
</option>
|
101
|
+
<option value="/categories/command-line">
|
102
|
+
Command Line
|
103
|
+
</option>
|
104
|
+
<option value="/categories/collaboration">
|
105
|
+
Collaboration
|
106
|
+
</option>
|
107
|
+
<option value="/categories/deployment">
|
108
|
+
Deployment
|
109
|
+
</option>
|
110
|
+
<option value="/categories/troubleshooting">
|
111
|
+
Troubleshooting
|
112
|
+
</option>
|
113
|
+
<option value="/categories/devcenter">
|
114
|
+
Dev Center
|
115
|
+
</option>
|
116
|
+
<option value="/categories/aspen-bamboo">
|
117
|
+
Bamboo
|
118
|
+
</option>
|
119
|
+
<option value="/categories/labs">
|
120
|
+
Heroku Labs
|
121
|
+
</option>
|
122
|
+
<option value="/categories/buildpacks">
|
123
|
+
Buildpacks
|
124
|
+
</option>
|
125
|
+
<option value="/changelog">
|
126
|
+
Changelog
|
127
|
+
</option>
|
128
|
+
</optgroup>
|
129
|
+
<optgroup label="Languages">
|
130
|
+
<option value="/categories/ruby">
|
131
|
+
Ruby
|
132
|
+
</option>
|
133
|
+
<option value="/categories/java">
|
134
|
+
Java
|
135
|
+
</option>
|
136
|
+
<option value="/categories/python">
|
137
|
+
Python
|
138
|
+
</option>
|
139
|
+
<option value="/categories/clojure">
|
140
|
+
Clojure
|
141
|
+
</option>
|
142
|
+
<option value="/categories/scala">
|
143
|
+
Scala
|
144
|
+
</option>
|
145
|
+
<option value="/categories/nodejs">
|
146
|
+
Node.js
|
147
|
+
</option>
|
148
|
+
</optgroup>
|
149
|
+
<optgroup label="Tutorials">
|
150
|
+
<option value="/categories/features">
|
151
|
+
Adding Features
|
152
|
+
</option>
|
153
|
+
<option value="/categories/facebook">
|
154
|
+
Facebook
|
155
|
+
</option>
|
156
|
+
<option value="/categories/mobile">
|
157
|
+
Mobile
|
158
|
+
</option>
|
159
|
+
<option value="/categories/database">
|
160
|
+
Database
|
161
|
+
</option>
|
162
|
+
</optgroup>
|
163
|
+
<optgroup label="Accounts & Billing">
|
164
|
+
<option value="/categories/billing">
|
165
|
+
Accounts & Billing
|
166
|
+
</option>
|
167
|
+
<option value="/categories/support">
|
168
|
+
Support
|
169
|
+
</option>
|
170
|
+
</optgroup>
|
171
|
+
<optgroup label="Add-ons">
|
172
|
+
<option value="/categories/heroku-postgres">
|
173
|
+
Heroku Postgres
|
174
|
+
</option>
|
175
|
+
<option value="/categories/addon-overview">
|
176
|
+
Overview
|
177
|
+
</option>
|
178
|
+
<option value="/categories/add-on-documentation">
|
179
|
+
All Add-ons
|
180
|
+
</option>
|
181
|
+
</optgroup></select><ul id="nav" class="nocontent">
|
182
|
+
<li class="category-group">
|
183
|
+
<a class="category" href="#">Overview</a>
|
184
|
+
|
185
|
+
<ul class="tags" style="display:none;">
|
186
|
+
<li>
|
187
|
+
<a href="/categories/getting-started">Getting Started</a>
|
188
|
+
</li>
|
189
|
+
<li>
|
190
|
+
<a href="/categories/platform-architecture">Platform Architecture</a>
|
191
|
+
</li>
|
192
|
+
<li>
|
193
|
+
<a href="/categories/application-architecture">Application Architecture</a>
|
194
|
+
</li>
|
195
|
+
</ul>
|
196
|
+
</li>
|
197
|
+
<li class="category-group">
|
198
|
+
<a class="category" href="#">Reference</a>
|
199
|
+
|
200
|
+
<ul class="tags" style="display:block;">
|
201
|
+
<li class="active">
|
202
|
+
<a href="/categories/platform-features">Platform Features</a>
|
203
|
+
</li>
|
204
|
+
<li>
|
205
|
+
<a href="/categories/language-support">Languages</a>
|
206
|
+
</li>
|
207
|
+
<li>
|
208
|
+
<a href="/categories/command-line">Command Line</a>
|
209
|
+
</li>
|
210
|
+
<li>
|
211
|
+
<a href="/categories/collaboration">Collaboration</a>
|
212
|
+
</li>
|
213
|
+
<li>
|
214
|
+
<a href="/categories/deployment">Deployment</a>
|
215
|
+
</li>
|
216
|
+
<li>
|
217
|
+
<a href="/categories/troubleshooting">Troubleshooting</a>
|
218
|
+
</li>
|
219
|
+
<li>
|
220
|
+
<a href="/categories/devcenter">Dev Center</a>
|
221
|
+
</li>
|
222
|
+
<li>
|
223
|
+
<a href="/categories/aspen-bamboo">Bamboo</a>
|
224
|
+
</li>
|
225
|
+
<li>
|
226
|
+
<a href="/categories/labs">Heroku Labs</a>
|
227
|
+
</li>
|
228
|
+
<li>
|
229
|
+
<a href="/categories/buildpacks">Buildpacks</a>
|
230
|
+
</li>
|
231
|
+
<li>
|
232
|
+
<a href="/changelog">Changelog</a>
|
233
|
+
</li>
|
234
|
+
</ul>
|
235
|
+
</li>
|
236
|
+
<li class="category-group">
|
237
|
+
<a class="category" href="#">Languages</a>
|
238
|
+
|
239
|
+
<ul class="tags" style="display:none;">
|
240
|
+
<li>
|
241
|
+
<a href="/categories/ruby">Ruby</a>
|
242
|
+
</li>
|
243
|
+
<li>
|
244
|
+
<a href="/categories/java">Java</a>
|
245
|
+
</li>
|
246
|
+
<li>
|
247
|
+
<a href="/categories/python">Python</a>
|
248
|
+
</li>
|
249
|
+
<li>
|
250
|
+
<a href="/categories/clojure">Clojure</a>
|
251
|
+
</li>
|
252
|
+
<li>
|
253
|
+
<a href="/categories/scala">Scala</a>
|
254
|
+
</li>
|
255
|
+
<li>
|
256
|
+
<a href="/categories/nodejs">Node.js</a>
|
257
|
+
</li>
|
258
|
+
</ul>
|
259
|
+
</li>
|
260
|
+
<li class="category-group">
|
261
|
+
<a class="category" href="#">Tutorials</a>
|
262
|
+
|
263
|
+
<ul class="tags" style="display:none;">
|
264
|
+
<li>
|
265
|
+
<a href="/categories/features">Adding Features</a>
|
266
|
+
</li>
|
267
|
+
<li>
|
268
|
+
<a href="/categories/facebook">Facebook</a>
|
269
|
+
</li>
|
270
|
+
<li>
|
271
|
+
<a href="/categories/mobile">Mobile</a>
|
272
|
+
</li>
|
273
|
+
<li>
|
274
|
+
<a href="/categories/database">Database</a>
|
275
|
+
</li>
|
276
|
+
</ul>
|
277
|
+
</li>
|
278
|
+
<li class="category-group">
|
279
|
+
<a class="category" href="#">Accounts & Billing</a>
|
280
|
+
|
281
|
+
<ul class="tags" style="display:none;">
|
282
|
+
<li>
|
283
|
+
<a href="/categories/billing">Accounts & Billing</a>
|
284
|
+
</li>
|
285
|
+
<li>
|
286
|
+
<a href="/categories/support">Support</a>
|
287
|
+
</li>
|
288
|
+
</ul>
|
289
|
+
</li>
|
290
|
+
<li class="category-group">
|
291
|
+
<a class="category" href="#">Add-ons</a>
|
292
|
+
|
293
|
+
<ul class="tags" style="display:none;">
|
294
|
+
<li>
|
295
|
+
<a href="/categories/heroku-postgres">Heroku Postgres</a>
|
296
|
+
</li>
|
297
|
+
<li>
|
298
|
+
<a href="/categories/addon-overview">Overview</a>
|
299
|
+
</li>
|
300
|
+
<li>
|
301
|
+
<a href="/categories/add-on-documentation">All Add-ons</a>
|
302
|
+
</li>
|
303
|
+
</ul>
|
304
|
+
</li>
|
305
|
+
</ul></aside><section id="main"><div id="admin-tabs"></div>
|
306
|
+
|
307
|
+
<%= yield %>
|
308
|
+
|
309
|
+
</section>
|
310
|
+
</div>
|
311
|
+
|
312
|
+
|
313
|
+
</body>
|
314
|
+
</html>
|
@@ -45,10 +45,17 @@ module Devcenter::Previewer
|
|
45
45
|
get '/:slug' do
|
46
46
|
log "Local article requested: #{params[:slug]}"
|
47
47
|
src_path = File.join(Dir.pwd, "#{params[:slug]}.md")
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
48
|
+
if File.exists?(src_path)
|
49
|
+
log "Parsing"
|
50
|
+
@article = parse_article(src_path)
|
51
|
+
@page_title = @article.metadata.title
|
52
|
+
log "Serving"
|
53
|
+
erb :article
|
54
|
+
else
|
55
|
+
@referrer_url = request.referrer
|
56
|
+
@page_title = 'Not found'
|
57
|
+
erb :not_found
|
58
|
+
end
|
52
59
|
end
|
53
60
|
|
54
61
|
def parse_article(src_path)
|
data/lib/devcenter/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: devcenter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.10
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2013-
|
13
|
+
date: 2013-03-01 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: listen
|
@@ -315,6 +315,8 @@ files:
|
|
315
315
|
- lib/devcenter/previewer/assets/public/toc-icon.png
|
316
316
|
- lib/devcenter/previewer/file_listener.rb
|
317
317
|
- lib/devcenter/previewer/views/article.erb
|
318
|
+
- lib/devcenter/previewer/views/layout.erb
|
319
|
+
- lib/devcenter/previewer/views/not_found.erb
|
318
320
|
- lib/devcenter/previewer/web_app.rb
|
319
321
|
- lib/devcenter/previewer/web_server.rb
|
320
322
|
- lib/devcenter/version.rb
|