doc_pages 0.1.1 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/app/helpers/doc_pages/application_helper.rb +11 -12
- data/app/views/layouts/doc_pages/markdown.html.erb +1 -1
- data/app/views/shared/_desktop_sidebar.html.erb +1 -1
- data/app/views/shared/_pages.html.erb +1 -1
- data/app/views/shared/_sidebar.html.erb +0 -12
- data/lib/doc_pages/engine.rb +1 -1
- data/lib/doc_pages/version.rb +1 -1
- data/lib/doc_pages.rb +0 -1
- data/lib/generators/docs/templates/home.html.md +1 -1
- data/lib/handlers/markdown_handler.rb +0 -1
- metadata +34 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 441b0c00b4ebca369d2cafd705670f4b4e306b643ab44576ff1aa3ed2f6b32c2
|
4
|
+
data.tar.gz: 1fb16f6b491d17502e83f2ea2e23bf7439d66759da8aeb8aa0bbebb1f0c79636
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 28873beaaa711bb88c6fe6d0ae2bba0a1e0faa08d94dabcfa9c85ff5223367a386c025c437dc67882262354b4e3c04345dfd85f73fbd947ca5144f5b7f482feb
|
7
|
+
data.tar.gz: 0fa3c5a6e57a83f3402e5a54de1350287d6bb0230bb095d9fff7ca6c0e9bb5973d967f2e4900c31aa60e8bcaa7cda3b1253db885ecd2a2c308d5577fd74969e9
|
data/README.md
CHANGED
@@ -1,40 +1,39 @@
|
|
1
1
|
module DocPages
|
2
2
|
module ApplicationHelper
|
3
|
-
|
3
|
+
def doc_page_ids
|
4
4
|
HighVoltage.page_ids - ["home"]
|
5
5
|
end
|
6
6
|
|
7
|
-
def
|
7
|
+
def grouped_by_folder
|
8
8
|
doc_page_ids.filter { |id| id.include?("/") }.group_by { |id| id.split("/").first }
|
9
9
|
end
|
10
10
|
|
11
|
-
def
|
11
|
+
def orphans
|
12
12
|
doc_page_ids.reject { |id| id.include?("/") }
|
13
13
|
end
|
14
14
|
|
15
15
|
def render_orphans
|
16
|
-
|
16
|
+
orphans.map { |page| link_to_page(page) }.join("").html_safe
|
17
17
|
end
|
18
18
|
|
19
|
-
def
|
20
|
-
|
21
|
-
|
19
|
+
def render_grouped
|
20
|
+
grouped_by_folder.map do |folder, pages|
|
21
|
+
<<~ERB
|
22
22
|
<div class="flex flex-col gap-y-2 mb-5">
|
23
23
|
<h2 class="text-white font-semibold text-lg hover:cursor-pointer js-folders">#{folder.titleize}</h2>
|
24
24
|
<ul class="flex flex-col gap-y-2 hidden js-toggle-hidden">
|
25
|
-
#{pages.map { |page| link_to_page(page) }.join
|
25
|
+
#{pages.map { |page| link_to_page(page) }.join.html_safe}
|
26
26
|
</ul>
|
27
|
-
<div class="border-b"></div>
|
28
27
|
</div>
|
29
|
-
|
30
28
|
ERB
|
31
29
|
end.join("").html_safe
|
32
30
|
end
|
33
31
|
|
34
32
|
def link_to_page(page)
|
35
|
-
|
33
|
+
<<~ERB
|
36
34
|
<li>
|
37
|
-
#{link_to page.split("/").last.titleize, doc_path(page), data: {turbo: false},
|
35
|
+
#{link_to page.split("/").last.titleize, doc_path(page), data: {turbo: false},
|
36
|
+
class: "text-white group flex gap-x-3 rounded-md p-2 text-sm leading-6 font-semibold hover:bg-gray-700 hover:text-white"}
|
38
37
|
</li>
|
39
38
|
ERB
|
40
39
|
end
|
@@ -11,7 +11,7 @@
|
|
11
11
|
<ul role="list" class="-mx-2 space-y-1">
|
12
12
|
<li>
|
13
13
|
<!-- Current: "bg-gray-800 text-white", Default: "text-gray-400 hover:text-white hover:bg-gray-800" -->
|
14
|
-
<%= link_to doc_pages_root_path, data: {turbo: false}, class: "
|
14
|
+
<%= link_to doc_pages_root_path, data: {turbo: false}, class: " text-white group flex gap-x-3 rounded-md p-2 text-sm leading-6 font-semibold" do %>
|
15
15
|
<svg class="h-6 w-6 shrink-0" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" aria-hidden="true">
|
16
16
|
<path stroke-linecap="round" stroke-linejoin="round" d="M2.25 12l8.954-8.955c.44-.439 1.152-.439 1.591 0L21.75 12M4.5 9.75v10.125c0 .621.504 1.125 1.125 1.125H9.75v-4.875c0-.621.504-1.125 1.125-1.125h2.25c.621 0 1.125.504 1.125 1.125V21h4.125c.621 0 1.125-.504 1.125-1.125V9.75M8.25 21h8.25" />
|
17
17
|
</svg>
|
@@ -16,17 +16,7 @@
|
|
16
16
|
<path stroke-linecap="round" stroke-linejoin="round" d="M3.75 6.75h16.5M3.75 12h16.5m-16.5 5.25h16.5" />
|
17
17
|
</svg>
|
18
18
|
</button>
|
19
|
-
<div class="flex-1 text-sm font-semibold leading-6 text-white">Dashboard</div>
|
20
|
-
<a href="#">
|
21
|
-
<span class="sr-only">Your profile</span>
|
22
|
-
<img class="h-8 w-8 rounded-full bg-gray-800" src="https://images.unsplash.com/photo-1472099645785-5658abf4ff4e?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=facearea&facepad=2&w=256&h=256&q=80" alt="">
|
23
|
-
</a>
|
24
19
|
</div>
|
25
|
-
<main class="py-10 lg:pl-72">
|
26
|
-
<div class="px-4 sm:px-6 lg:px-8">
|
27
|
-
<!-- Your content -->
|
28
|
-
</div>
|
29
|
-
</main>
|
30
20
|
</div>
|
31
21
|
<script>
|
32
22
|
var mobileSidebar = document.getElementById('mobile-sidebar');
|
@@ -36,7 +26,6 @@
|
|
36
26
|
mobileSidebar.classList.add('hidden');
|
37
27
|
});
|
38
28
|
|
39
|
-
|
40
29
|
var openSidebarButton = document.getElementById('open-sidebar');
|
41
30
|
|
42
31
|
openSidebarButton.addEventListener('click', () => {
|
@@ -46,7 +35,6 @@
|
|
46
35
|
document.querySelectorAll(".js-folders").forEach((el) => {
|
47
36
|
el.addEventListener("click", (e) => {
|
48
37
|
e.preventDefault();
|
49
|
-
|
50
38
|
el.nextElementSibling.classList.toggle("hidden");
|
51
39
|
});
|
52
40
|
});
|
data/lib/doc_pages/engine.rb
CHANGED
@@ -5,7 +5,7 @@ module DocPages
|
|
5
5
|
class Engine < ::Rails::Engine
|
6
6
|
isolate_namespace DocPages
|
7
7
|
|
8
|
-
|
8
|
+
initializer "engine_name.assets.precompile" do |app|
|
9
9
|
# app.config.assets.precompile += %w[docs_manifest.js]
|
10
10
|
app.config.assets.precompile += %w[config/doc_pages_manifest.js]
|
11
11
|
end
|
data/lib/doc_pages/version.rb
CHANGED
data/lib/doc_pages.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: doc_pages
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- lbp
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-06-
|
11
|
+
date: 2023-06-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -52,6 +52,34 @@ dependencies:
|
|
52
52
|
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: standard
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: overcommit
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
55
83
|
description: Description of Docs.
|
56
84
|
email:
|
57
85
|
- 43428385+leopolicastro@users.noreply.github.com
|
@@ -87,13 +115,13 @@ files:
|
|
87
115
|
- lib/generators/docs/templates/home.html.md
|
88
116
|
- lib/handlers/markdown_handler.rb
|
89
117
|
- lib/tasks/doc_pages_tasks.rake
|
90
|
-
homepage: https://github.com/leopolicastro/
|
118
|
+
homepage: https://github.com/leopolicastro/doc_pages
|
91
119
|
licenses:
|
92
120
|
- MIT
|
93
121
|
metadata:
|
94
|
-
homepage_uri: https://github.com/leopolicastro/
|
95
|
-
source_code_uri: https://github.com/leopolicastro/
|
96
|
-
changelog_uri: https://github.com/leopolicastro/
|
122
|
+
homepage_uri: https://github.com/leopolicastro/doc_pages
|
123
|
+
source_code_uri: https://github.com/leopolicastro/doc_pages
|
124
|
+
changelog_uri: https://github.com/leopolicastro/doc_pages/blob/main/CHANGELOG.md
|
97
125
|
post_install_message:
|
98
126
|
rdoc_options: []
|
99
127
|
require_paths:
|