hotdocs 0.3.0 → 0.4.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/lib/hotdocs/version.rb +1 -1
- data/lib/install/install.rb +14 -19
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 501f05b967f998d7e24a0e432fbea171fb233b1f7d5d7b2049b27443a44edb38
|
4
|
+
data.tar.gz: 4653cbbb44269bee42356a2f3c573aadcd15aae070762bac1ff383c11048bdcc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c30df6ded2bb0118268cfc6670990bb228932ad0ad87341b92fc4731cef2d461228abaecdb4af57e5e1274ac7a251a5536656334227eccb34475b6687cab7e9a
|
7
|
+
data.tar.gz: 71ce42eba20291d80db0346363ba3e51b75adb195469b3a2a6cfe9d3c8062f228c32f74935f27cf0b83257644839fe5ff9cd42b1a778aa2e7309945a925ba917
|
data/lib/hotdocs/version.rb
CHANGED
data/lib/install/install.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
def source_paths # used by
|
1
|
+
def source_paths # used by copy_file()
|
2
2
|
[ File.expand_path("../..", __dir__) ]
|
3
3
|
end
|
4
4
|
|
@@ -60,8 +60,8 @@ create_file(Pathname(destination_root).join("app/views/layouts/hotdocs.html.erb"
|
|
60
60
|
<%= content_for(:title, "HotDocs") unless content_for?(:title) %>
|
61
61
|
<meta name="viewport" content="width=device-width,initial-scale=1">
|
62
62
|
<%= stylesheet_link_tag "hotdocs/application" %>
|
63
|
-
<%= stylesheet_link_tag "
|
64
|
-
<%= stylesheet_link_tag "rouge" %>
|
63
|
+
<%= stylesheet_link_tag "hotdocs/base" %>
|
64
|
+
<%= stylesheet_link_tag "hotdocs/rouge" %>
|
65
65
|
<%= javascript_importmap_tags "hotdocs" %>
|
66
66
|
<% end %>
|
67
67
|
|
@@ -82,13 +82,16 @@ create_file(Pathname(destination_root).join("app/views/hotdocs/index.html.mderb"
|
|
82
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
83
|
FILE
|
84
84
|
|
85
|
-
|
85
|
+
empty_directory "app/assets/images/hotdocs"
|
86
|
+
copy_file("app/assets/images/hotdocs/icon.svg", Pathname(destination_root).join("app/assets/images/hotdocs/hotdocs.svg"))
|
87
|
+
|
88
|
+
route "get '/hotdocs', to: 'hotdocs#index'"
|
86
89
|
|
87
90
|
create_file(Pathname(destination_root).join("app/helpers/hotdocs_helper.rb"), <<~FILE)
|
88
91
|
module HotdocsHelper
|
89
92
|
# @return [Logo, nil]
|
90
93
|
def logo
|
91
|
-
Struct.new(:src, :alt).new(asset_path("hotdocs.svg"), "A humanized and happy hot dog")
|
94
|
+
Struct.new(:src, :alt).new(asset_path("hotdocs/hotdocs.svg"), "A humanized and happy hot dog")
|
92
95
|
end
|
93
96
|
|
94
97
|
def title
|
@@ -97,7 +100,7 @@ create_file(Pathname(destination_root).join("app/helpers/hotdocs_helper.rb"), <<
|
|
97
100
|
|
98
101
|
def nav_left_items(classes)
|
99
102
|
[
|
100
|
-
active_link_to("Docs",
|
103
|
+
active_link_to("Docs", hotdocs_path, class: Array(classes))
|
101
104
|
]
|
102
105
|
end
|
103
106
|
|
@@ -110,7 +113,7 @@ create_file(Pathname(destination_root).join("app/helpers/hotdocs_helper.rb"), <<
|
|
110
113
|
# { label: "", url: *_path, children: [], expanded: false/true }
|
111
114
|
def menu_items
|
112
115
|
[
|
113
|
-
{ label: "Welcome", url:
|
116
|
+
{ label: "Welcome", url: hotdocs_path },
|
114
117
|
]
|
115
118
|
end
|
116
119
|
|
@@ -153,7 +156,9 @@ create_file(Pathname(destination_root).join("app/helpers/hotdocs_helper.rb"), <<
|
|
153
156
|
end
|
154
157
|
FILE
|
155
158
|
|
156
|
-
|
159
|
+
empty_directory "app/assets/stylesheets/hotdocs"
|
160
|
+
|
161
|
+
create_file(Pathname(destination_root).join("app/assets/stylesheets/hotdocs/base.css"), <<~FILE)
|
157
162
|
:root {
|
158
163
|
--docs-code-background-color: #eee;
|
159
164
|
--docs-code-border-color: #00000022;
|
@@ -199,7 +204,7 @@ create_file(Pathname(destination_root).join("app/assets/stylesheets/website.css"
|
|
199
204
|
}
|
200
205
|
FILE
|
201
206
|
|
202
|
-
create_file(Pathname(destination_root).join("app/assets/stylesheets/rouge.css"), <<~FILE)
|
207
|
+
create_file(Pathname(destination_root).join("app/assets/stylesheets/hotdocs/rouge.css"), <<~FILE)
|
203
208
|
.article {
|
204
209
|
.highlight .hll { background-color: #6e7681 }
|
205
210
|
.highlight { background: #0d1117; color: #e6edf3 }
|
@@ -291,13 +296,3 @@ if Pathname(destination_root).join(".gitignore").exist?
|
|
291
296
|
append_to_file(".gitignore", %(\n/app/assets/builds/*\n!/app/assets/builds/.keep\n))
|
292
297
|
append_to_file(".gitignore", %(\n/node_modules/\n))
|
293
298
|
end
|
294
|
-
|
295
|
-
routes_path = Pathname(destination_root).join("config/routes.rb")
|
296
|
-
routes = File.readlines(routes_path)
|
297
|
-
unless routes.grep(/hotdocs#index/).any?
|
298
|
-
if routes.grep(/^\s*(?!#)root/).any?
|
299
|
-
route "get '/hotdocs', to: 'hotdocs#index'"
|
300
|
-
else
|
301
|
-
route "root to: 'hotdocs#index'"
|
302
|
-
end
|
303
|
-
end
|