hotdocs 0.2.0 → 0.3.0
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.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/app/assets/javascript/controllers/fetcher_controller.js +29 -0
- data/app/assets/javascript/controllers/search_controller.js +14 -7
- data/app/assets/stylesheets/hotdocs/application.css +57 -20
- data/app/helpers/hotdocs/application_helper.rb +12 -1
- data/app/views/layouts/hotdocs/application.html.erb +107 -82
- data/config/importmap.rb +1 -1
- data/lib/hotdocs/engine.rb +1 -2
- data/lib/hotdocs/kramdown_alerts.rb +92 -0
- data/lib/hotdocs/markdown.rb +21 -24
- data/lib/hotdocs/version.rb +1 -1
- data/lib/install/install.rb +163 -182
- data/lib/tasks/hotdocs_tasks.rake +3 -1
- metadata +47 -4
- data/lib/hotdocs/markdown.mjs +0 -177
data/lib/hotdocs/markdown.rb
CHANGED
@@ -1,31 +1,28 @@
|
|
1
|
-
require "
|
1
|
+
require "kramdown"
|
2
|
+
require "kramdown-parser-gfm"
|
3
|
+
require "rouge"
|
2
4
|
|
3
|
-
|
4
|
-
def self.prepare(engine)
|
5
|
-
# Install npm packages
|
6
|
-
# `capture3` raises if deno is not available
|
7
|
-
Open3.capture3("deno --allow-read --allow-env --node-modules-dir=auto #{engine.root.join("lib/hotdocs/markdown.mjs")}", stdin_data: "")
|
8
|
-
end
|
9
|
-
|
10
|
-
def initialize(engine)
|
11
|
-
@engine = engine
|
12
|
-
end
|
5
|
+
require_relative "kramdown_alerts"
|
13
6
|
|
7
|
+
class MarkdownHandler
|
14
8
|
def call(template, source)
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
# It won't look great, but better than nothing.
|
23
|
-
return <<~STRING
|
24
|
-
@output_buffer.safe_append='#{compiled}'.freeze;
|
25
|
-
@output_buffer
|
26
|
-
STRING
|
9
|
+
# If the template contains a `fetcher`, do not allow Rails to cache the page.
|
10
|
+
if source.match?(%r{<%= fetcher.* do %>})
|
11
|
+
ActionView::PathRegistry.all_resolvers.each do |resolver|
|
12
|
+
resolver.instance_eval do
|
13
|
+
@unbound_templates.delete(template.virtual_path)
|
14
|
+
end
|
15
|
+
end
|
27
16
|
end
|
28
17
|
|
18
|
+
compiled_template = ::HotdocsController.render(inline: source, handler: :erb)
|
19
|
+
out = Kramdown::Document.new(
|
20
|
+
compiled_template,
|
21
|
+
input: "GFM",
|
22
|
+
auto_ids: false,
|
23
|
+
syntax_highlighter_opts: { css_class: "highlight" }
|
24
|
+
).to_html
|
25
|
+
|
29
26
|
content_fors = ActionView::Template::Handlers::ERB
|
30
27
|
.new
|
31
28
|
.call(template, source)
|
@@ -34,7 +31,7 @@ class MarkdownHandler
|
|
34
31
|
|
35
32
|
<<~STRING
|
36
33
|
#{content_fors.join(";")}
|
37
|
-
@output_buffer.safe_append='#{out}'.freeze;
|
34
|
+
@output_buffer.safe_append='#{out.gsub("'", "\\\\'")}'.freeze;
|
38
35
|
@output_buffer
|
39
36
|
STRING
|
40
37
|
end
|
data/lib/hotdocs/version.rb
CHANGED
data/lib/install/install.rb
CHANGED
@@ -15,23 +15,18 @@ def gem?(name)
|
|
15
15
|
end
|
16
16
|
end
|
17
17
|
|
18
|
-
def pin
|
18
|
+
def pin(name)
|
19
19
|
importmap_path = Pathname(destination_root).join("config/importmap.rb")
|
20
20
|
|
21
21
|
regex = /pin ["']#{name}["']/
|
22
22
|
if File.readlines(importmap_path).grep(regex).any?
|
23
23
|
say "#{name} already pinned"
|
24
|
-
false
|
25
24
|
else
|
26
25
|
run("bin/importmap pin #{name}") || abort("Failed to pin #{name} to the importmap")
|
27
|
-
|
26
|
+
gsub_file importmap_path, /(pin ["']#{name}["'])(.*)/, '\1, preload: "hotdocs"\2'
|
28
27
|
end
|
29
28
|
end
|
30
29
|
|
31
|
-
unless system("command -v deno > /dev/null 2>&1")
|
32
|
-
abort "Install deno before running this task. Read more: https://deno.com"
|
33
|
-
end
|
34
|
-
|
35
30
|
if File.exist?("app/assets/config/manifest.js")
|
36
31
|
abort "Migrate to Propshaft before running this task. Read more: https://github.com/rails/propshaft/blob/main/UPGRADING.md#3-migrate-from-sprockets-to-propshaft"
|
37
32
|
end
|
@@ -40,27 +35,40 @@ gem?("importmap-rails") && run("bin/rails importmap:install")
|
|
40
35
|
gem?("turbo-rails") && run("bin/rails turbo:install")
|
41
36
|
gem?("stimulus-rails") && run("bin/rails stimulus:install")
|
42
37
|
|
43
|
-
|
38
|
+
create_file(Pathname(destination_root).join("app/javascript/hotdocs.js"), <<~FILE)
|
39
|
+
import "@hotwired/turbo-rails";
|
40
|
+
import "controllers";
|
44
41
|
|
45
|
-
|
42
|
+
import { application } from "controllers/application"
|
43
|
+
import { eagerLoadControllersFrom } from "@hotwired/stimulus-loading"
|
44
|
+
eagerLoadControllersFrom("hotdocs/controllers", application)
|
45
|
+
FILE
|
46
|
+
|
47
|
+
importmap_path = Pathname(destination_root).join("config/importmap.rb")
|
48
|
+
append_to_file(importmap_path, %(pin "hotdocs", preload: "hotdocs"\n))
|
49
|
+
pin("lunr")
|
50
|
+
|
51
|
+
create_file(Pathname(destination_root).join("app/controllers/hotdocs_controller.rb"), <<~FILE)
|
46
52
|
class HotdocsController < ApplicationController
|
47
53
|
helper Hotdocs::Engine.helpers
|
48
54
|
layout "hotdocs"
|
49
55
|
end
|
50
|
-
|
56
|
+
FILE
|
51
57
|
|
52
|
-
create_file(Pathname(destination_root).join("app/views/layouts/hotdocs.html.erb"), <<~
|
58
|
+
create_file(Pathname(destination_root).join("app/views/layouts/hotdocs.html.erb"), <<~FILE)
|
53
59
|
<% content_for :head do %>
|
54
60
|
<%= content_for(:title, "HotDocs") unless content_for?(:title) %>
|
55
61
|
<meta name="viewport" content="width=device-width,initial-scale=1">
|
56
|
-
<%= stylesheet_link_tag
|
57
|
-
<%=
|
62
|
+
<%= stylesheet_link_tag "hotdocs/application" %>
|
63
|
+
<%= stylesheet_link_tag "website" %>
|
64
|
+
<%= stylesheet_link_tag "rouge" %>
|
65
|
+
<%= javascript_importmap_tags "hotdocs" %>
|
58
66
|
<% end %>
|
59
67
|
|
60
68
|
<%= render template: "layouts/hotdocs/application" %>
|
61
|
-
|
69
|
+
FILE
|
62
70
|
|
63
|
-
create_file(Pathname(destination_root).join("app/views/hotdocs/index.html.mderb"), <<~
|
71
|
+
create_file(Pathname(destination_root).join("app/views/hotdocs/index.html.mderb"), <<~FILE)
|
64
72
|
<%= content_for(:title, "Welcome") %>
|
65
73
|
|
66
74
|
# Welcome to HotDocs
|
@@ -69,23 +77,24 @@ create_file(Pathname(destination_root).join("app/views/hotdocs/index.html.mderb"
|
|
69
77
|
|
70
78
|
## Todos
|
71
79
|
|
72
|
-
<input type="checkbox" id="first">
|
73
|
-
<label for="
|
74
|
-
<input type="checkbox" id="
|
75
|
-
|
76
|
-
<input type="checkbox" id="third">
|
77
|
-
<label for="third"> Maybe read the docs: <a href="https://hotdocsrails.com/" target="_blank">hotdocsrails.com</a></label>
|
78
|
-
VIEW
|
80
|
+
<input type="checkbox" id="first"><label for="first"> Update <code>app/views/layouts/hotdocs.html.erb</code></label>
|
81
|
+
<input type="checkbox" id="second"><label for="second"> Update <code>app/helpers/hotdocs_helper.rb</code></label>
|
82
|
+
<input type="checkbox" id="third"><label for="third"> Maybe read the docs: <a href="https://hotdocsrails.com/" target="_blank">hotdocsrails.com</a></label>
|
83
|
+
FILE
|
79
84
|
|
80
85
|
copy_file("app/assets/images/hotdocs/icon.svg", Pathname(destination_root).join("app/assets/images/hotdocs.svg"))
|
81
86
|
|
82
|
-
|
83
|
-
create_file(Pathname(destination_root).join("app/helpers/hotdocs_helper.rb"), <<~HELPER)
|
87
|
+
create_file(Pathname(destination_root).join("app/helpers/hotdocs_helper.rb"), <<~FILE)
|
84
88
|
module HotdocsHelper
|
89
|
+
# @return [Logo, nil]
|
85
90
|
def logo
|
86
91
|
Struct.new(:src, :alt).new(asset_path("hotdocs.svg"), "A humanized and happy hot dog")
|
87
92
|
end
|
88
93
|
|
94
|
+
def title
|
95
|
+
"HotDocs"
|
96
|
+
end
|
97
|
+
|
89
98
|
def nav_left_items(classes)
|
90
99
|
[
|
91
100
|
active_link_to("Docs", root_path, class: Array(classes))
|
@@ -137,172 +146,144 @@ create_file(Pathname(destination_root).join("app/helpers/hotdocs_helper.rb"), <<
|
|
137
146
|
}
|
138
147
|
]
|
139
148
|
end
|
140
|
-
end
|
141
|
-
HELPER
|
142
|
-
|
143
|
-
create_file(Pathname(destination_root).join("app/assets/stylesheets/prism.css"), <<~CSS)
|
144
|
-
/* Find more themes on: https://github.com/PrismJS/prism-themes */
|
145
|
-
|
146
|
-
/*
|
147
|
-
Darcula theme
|
148
|
-
|
149
|
-
Adapted from a theme based on:
|
150
|
-
IntelliJ Darcula Theme (https://github.com/bulenkov/Darcula)
|
151
|
-
|
152
|
-
@author Alexandre Paradis <service.paradis@gmail.com>
|
153
|
-
@version 1.0
|
154
|
-
*/
|
155
|
-
|
156
|
-
code[class*="language-"],
|
157
|
-
pre[class*="language-"] {
|
158
|
-
color: #a9b7c6;
|
159
|
-
font-family: Consolas, Monaco, 'Andale Mono', monospace;
|
160
|
-
direction: ltr;
|
161
|
-
text-align: left;
|
162
|
-
white-space: pre;
|
163
|
-
word-spacing: normal;
|
164
|
-
word-break: normal;
|
165
|
-
line-height: 1.5;
|
166
|
-
|
167
|
-
-moz-tab-size: 4;
|
168
|
-
-o-tab-size: 4;
|
169
|
-
tab-size: 4;
|
170
|
-
|
171
|
-
-webkit-hyphens: none;
|
172
|
-
-moz-hyphens: none;
|
173
|
-
-ms-hyphens: none;
|
174
|
-
hyphens: none;
|
175
|
-
}
|
176
|
-
|
177
|
-
pre[class*="language-"]::-moz-selection, pre[class*="language-"] ::-moz-selection,
|
178
|
-
code[class*="language-"]::-moz-selection, code[class*="language-"] ::-moz-selection {
|
179
|
-
color: inherit;
|
180
|
-
background: rgba(33, 66, 131, .85);
|
181
|
-
}
|
182
|
-
|
183
|
-
pre[class*="language-"]::selection, pre[class*="language-"] ::selection,
|
184
|
-
code[class*="language-"]::selection, code[class*="language-"] ::selection {
|
185
|
-
color: inherit;
|
186
|
-
background: rgba(33, 66, 131, .85);
|
187
|
-
}
|
188
|
-
|
189
|
-
/* Code blocks */
|
190
|
-
pre[class*="language-"] {
|
191
|
-
padding: 1em;
|
192
|
-
margin: .5em 0;
|
193
|
-
overflow: auto;
|
194
|
-
}
|
195
|
-
|
196
|
-
:not(pre) > code[class*="language-"],
|
197
|
-
pre[class*="language-"] {
|
198
|
-
background: #2b2b2b;
|
199
|
-
}
|
200
|
-
|
201
|
-
/* Inline code */
|
202
|
-
:not(pre) > code[class*="language-"] {
|
203
|
-
padding: .1em;
|
204
|
-
border-radius: .3em;
|
205
|
-
}
|
206
|
-
|
207
|
-
.token.comment,
|
208
|
-
.token.prolog,
|
209
|
-
.token.cdata {
|
210
|
-
color: #808080;
|
211
|
-
}
|
212
|
-
|
213
|
-
.token.delimiter,
|
214
|
-
.token.boolean,
|
215
|
-
.token.keyword,
|
216
|
-
.token.selector,
|
217
|
-
.token.important,
|
218
|
-
.token.atrule {
|
219
|
-
color: #cc7832;
|
220
|
-
}
|
221
|
-
|
222
|
-
.token.operator,
|
223
|
-
.token.punctuation,
|
224
|
-
.token.attr-name {
|
225
|
-
color: #a9b7c6;
|
226
|
-
}
|
227
149
|
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
}
|
234
|
-
|
235
|
-
.token.entity,
|
236
|
-
.token.number,
|
237
|
-
.token.symbol {
|
238
|
-
color: #6897bb;
|
239
|
-
}
|
240
|
-
|
241
|
-
.token.property,
|
242
|
-
.token.constant,
|
243
|
-
.token.variable {
|
244
|
-
color: #9876aa;
|
245
|
-
}
|
246
|
-
|
247
|
-
.token.string,
|
248
|
-
.token.char {
|
249
|
-
color: #6a8759;
|
250
|
-
}
|
251
|
-
|
252
|
-
.token.attr-value,
|
253
|
-
.token.attr-value .punctuation {
|
254
|
-
color: #a5c261;
|
255
|
-
}
|
256
|
-
|
257
|
-
.token.attr-value .punctuation:first-child {
|
258
|
-
color: #a9b7c6;
|
259
|
-
}
|
260
|
-
|
261
|
-
.token.url {
|
262
|
-
color: #287bde;
|
263
|
-
text-decoration: underline;
|
264
|
-
}
|
265
|
-
|
266
|
-
.token.function {
|
267
|
-
color: #ffc66d;
|
268
|
-
}
|
269
|
-
|
270
|
-
.token.regex {
|
271
|
-
background: #364135;
|
272
|
-
}
|
273
|
-
|
274
|
-
.token.bold {
|
275
|
-
font-weight: bold;
|
276
|
-
}
|
277
|
-
|
278
|
-
.token.italic {
|
279
|
-
font-style: italic;
|
280
|
-
}
|
281
|
-
|
282
|
-
.token.inserted {
|
283
|
-
background: #294436;
|
284
|
-
}
|
150
|
+
def fetcher_host
|
151
|
+
"http://127.0.0.1:3000"
|
152
|
+
end
|
153
|
+
end
|
154
|
+
FILE
|
285
155
|
|
286
|
-
|
287
|
-
|
156
|
+
create_file(Pathname(destination_root).join("app/assets/stylesheets/website.css"), <<~FILE)
|
157
|
+
:root {
|
158
|
+
--docs-code-background-color: #eee;
|
159
|
+
--docs-code-border-color: #00000022;
|
160
|
+
--docs-text-color: #1c1e21;
|
288
161
|
}
|
289
162
|
|
290
|
-
|
291
|
-
|
292
|
-
color: #
|
163
|
+
[data-theme=dark]:root {
|
164
|
+
--docs-code-background-color: #2b2b2b;
|
165
|
+
--docs-code-border-color: #ffffff22;
|
166
|
+
--docs-text-color: #e3e1de;
|
293
167
|
}
|
294
168
|
|
295
|
-
|
296
|
-
color:
|
169
|
+
.article {
|
170
|
+
color: var(--docs-text-color);
|
171
|
+
|
172
|
+
a {
|
173
|
+
color: var(--docs-text-color);
|
174
|
+
|
175
|
+
&:has(code) {
|
176
|
+
text-underline-position: under;
|
177
|
+
text-decoration-thickness: 1px;
|
178
|
+
}
|
179
|
+
}
|
180
|
+
|
181
|
+
pre {
|
182
|
+
-webkit-overflow-scrolling: touch;
|
183
|
+
border-radius: .375rem;
|
184
|
+
box-sizing: border-box;
|
185
|
+
overflow-x: auto;
|
186
|
+
width: 100%;
|
187
|
+
}
|
188
|
+
|
189
|
+
code:not(pre code) {
|
190
|
+
background: var(--docs-code-background-color);
|
191
|
+
border-radius: 0.375rem;
|
192
|
+
border: .1rem solid var(--docs-code-border-color);
|
193
|
+
display: inline;
|
194
|
+
overflow-x: auto;
|
195
|
+
overflow: auto;
|
196
|
+
padding: 0.1rem 0.2rem;
|
197
|
+
word-break: break-word;
|
198
|
+
}
|
297
199
|
}
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
color: #
|
200
|
+
FILE
|
201
|
+
|
202
|
+
create_file(Pathname(destination_root).join("app/assets/stylesheets/rouge.css"), <<~FILE)
|
203
|
+
.article {
|
204
|
+
.highlight .hll { background-color: #6e7681 }
|
205
|
+
.highlight { background: #0d1117; color: #e6edf3 }
|
206
|
+
.highlight .c { color: #8b949e; font-style: italic } /* Comment */
|
207
|
+
.highlight .err { color: #f85149 } /* Error */
|
208
|
+
.highlight .esc { color: #e6edf3 } /* Escape */
|
209
|
+
.highlight .g { color: #e6edf3 } /* Generic */
|
210
|
+
.highlight .k { color: #ff7b72 } /* Keyword */
|
211
|
+
.highlight .l { color: #a5d6ff } /* Literal */
|
212
|
+
.highlight .n { color: #e6edf3 } /* Name */
|
213
|
+
.highlight .o { color: #ff7b72; font-weight: bold } /* Operator */
|
214
|
+
.highlight .x { color: #e6edf3 } /* Other */
|
215
|
+
.highlight .p { color: #e6edf3 } /* Punctuation */
|
216
|
+
.highlight .ch { color: #8b949e; font-style: italic } /* Comment.Hashbang */
|
217
|
+
.highlight .cm { color: #8b949e; font-style: italic } /* Comment.Multiline */
|
218
|
+
.highlight .cp { color: #8b949e; font-weight: bold; font-style: italic } /* Comment.Preproc */
|
219
|
+
.highlight .cpf { color: #8b949e; font-style: italic } /* Comment.PreprocFile */
|
220
|
+
.highlight .c1 { color: #8b949e; font-style: italic } /* Comment.Single */
|
221
|
+
.highlight .cs { color: #8b949e; font-weight: bold; font-style: italic } /* Comment.Special */
|
222
|
+
.highlight .gd { color: #ffa198; background-color: #490202 } /* Generic.Deleted */
|
223
|
+
.highlight .ge { color: #e6edf3; font-style: italic } /* Generic.Emph */
|
224
|
+
.highlight .ges { color: #e6edf3; font-weight: bold; font-style: italic } /* Generic.EmphStrong */
|
225
|
+
.highlight .gr { color: #ffa198 } /* Generic.Error */
|
226
|
+
.highlight .gh { color: #79c0ff; font-weight: bold } /* Generic.Heading */
|
227
|
+
.highlight .gi { color: #56d364; background-color: #0f5323 } /* Generic.Inserted */
|
228
|
+
.highlight .go { color: #8b949e } /* Generic.Output */
|
229
|
+
.highlight .gp { color: #8b949e } /* Generic.Prompt */
|
230
|
+
.highlight .gs { color: #e6edf3; font-weight: bold } /* Generic.Strong */
|
231
|
+
.highlight .gu { color: #79c0ff } /* Generic.Subheading */
|
232
|
+
.highlight .gt { color: #ff7b72 } /* Generic.Traceback */
|
233
|
+
.highlight .g-Underline { color: #e6edf3; text-decoration: underline } /* Generic.Underline */
|
234
|
+
.highlight .kc { color: #79c0ff } /* Keyword.Constant */
|
235
|
+
.highlight .kd { color: #ff7b72 } /* Keyword.Declaration */
|
236
|
+
.highlight .kn { color: #ff7b72 } /* Keyword.Namespace */
|
237
|
+
.highlight .kp { color: #79c0ff } /* Keyword.Pseudo */
|
238
|
+
.highlight .kr { color: #ff7b72 } /* Keyword.Reserved */
|
239
|
+
.highlight .kt { color: #ff7b72 } /* Keyword.Type */
|
240
|
+
.highlight .ld { color: #79c0ff } /* Literal.Date */
|
241
|
+
.highlight .m { color: #a5d6ff } /* Literal.Number */
|
242
|
+
.highlight .s { color: #a5d6ff } /* Literal.String */
|
243
|
+
.highlight .na { color: #e6edf3 } /* Name.Attribute */
|
244
|
+
.highlight .nb { color: #e6edf3 } /* Name.Builtin */
|
245
|
+
.highlight .nc { color: #f0883e; font-weight: bold } /* Name.Class */
|
246
|
+
.highlight .no { color: #79c0ff; font-weight: bold } /* Name.Constant */
|
247
|
+
.highlight .nd { color: #d2a8ff; font-weight: bold } /* Name.Decorator */
|
248
|
+
.highlight .ni { color: #ffa657 } /* Name.Entity */
|
249
|
+
.highlight .ne { color: #f0883e; font-weight: bold } /* Name.Exception */
|
250
|
+
.highlight .nf { color: #d2a8ff; font-weight: bold } /* Name.Function */
|
251
|
+
.highlight .nl { color: #79c0ff; font-weight: bold } /* Name.Label */
|
252
|
+
.highlight .nn { color: #ff7b72 } /* Name.Namespace */
|
253
|
+
.highlight .nx { color: #e6edf3 } /* Name.Other */
|
254
|
+
.highlight .py { color: #79c0ff } /* Name.Property */
|
255
|
+
.highlight .nt { color: #7ee787 } /* Name.Tag */
|
256
|
+
.highlight .nv { color: #79c0ff } /* Name.Variable */
|
257
|
+
.highlight .ow { color: #ff7b72; font-weight: bold } /* Operator.Word */
|
258
|
+
.highlight .pm { color: #e6edf3 } /* Punctuation.Marker */
|
259
|
+
.highlight .w { color: #6e7681 } /* Text.Whitespace */
|
260
|
+
.highlight .mb { color: #a5d6ff } /* Literal.Number.Bin */
|
261
|
+
.highlight .mf { color: #a5d6ff } /* Literal.Number.Float */
|
262
|
+
.highlight .mh { color: #a5d6ff } /* Literal.Number.Hex */
|
263
|
+
.highlight .mi { color: #a5d6ff } /* Literal.Number.Integer */
|
264
|
+
.highlight .mo { color: #a5d6ff } /* Literal.Number.Oct */
|
265
|
+
.highlight .sa { color: #79c0ff } /* Literal.String.Affix */
|
266
|
+
.highlight .sb { color: #a5d6ff } /* Literal.String.Backtick */
|
267
|
+
.highlight .sc { color: #a5d6ff } /* Literal.String.Char */
|
268
|
+
.highlight .dl { color: #79c0ff } /* Literal.String.Delimiter */
|
269
|
+
.highlight .sd { color: #a5d6ff } /* Literal.String.Doc */
|
270
|
+
.highlight .s2 { color: #a5d6ff } /* Literal.String.Double */
|
271
|
+
.highlight .se { color: #79c0ff } /* Literal.String.Escape */
|
272
|
+
.highlight .sh { color: #79c0ff } /* Literal.String.Heredoc */
|
273
|
+
.highlight .si { color: #a5d6ff } /* Literal.String.Interpol */
|
274
|
+
.highlight .sx { color: #a5d6ff } /* Literal.String.Other */
|
275
|
+
.highlight .sr { color: #79c0ff } /* Literal.String.Regex */
|
276
|
+
.highlight .s1 { color: #a5d6ff } /* Literal.String.Single */
|
277
|
+
.highlight .ss { color: #a5d6ff } /* Literal.String.Symbol */
|
278
|
+
.highlight .bp { color: #e6edf3 } /* Name.Builtin.Pseudo */
|
279
|
+
.highlight .fm { color: #d2a8ff; font-weight: bold } /* Name.Function.Magic */
|
280
|
+
.highlight .vc { color: #79c0ff } /* Name.Variable.Class */
|
281
|
+
.highlight .vg { color: #79c0ff } /* Name.Variable.Global */
|
282
|
+
.highlight .vi { color: #79c0ff } /* Name.Variable.Instance */
|
283
|
+
.highlight .vm { color: #79c0ff } /* Name.Variable.Magic */
|
284
|
+
.highlight .il { color: #a5d6ff } /* Literal.Number.Integer.Long */
|
304
285
|
}
|
305
|
-
|
286
|
+
FILE
|
306
287
|
|
307
288
|
empty_directory "app/assets/builds"
|
308
289
|
keep_file "app/assets/builds"
|
@@ -75,7 +75,9 @@ def render_search_data
|
|
75
75
|
end
|
76
76
|
|
77
77
|
def render_path(path)
|
78
|
-
|
78
|
+
base = ENV.fetch("RAILS_RELATIVE_URL_ROOT", "")
|
79
|
+
baseless_path = path.sub(/\A#{base}/, "")
|
80
|
+
controller, action = Rails.application.routes.recognize_path(baseless_path).values_at(:controller, :action)
|
79
81
|
render_to_string("#{controller}/#{action}", layout: false)
|
80
82
|
rescue ActionController::RoutingError => error
|
81
83
|
logger.info("Skipped building #{path}: #{error}")
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hotdocs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- 3v0k4
|
8
8
|
bindir: bin
|
9
9
|
cert_chain: []
|
10
|
-
date:
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
11
11
|
dependencies:
|
12
12
|
- !ruby/object:Gem::Dependency
|
13
13
|
name: rails
|
@@ -23,6 +23,48 @@ dependencies:
|
|
23
23
|
- - ">="
|
24
24
|
- !ruby/object:Gem::Version
|
25
25
|
version: 7.1.0
|
26
|
+
- !ruby/object:Gem::Dependency
|
27
|
+
name: kramdown
|
28
|
+
requirement: !ruby/object:Gem::Requirement
|
29
|
+
requirements:
|
30
|
+
- - "~>"
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '2.5'
|
33
|
+
type: :runtime
|
34
|
+
prerelease: false
|
35
|
+
version_requirements: !ruby/object:Gem::Requirement
|
36
|
+
requirements:
|
37
|
+
- - "~>"
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
version: '2.5'
|
40
|
+
- !ruby/object:Gem::Dependency
|
41
|
+
name: kramdown-parser-gfm
|
42
|
+
requirement: !ruby/object:Gem::Requirement
|
43
|
+
requirements:
|
44
|
+
- - ">="
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: '0'
|
47
|
+
type: :runtime
|
48
|
+
prerelease: false
|
49
|
+
version_requirements: !ruby/object:Gem::Requirement
|
50
|
+
requirements:
|
51
|
+
- - ">="
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '0'
|
54
|
+
- !ruby/object:Gem::Dependency
|
55
|
+
name: rouge
|
56
|
+
requirement: !ruby/object:Gem::Requirement
|
57
|
+
requirements:
|
58
|
+
- - "~>"
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
version: '4.5'
|
61
|
+
type: :runtime
|
62
|
+
prerelease: false
|
63
|
+
version_requirements: !ruby/object:Gem::Requirement
|
64
|
+
requirements:
|
65
|
+
- - "~>"
|
66
|
+
- !ruby/object:Gem::Version
|
67
|
+
version: '4.5'
|
26
68
|
description: HotDocs is a set of optimized Rails components & tools for writing docs.
|
27
69
|
email:
|
28
70
|
- riccardo.odone@gmail.com
|
@@ -36,6 +78,7 @@ files:
|
|
36
78
|
- Rakefile
|
37
79
|
- app/assets/images/hotdocs/icon.svg
|
38
80
|
- app/assets/javascript/controllers/accordion_controller.js
|
81
|
+
- app/assets/javascript/controllers/fetcher_controller.js
|
39
82
|
- app/assets/javascript/controllers/search_controller.js
|
40
83
|
- app/assets/javascript/controllers/sidenav_controller.js
|
41
84
|
- app/assets/javascript/controllers/toc_controller.js
|
@@ -47,7 +90,7 @@ files:
|
|
47
90
|
- config/importmap.rb
|
48
91
|
- lib/hotdocs.rb
|
49
92
|
- lib/hotdocs/engine.rb
|
50
|
-
- lib/hotdocs/
|
93
|
+
- lib/hotdocs/kramdown_alerts.rb
|
51
94
|
- lib/hotdocs/markdown.rb
|
52
95
|
- lib/hotdocs/version.rb
|
53
96
|
- lib/install/install.rb
|
@@ -75,7 +118,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
75
118
|
- !ruby/object:Gem::Version
|
76
119
|
version: '0'
|
77
120
|
requirements: []
|
78
|
-
rubygems_version: 3.6.
|
121
|
+
rubygems_version: 3.6.9
|
79
122
|
specification_version: 4
|
80
123
|
summary: Write your docs with Ruby on Rails
|
81
124
|
test_files: []
|