hot_docs 0.0.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 +7 -0
- data/.rubocop.yml +8 -0
- data/CHANGELOG.md +5 -0
- data/LICENSE.txt +21 -0
- data/README.md +39 -0
- data/Rakefile +12 -0
- data/lib/hot_docs/version.rb +5 -0
- data/lib/hot_docs.rb +8 -0
- data/sig/hot_docs.rbs +4 -0
- data/website/.dockerignore +51 -0
- data/website/.gitattributes +9 -0
- data/website/.github/dependabot.yml +12 -0
- data/website/.github/images/hot_docs.svg +17 -0
- data/website/.github/workflows/ci.yml +90 -0
- data/website/.gitignore +37 -0
- data/website/.kamal/hooks/docker-setup.sample +3 -0
- data/website/.kamal/hooks/post-deploy.sample +14 -0
- data/website/.kamal/hooks/post-proxy-reboot.sample +3 -0
- data/website/.kamal/hooks/pre-build.sample +51 -0
- data/website/.kamal/hooks/pre-connect.sample +47 -0
- data/website/.kamal/hooks/pre-deploy.sample +109 -0
- data/website/.kamal/hooks/pre-proxy-reboot.sample +3 -0
- data/website/.kamal/secrets +17 -0
- data/website/.rubocop.yml +8 -0
- data/website/.ruby-version +1 -0
- data/website/Dockerfile +72 -0
- data/website/Gemfile +65 -0
- data/website/Gemfile.lock +394 -0
- data/website/LICENSE.txt +21 -0
- data/website/README.md +49 -0
- data/website/Rakefile +6 -0
- data/website/app/assets/images/.keep +0 -0
- data/website/app/assets/images/hot_docs_components_desktop.png +0 -0
- data/website/app/assets/images/hot_docs_components_mobile.png +0 -0
- data/website/app/assets/stylesheets/hot_docs.css +999 -0
- data/website/app/assets/stylesheets/website.css +245 -0
- data/website/app/controllers/application_controller.rb +4 -0
- data/website/app/controllers/concerns/.keep +0 -0
- data/website/app/controllers/hot_docs_controller.rb +3 -0
- data/website/app/helpers/application_helper.rb +25 -0
- data/website/app/helpers/hot_docs_helper.rb +99 -0
- data/website/app/javascript/application.js +3 -0
- data/website/app/javascript/controllers/accordion_controller.js +36 -0
- data/website/app/javascript/controllers/application.js +9 -0
- data/website/app/javascript/controllers/index.js +4 -0
- data/website/app/javascript/controllers/sidenav_controller.js +39 -0
- data/website/app/javascript/controllers/toc_controller.js +91 -0
- data/website/app/javascript/controllers/typewriter_controller.js +59 -0
- data/website/app/jobs/application_job.rb +7 -0
- data/website/app/mailers/application_mailer.rb +4 -0
- data/website/app/models/application_record.rb +3 -0
- data/website/app/models/concerns/.keep +0 -0
- data/website/app/views/hot_docs/_menu_row.html.erb +11 -0
- data/website/app/views/hot_docs/components.html.mderb +32 -0
- data/website/app/views/hot_docs/embedded.html.mderb +12 -0
- data/website/app/views/hot_docs/footer.html.mderb +13 -0
- data/website/app/views/hot_docs/helpers.html.mderb +33 -0
- data/website/app/views/hot_docs/index.html.erb +143 -0
- data/website/app/views/hot_docs/light_dark.html.mderb +29 -0
- data/website/app/views/hot_docs/markdown.html.mderb +27 -0
- data/website/app/views/hot_docs/nav.html.mderb +15 -0
- data/website/app/views/hot_docs/quickstart.html.mderb +11 -0
- data/website/app/views/hot_docs/search.html.mderb +7 -0
- data/website/app/views/hot_docs/standalone.html.mderb +11 -0
- data/website/app/views/hot_docs/static_export.html.mderb +7 -0
- data/website/app/views/hot_docs/toc.html.mderb +11 -0
- data/website/app/views/layouts/hot_docs.html.erb +175 -0
- data/website/app/views/layouts/mailer.html.erb +13 -0
- data/website/app/views/layouts/mailer.text.erb +1 -0
- data/website/app/views/layouts/website.html.erb +175 -0
- data/website/app/views/pwa/manifest.json.erb +22 -0
- data/website/app/views/pwa/service-worker.js +26 -0
- data/website/bin/brakeman +7 -0
- data/website/bin/bundle +109 -0
- data/website/bin/dev +2 -0
- data/website/bin/docker-entrypoint +14 -0
- data/website/bin/embed_hot_docs +33 -0
- data/website/bin/importmap +4 -0
- data/website/bin/jobs +6 -0
- data/website/bin/kamal +27 -0
- data/website/bin/rails +4 -0
- data/website/bin/rake +4 -0
- data/website/bin/rubocop +8 -0
- data/website/bin/setup +34 -0
- data/website/bin/thrust +5 -0
- data/website/config/application.rb +27 -0
- data/website/config/boot.rb +4 -0
- data/website/config/cable.yml +17 -0
- data/website/config/cache.yml +16 -0
- data/website/config/credentials.yml.enc +1 -0
- data/website/config/database.yml +41 -0
- data/website/config/deploy.yml +116 -0
- data/website/config/environment.rb +5 -0
- data/website/config/environments/development.rb +72 -0
- data/website/config/environments/production.rb +90 -0
- data/website/config/environments/test.rb +53 -0
- data/website/config/importmap.rb +7 -0
- data/website/config/initializers/assets.rb +7 -0
- data/website/config/initializers/content_security_policy.rb +25 -0
- data/website/config/initializers/filter_parameter_logging.rb +8 -0
- data/website/config/initializers/inflections.rb +16 -0
- data/website/config/initializers/markdown.mjs +26 -0
- data/website/config/initializers/markdown.rb +35 -0
- data/website/config/locales/en.yml +31 -0
- data/website/config/puma.rb +41 -0
- data/website/config/queue.yml +18 -0
- data/website/config/recurring.yml +10 -0
- data/website/config/routes.rb +28 -0
- data/website/config/storage.yml +34 -0
- data/website/config.ru +6 -0
- data/website/db/cable_schema.rb +11 -0
- data/website/db/cache_schema.rb +14 -0
- data/website/db/queue_schema.rb +129 -0
- data/website/db/seeds.rb +9 -0
- data/website/lib/tasks/.keep +0 -0
- data/website/log/.keep +0 -0
- data/website/public/400.html +114 -0
- data/website/public/404.html +114 -0
- data/website/public/406-unsupported-browser.html +114 -0
- data/website/public/422.html +114 -0
- data/website/public/500.html +114 -0
- data/website/public/apple-touch-icon.png +0 -0
- data/website/public/favicon.ico +0 -0
- data/website/public/hot_docs.svg +17 -0
- data/website/public/robots.txt +1 -0
- data/website/script/.keep +0 -0
- data/website/storage/.keep +0 -0
- data/website/test/application_system_test_case.rb +5 -0
- data/website/test/controllers/.keep +0 -0
- data/website/test/fixtures/files/.keep +0 -0
- data/website/test/helpers/.keep +0 -0
- data/website/test/helpers/hot_docs_helper_test.rb +94 -0
- data/website/test/integration/.keep +0 -0
- data/website/test/mailers/.keep +0 -0
- data/website/test/models/.keep +0 -0
- data/website/test/system/.keep +0 -0
- data/website/test/test_helper.rb +15 -0
- data/website/tmp/.keep +0 -0
- data/website/tmp/pids/.keep +0 -0
- data/website/tmp/storage/.keep +0 -0
- data/website/vendor/.keep +0 -0
- data/website/vendor/javascript/.keep +0 -0
- metadata +183 -0
@@ -0,0 +1,175 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html data-theme="light">
|
3
|
+
<head>
|
4
|
+
<title><%= content_for(:title) || "HotDocs" %></title>
|
5
|
+
<meta name="viewport" content="width=device-width,initial-scale=1">
|
6
|
+
<meta name="apple-mobile-web-app-capable" content="yes">
|
7
|
+
<meta name="mobile-web-app-capable" content="yes">
|
8
|
+
<%= csrf_meta_tags %>
|
9
|
+
<%= csp_meta_tag %>
|
10
|
+
|
11
|
+
<%= yield :head %>
|
12
|
+
|
13
|
+
<%# Enable PWA manifest for installable apps (make sure to enable in config/routes.rb too!) %>
|
14
|
+
<%#= tag.link rel: "manifest", href: pwa_manifest_path(format: :json) %>
|
15
|
+
|
16
|
+
<!-- favicons generated with the favicon_factory gem -->
|
17
|
+
<link rel="icon" href="/hot_docs.svg" type="image/svg+xml">
|
18
|
+
<link rel="icon" href="/favicon.ico" sizes="32x32">
|
19
|
+
<link rel="apple-touch-icon" href="/apple-touch-icon.png">
|
20
|
+
|
21
|
+
<%# Includes all stylesheet files in app/assets/stylesheets %>
|
22
|
+
<%= stylesheet_link_tag :app, "data-turbo-track": "reload" %>
|
23
|
+
<%= javascript_importmap_tags %>
|
24
|
+
</head>
|
25
|
+
|
26
|
+
<body>
|
27
|
+
<nav class="nav" data-controller="sidenav" data-sidenav-open-class-value="sidenav--open" data-sidenav-main-section-class-value="sidenav__sections--main">
|
28
|
+
<div class="nav__section">
|
29
|
+
<button class="nav__toggle" type="button" aria-label="Toggle navigation" aria-expanded="false" data-action="click->sidenav#open">
|
30
|
+
<svg viewBox="0 0 30 30" aria-hidden="true">
|
31
|
+
<path stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2" d="M4 7h22M4 15h22M4 23h22"></path>
|
32
|
+
</svg>
|
33
|
+
</button>
|
34
|
+
|
35
|
+
<%= link_to root_path, class: "nav__brand" do %>
|
36
|
+
<div class="nav__logo-wrapper">
|
37
|
+
<img class="nav__logo" src="/hot_docs.svg" alt="A humanized and happy hot dog" height="32" width="32" />
|
38
|
+
</div>
|
39
|
+
|
40
|
+
<span class="nav__title">HotDocs</span>
|
41
|
+
<% end %>
|
42
|
+
|
43
|
+
<div class="nav__links">
|
44
|
+
<% nav_left_items("nav__link").each do |item| %>
|
45
|
+
<%= item %>
|
46
|
+
<% end %>
|
47
|
+
</div>
|
48
|
+
</div>
|
49
|
+
|
50
|
+
<div class="nav__section">
|
51
|
+
<div class="nav__links">
|
52
|
+
<% nav_right_items("nav__link").each do |item| %>
|
53
|
+
<%= item %>
|
54
|
+
<% end %>
|
55
|
+
</div>
|
56
|
+
</div>
|
57
|
+
|
58
|
+
<div class="sidenav-backdrop"></div>
|
59
|
+
<div class="sidenav">
|
60
|
+
<div class="sidenav__header">
|
61
|
+
<%= link_to root_path, class: "nav__brand" do %>
|
62
|
+
<div class="nav__logo-wrapper">
|
63
|
+
<img class="nav__logo" src="/hot_docs.svg" alt="A humanized and happy hot dog" height="32" width="32" />
|
64
|
+
</div>
|
65
|
+
|
66
|
+
<span class="nav__title">HotDocs</span>
|
67
|
+
<% end %>
|
68
|
+
|
69
|
+
<button aria-label="Close navigation" class="sidenav__toggle" type="button" data-action="click->sidenav#close">
|
70
|
+
<svg viewBox="0 0 15 15">
|
71
|
+
<g stroke="currentColor" stroke-width="1.2">
|
72
|
+
<path d="M.75.75l13.5 13.5M14.25.75L.75 14.25"></path>
|
73
|
+
</g>
|
74
|
+
</svg>
|
75
|
+
</button>
|
76
|
+
</div>
|
77
|
+
|
78
|
+
<div class="sidenav__sections" data-sidenav-target="sections">
|
79
|
+
<div class="sidenav__section">
|
80
|
+
<ul class="menu__section">
|
81
|
+
<% (nav_left_items("menu__link") + nav_right_items("menu__link")).each do |item| %>
|
82
|
+
<li>
|
83
|
+
<div class="menu__row">
|
84
|
+
<%= item %>
|
85
|
+
</div>
|
86
|
+
</li>
|
87
|
+
<% end %>
|
88
|
+
</ul>
|
89
|
+
</div>
|
90
|
+
|
91
|
+
<div class="sidenav__section">
|
92
|
+
<div class="menu__section">
|
93
|
+
<button type="button" class="sidenav__back-button" data-action="click->sidenav#back">← Back to main menu</button>
|
94
|
+
</div>
|
95
|
+
|
96
|
+
<%= menu(website_menu_items) %>
|
97
|
+
</div>
|
98
|
+
</div>
|
99
|
+
</div>
|
100
|
+
</nav>
|
101
|
+
|
102
|
+
<div class="content">
|
103
|
+
<aside class="menu">
|
104
|
+
<div class="menu__sections">
|
105
|
+
<%= menu(website_menu_items) %>
|
106
|
+
</div>
|
107
|
+
</aside>
|
108
|
+
|
109
|
+
<main data-controller="toc" class="main">
|
110
|
+
<div class="central">
|
111
|
+
<details name="toc" class="toc">
|
112
|
+
<summary class="toc__label">Table of contents</summary>
|
113
|
+
|
114
|
+
<ul class="toc__entries" data-toc-target="toc">
|
115
|
+
<template data-toc-target="tocTemplate">
|
116
|
+
<li><a id class="toc__link" href></a></li>
|
117
|
+
</template>
|
118
|
+
</ul>
|
119
|
+
</details>
|
120
|
+
|
121
|
+
<article class="article" data-toc-target="article">
|
122
|
+
<%= yield %>
|
123
|
+
</article>
|
124
|
+
</div>
|
125
|
+
|
126
|
+
<div class="sidetoc">
|
127
|
+
<ul class="sidetoc__entries" data-toc-target="sidetoc">
|
128
|
+
<template data-toc-target="sidetocTemplate">
|
129
|
+
<li><a id class="sidetoc__link" href></a></li>
|
130
|
+
</template>
|
131
|
+
</ul>
|
132
|
+
</div>
|
133
|
+
</main>
|
134
|
+
</div>
|
135
|
+
|
136
|
+
<footer class="footer">
|
137
|
+
<div class="footer__sections">
|
138
|
+
<div class="footer__section">
|
139
|
+
<p class="footer__heading">Contribute</p>
|
140
|
+
|
141
|
+
<ul>
|
142
|
+
<li><%= external_link_to "Source Code", "https://github.com/3v0k4/hot_docs", class: "footer__link" %></li>
|
143
|
+
</ul>
|
144
|
+
</div>
|
145
|
+
|
146
|
+
<div class="footer__section">
|
147
|
+
<p class="footer__heading">Community</p>
|
148
|
+
|
149
|
+
<ul>
|
150
|
+
<li><%= external_link_to "GitHub Discussions", "https://github.com/3v0k4/hot_docs/discussions", class: "footer__link" %></li>
|
151
|
+
</ul>
|
152
|
+
</div>
|
153
|
+
|
154
|
+
<div class="footer__section">
|
155
|
+
<p class="footer__heading">(il)Legal</p>
|
156
|
+
|
157
|
+
<ul>
|
158
|
+
<li>Nothing to see here.</li>
|
159
|
+
</ul>
|
160
|
+
</div>
|
161
|
+
|
162
|
+
<div class="footer__section">
|
163
|
+
<p class="footer__heading">HotDocs</p>
|
164
|
+
|
165
|
+
<p>Write your docs with Ruby on Rails.</p>
|
166
|
+
</div>
|
167
|
+
</div>
|
168
|
+
|
169
|
+
<img class="footer__logo" src="/hot_docs.svg" alt="A humanized and happy hot dog" height="150" width="150" />
|
170
|
+
|
171
|
+
<!-- Buy a license to remove the credits -->
|
172
|
+
<p class="credits">Built with Rails & <a class="credits__link" href="https://hotdocsrails.com">HotDocs<img class="credits__logo" src="/hot_docs.svg" alt="A humanized and happy hot dog" height="32" width="32" /></a></p>
|
173
|
+
</footer>
|
174
|
+
</body>
|
175
|
+
</html>
|
@@ -0,0 +1,22 @@
|
|
1
|
+
{
|
2
|
+
"name": "HotDocs",
|
3
|
+
"icons": [
|
4
|
+
{
|
5
|
+
"src": "/icon.png",
|
6
|
+
"type": "image/png",
|
7
|
+
"sizes": "512x512"
|
8
|
+
},
|
9
|
+
{
|
10
|
+
"src": "/icon.png",
|
11
|
+
"type": "image/png",
|
12
|
+
"sizes": "512x512",
|
13
|
+
"purpose": "maskable"
|
14
|
+
}
|
15
|
+
],
|
16
|
+
"start_url": "/",
|
17
|
+
"display": "standalone",
|
18
|
+
"scope": "/",
|
19
|
+
"description": "HotDocs.",
|
20
|
+
"theme_color": "red",
|
21
|
+
"background_color": "red"
|
22
|
+
}
|
@@ -0,0 +1,26 @@
|
|
1
|
+
// Add a service worker for processing Web Push notifications:
|
2
|
+
//
|
3
|
+
// self.addEventListener("push", async (event) => {
|
4
|
+
// const { title, options } = await event.data.json()
|
5
|
+
// event.waitUntil(self.registration.showNotification(title, options))
|
6
|
+
// })
|
7
|
+
//
|
8
|
+
// self.addEventListener("notificationclick", function(event) {
|
9
|
+
// event.notification.close()
|
10
|
+
// event.waitUntil(
|
11
|
+
// clients.matchAll({ type: "window" }).then((clientList) => {
|
12
|
+
// for (let i = 0; i < clientList.length; i++) {
|
13
|
+
// let client = clientList[i]
|
14
|
+
// let clientPath = (new URL(client.url)).pathname
|
15
|
+
//
|
16
|
+
// if (clientPath == event.notification.data.path && "focus" in client) {
|
17
|
+
// return client.focus()
|
18
|
+
// }
|
19
|
+
// }
|
20
|
+
//
|
21
|
+
// if (clients.openWindow) {
|
22
|
+
// return clients.openWindow(event.notification.data.path)
|
23
|
+
// }
|
24
|
+
// })
|
25
|
+
// )
|
26
|
+
// })
|
data/website/bin/bundle
ADDED
@@ -0,0 +1,109 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
#
|
5
|
+
# This file was generated by Bundler.
|
6
|
+
#
|
7
|
+
# The application 'bundle' is installed as part of a gem, and
|
8
|
+
# this file is here to facilitate running it.
|
9
|
+
#
|
10
|
+
|
11
|
+
require "rubygems"
|
12
|
+
|
13
|
+
m = Module.new do
|
14
|
+
module_function
|
15
|
+
|
16
|
+
def invoked_as_script?
|
17
|
+
File.expand_path($0) == File.expand_path(__FILE__)
|
18
|
+
end
|
19
|
+
|
20
|
+
def env_var_version
|
21
|
+
ENV["BUNDLER_VERSION"]
|
22
|
+
end
|
23
|
+
|
24
|
+
def cli_arg_version
|
25
|
+
return unless invoked_as_script? # don't want to hijack other binstubs
|
26
|
+
return unless "update".start_with?(ARGV.first || " ") # must be running `bundle update`
|
27
|
+
bundler_version = nil
|
28
|
+
update_index = nil
|
29
|
+
ARGV.each_with_index do |a, i|
|
30
|
+
if update_index && update_index.succ == i && a.match?(Gem::Version::ANCHORED_VERSION_PATTERN)
|
31
|
+
bundler_version = a
|
32
|
+
end
|
33
|
+
next unless a =~ /\A--bundler(?:[= ](#{Gem::Version::VERSION_PATTERN}))?\z/
|
34
|
+
bundler_version = $1
|
35
|
+
update_index = i
|
36
|
+
end
|
37
|
+
bundler_version
|
38
|
+
end
|
39
|
+
|
40
|
+
def gemfile
|
41
|
+
gemfile = ENV["BUNDLE_GEMFILE"]
|
42
|
+
return gemfile if gemfile && !gemfile.empty?
|
43
|
+
|
44
|
+
File.expand_path("../Gemfile", __dir__)
|
45
|
+
end
|
46
|
+
|
47
|
+
def lockfile
|
48
|
+
lockfile =
|
49
|
+
case File.basename(gemfile)
|
50
|
+
when "gems.rb" then gemfile.sub(/\.rb$/, ".locked")
|
51
|
+
else "#{gemfile}.lock"
|
52
|
+
end
|
53
|
+
File.expand_path(lockfile)
|
54
|
+
end
|
55
|
+
|
56
|
+
def lockfile_version
|
57
|
+
return unless File.file?(lockfile)
|
58
|
+
lockfile_contents = File.read(lockfile)
|
59
|
+
return unless lockfile_contents =~ /\n\nBUNDLED WITH\n\s{2,}(#{Gem::Version::VERSION_PATTERN})\n/
|
60
|
+
Regexp.last_match(1)
|
61
|
+
end
|
62
|
+
|
63
|
+
def bundler_requirement
|
64
|
+
@bundler_requirement ||=
|
65
|
+
env_var_version ||
|
66
|
+
cli_arg_version ||
|
67
|
+
bundler_requirement_for(lockfile_version)
|
68
|
+
end
|
69
|
+
|
70
|
+
def bundler_requirement_for(version)
|
71
|
+
return "#{Gem::Requirement.default}.a" unless version
|
72
|
+
|
73
|
+
bundler_gem_version = Gem::Version.new(version)
|
74
|
+
|
75
|
+
bundler_gem_version.approximate_recommendation
|
76
|
+
end
|
77
|
+
|
78
|
+
def load_bundler!
|
79
|
+
ENV["BUNDLE_GEMFILE"] ||= gemfile
|
80
|
+
|
81
|
+
activate_bundler
|
82
|
+
end
|
83
|
+
|
84
|
+
def activate_bundler
|
85
|
+
gem_error = activation_error_handling do
|
86
|
+
gem "bundler", bundler_requirement
|
87
|
+
end
|
88
|
+
return if gem_error.nil?
|
89
|
+
require_error = activation_error_handling do
|
90
|
+
require "bundler/version"
|
91
|
+
end
|
92
|
+
return if require_error.nil? && Gem::Requirement.new(bundler_requirement).satisfied_by?(Gem::Version.new(Bundler::VERSION))
|
93
|
+
warn "Activating bundler (#{bundler_requirement}) failed:\n#{gem_error.message}\n\nTo install the version of bundler this project requires, run `gem install bundler -v '#{bundler_requirement}'`"
|
94
|
+
exit 42
|
95
|
+
end
|
96
|
+
|
97
|
+
def activation_error_handling
|
98
|
+
yield
|
99
|
+
nil
|
100
|
+
rescue StandardError, LoadError => e
|
101
|
+
e
|
102
|
+
end
|
103
|
+
end
|
104
|
+
|
105
|
+
m.load_bundler!
|
106
|
+
|
107
|
+
if m.invoked_as_script?
|
108
|
+
load Gem.bin_path("bundler", "bundle")
|
109
|
+
end
|
data/website/bin/dev
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/bin/bash -e
|
2
|
+
|
3
|
+
# Enable jemalloc for reduced memory usage and latency.
|
4
|
+
if [ -z "${LD_PRELOAD+x}" ]; then
|
5
|
+
LD_PRELOAD=$(find /usr/lib -name libjemalloc.so.2 -print -quit)
|
6
|
+
export LD_PRELOAD
|
7
|
+
fi
|
8
|
+
|
9
|
+
# If running the rails server then create or migrate existing database
|
10
|
+
if [ "${@: -2:1}" == "./bin/rails" ] && [ "${@: -1:1}" == "server" ]; then
|
11
|
+
./bin/rails db:prepare
|
12
|
+
fi
|
13
|
+
|
14
|
+
exec "${@}"
|
@@ -0,0 +1,33 @@
|
|
1
|
+
#!/bin/usr/env bash
|
2
|
+
|
3
|
+
set -euxo pipefail
|
4
|
+
|
5
|
+
curl -o config/initializers/markdown.rb https://raw.githubusercontent.com/3v0k4/hot-docs/refs/heads/main/config/initializers/markdown.rb
|
6
|
+
curl -o config/initializers/markdown.mjs https://raw.githubusercontent.com/3v0k4/hot-docs/refs/heads/main/config/initializers/markdown.mjs
|
7
|
+
|
8
|
+
curl -o app/assets/stylesheets/hot_docs.css https://raw.githubusercontent.com/3v0k4/hot-docs/refs/heads/main/app/assets/stylesheets/hot_docs.css
|
9
|
+
|
10
|
+
curl -o app/javascript/controllers/accordion_controller.js https://raw.githubusercontent.com/3v0k4/hot-docs/refs/heads/main/app/javascript/controllers/accordion_controller.js
|
11
|
+
curl -o app/javascript/controllers/sidenav_controller.js https://raw.githubusercontent.com/3v0k4/hot-docs/refs/heads/main/app/javascript/controllers/sidenav_controller.js
|
12
|
+
curl -o app/javascript/controllers/toc_controller.js https://raw.githubusercontent.com/3v0k4/hot-docs/refs/heads/main/app/javascript/controllers/toc_controller.js
|
13
|
+
|
14
|
+
mkdir app/views/hot_docs/
|
15
|
+
|
16
|
+
curl -o app/views/hot_docs/_menu_row.html.erb https://raw.githubusercontent.com/3v0k4/hot-docs/refs/heads/main/app/views/hot_docs/_menu_row.html.erb
|
17
|
+
|
18
|
+
curl -o app/views/layouts/hot_docs.html.erb https://raw.githubusercontent.com/3v0k4/hot-docs/refs/heads/main/app/assets/layouts/hot_docs.html.erb
|
19
|
+
|
20
|
+
bin/rails generate controller hot_docs page
|
21
|
+
curl -o app/helpers/hot_docs_helper.rb https://raw.githubusercontent.com/3v0k4/hot-docs/refs/heads/main/app/helpers/hot_docs_helper.rb
|
22
|
+
|
23
|
+
set +x
|
24
|
+
|
25
|
+
echo
|
26
|
+
echo
|
27
|
+
echo "Make sure the HotDocs controller uses the correct layout:"
|
28
|
+
cat <<END
|
29
|
+
class HotDocsController < ApplicationController
|
30
|
+
layout "hot_docs"
|
31
|
+
END
|
32
|
+
echo
|
33
|
+
echo "Visit http://127.0.0.1:3000/hot_docs/page"
|
data/website/bin/jobs
ADDED
data/website/bin/kamal
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
#
|
5
|
+
# This file was generated by Bundler.
|
6
|
+
#
|
7
|
+
# The application 'kamal' is installed as part of a gem, and
|
8
|
+
# this file is here to facilitate running it.
|
9
|
+
#
|
10
|
+
|
11
|
+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)
|
12
|
+
|
13
|
+
bundle_binstub = File.expand_path("bundle", __dir__)
|
14
|
+
|
15
|
+
if File.file?(bundle_binstub)
|
16
|
+
if File.read(bundle_binstub, 300).include?("This file was generated by Bundler")
|
17
|
+
load(bundle_binstub)
|
18
|
+
else
|
19
|
+
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
|
20
|
+
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
require "rubygems"
|
25
|
+
require "bundler/setup"
|
26
|
+
|
27
|
+
load Gem.bin_path("kamal", "kamal")
|
data/website/bin/rails
ADDED
data/website/bin/rake
ADDED
data/website/bin/rubocop
ADDED
@@ -0,0 +1,8 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
require "rubygems"
|
3
|
+
require "bundler/setup"
|
4
|
+
|
5
|
+
# explicit rubocop config increases performance slightly while avoiding config confusion.
|
6
|
+
ARGV.unshift("--config", File.expand_path("../.rubocop.yml", __dir__))
|
7
|
+
|
8
|
+
load Gem.bin_path("rubocop", "rubocop")
|
data/website/bin/setup
ADDED
@@ -0,0 +1,34 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
require "fileutils"
|
3
|
+
|
4
|
+
APP_ROOT = File.expand_path("..", __dir__)
|
5
|
+
|
6
|
+
def system!(*args)
|
7
|
+
system(*args, exception: true)
|
8
|
+
end
|
9
|
+
|
10
|
+
FileUtils.chdir APP_ROOT do
|
11
|
+
# This script is a way to set up or update your development environment automatically.
|
12
|
+
# This script is idempotent, so that you can run it at any time and get an expectable outcome.
|
13
|
+
# Add necessary setup steps to this file.
|
14
|
+
|
15
|
+
puts "== Installing dependencies =="
|
16
|
+
system("bundle check") || system!("bundle install")
|
17
|
+
|
18
|
+
# puts "\n== Copying sample files =="
|
19
|
+
# unless File.exist?("config/database.yml")
|
20
|
+
# FileUtils.cp "config/database.yml.sample", "config/database.yml"
|
21
|
+
# end
|
22
|
+
|
23
|
+
# puts "\n== Preparing database =="
|
24
|
+
# system! "bin/rails db:prepare"
|
25
|
+
|
26
|
+
puts "\n== Removing old logs and tempfiles =="
|
27
|
+
system! "bin/rails log:clear tmp:clear"
|
28
|
+
|
29
|
+
unless ARGV.include?("--skip-server")
|
30
|
+
puts "\n== Starting development server =="
|
31
|
+
STDOUT.flush # flush the output before exec(2) so that it displays
|
32
|
+
exec "bin/dev"
|
33
|
+
end
|
34
|
+
end
|
data/website/bin/thrust
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
require_relative "boot"
|
2
|
+
|
3
|
+
require "rails/all"
|
4
|
+
|
5
|
+
# Require the gems listed in Gemfile, including any gems
|
6
|
+
# you've limited to :test, :development, or :production.
|
7
|
+
Bundler.require(*Rails.groups)
|
8
|
+
|
9
|
+
module HotDocs
|
10
|
+
class Application < Rails::Application
|
11
|
+
# Initialize configuration defaults for originally generated Rails version.
|
12
|
+
config.load_defaults 8.0
|
13
|
+
|
14
|
+
# Please, add to the `ignore` list any other `lib` subdirectories that do
|
15
|
+
# not contain `.rb` files, or that should not be reloaded or eager loaded.
|
16
|
+
# Common ones are `templates`, `generators`, or `middleware`, for example.
|
17
|
+
config.autoload_lib(ignore: %w[assets tasks])
|
18
|
+
|
19
|
+
# Configuration for the application, engines, and railties goes here.
|
20
|
+
#
|
21
|
+
# These settings can be overridden in specific environments using the files
|
22
|
+
# in config/environments, which are processed later.
|
23
|
+
#
|
24
|
+
# config.time_zone = "Central Time (US & Canada)"
|
25
|
+
# config.eager_load_paths << Rails.root.join("extras")
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# Async adapter only works within the same process, so for manually triggering cable updates from a console,
|
2
|
+
# and seeing results in the browser, you must do so from the web console (running inside the dev process),
|
3
|
+
# not a terminal started via bin/rails console! Add "console" to any action or any ERB template view
|
4
|
+
# to make the web console appear.
|
5
|
+
development:
|
6
|
+
adapter: async
|
7
|
+
|
8
|
+
test:
|
9
|
+
adapter: test
|
10
|
+
|
11
|
+
production:
|
12
|
+
adapter: solid_cable
|
13
|
+
connects_to:
|
14
|
+
database:
|
15
|
+
writing: cable
|
16
|
+
polling_interval: 0.1.seconds
|
17
|
+
message_retention: 1.day
|
@@ -0,0 +1,16 @@
|
|
1
|
+
default: &default
|
2
|
+
store_options:
|
3
|
+
# Cap age of oldest cache entry to fulfill retention policies
|
4
|
+
# max_age: <%= 60.days.to_i %>
|
5
|
+
max_size: <%= 256.megabytes %>
|
6
|
+
namespace: <%= Rails.env %>
|
7
|
+
|
8
|
+
development:
|
9
|
+
<<: *default
|
10
|
+
|
11
|
+
test:
|
12
|
+
<<: *default
|
13
|
+
|
14
|
+
production:
|
15
|
+
database: cache
|
16
|
+
<<: *default
|
@@ -0,0 +1 @@
|
|
1
|
+
mnZcx9TYo2/jWpb3clgJ2lkQ70TS2roe7rd/bcnoxdt+Ph3zn82rF8BFQ1OzPiz/gof99mfSDfJYAIyQOrnQ/G7XpeMHZ6+WRr8Iqbqct34CGMteg9TFFKlRHLrxxoSpvBpLMq63nvFUHRUTa1I2tG29nHRspaLshNLvmVDD6FyZ57p+aRErl30CyrgsZa6WQImmCnqkbgdWthOf7r7m3Twq3JKkf2YA3HEAmdYQgBDQt1YqbZZTrltjmpx0nf+RceI1/YXzpC0fI9d7J08v/fVYPg0EUe5oUDwD/83gkiXOd0K+mCRcrX6ONI5u4iTik7bIX8ZY1e5m02qQBtIfN1VGwBbpED9BOiY/M030gs430afuihoEpMwRQnvSk6pynyRCySQNhRqY0o//PnRlwhdxEvVlpbcQqWh8N1lK38yFhnj6As/2yQatvKy0MkXZ9D38sUn4fMA0VyWGfeKdvZ/M/lsRNXSFYENQyihnrIYcotcqCiulmcNI--aVsW3jhIKbzIp30X--Pawv6IO1XNJFaUzcSgmLlQ==
|
@@ -0,0 +1,41 @@
|
|
1
|
+
# SQLite. Versions 3.8.0 and up are supported.
|
2
|
+
# gem install sqlite3
|
3
|
+
#
|
4
|
+
# Ensure the SQLite 3 gem is defined in your Gemfile
|
5
|
+
# gem "sqlite3"
|
6
|
+
#
|
7
|
+
default: &default
|
8
|
+
adapter: sqlite3
|
9
|
+
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
|
10
|
+
timeout: 5000
|
11
|
+
|
12
|
+
development:
|
13
|
+
<<: *default
|
14
|
+
database: storage/development.sqlite3
|
15
|
+
|
16
|
+
# Warning: The database defined as "test" will be erased and
|
17
|
+
# re-generated from your development database when you run "rake".
|
18
|
+
# Do not set this db to the same as development or production.
|
19
|
+
test:
|
20
|
+
<<: *default
|
21
|
+
database: storage/test.sqlite3
|
22
|
+
|
23
|
+
|
24
|
+
# Store production database in the storage/ directory, which by default
|
25
|
+
# is mounted as a persistent Docker volume in config/deploy.yml.
|
26
|
+
production:
|
27
|
+
primary:
|
28
|
+
<<: *default
|
29
|
+
database: storage/production.sqlite3
|
30
|
+
cache:
|
31
|
+
<<: *default
|
32
|
+
database: storage/production_cache.sqlite3
|
33
|
+
migrations_paths: db/cache_migrate
|
34
|
+
queue:
|
35
|
+
<<: *default
|
36
|
+
database: storage/production_queue.sqlite3
|
37
|
+
migrations_paths: db/queue_migrate
|
38
|
+
cable:
|
39
|
+
<<: *default
|
40
|
+
database: storage/production_cable.sqlite3
|
41
|
+
migrations_paths: db/cable_migrate
|