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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 28ba97130a8ced09db56f6d162b4da7295e2619ee7c344dcf4624f5fedb4ae0c
4
- data.tar.gz: 8df9c9bf93ab49edc65f338ea7a8149fa5311a8a4f8b5b6571ca9953453b9b8b
3
+ metadata.gz: 441b0c00b4ebca369d2cafd705670f4b4e306b643ab44576ff1aa3ed2f6b32c2
4
+ data.tar.gz: 1fb16f6b491d17502e83f2ea2e23bf7439d66759da8aeb8aa0bbebb1f0c79636
5
5
  SHA512:
6
- metadata.gz: 10f22a301d510a32ccbf76bc5d30fb373a95e0c9f9923000c38c9f4795e3c10a189d0374d1bd5367e67b153eaf79bbb6fd8bf88f06cb193f0dc41a9b9fb0b66a
7
- data.tar.gz: 12d157a087017021ff15002e4db7106455680ac7ea9987b62bb1ca4b097b65ad94624979f44f690a8495a38cd5123a2b29f977368aecb1313cc69d346224a1e2
6
+ metadata.gz: 28873beaaa711bb88c6fe6d0ae2bba0a1e0faa08d94dabcfa9c85ff5223367a386c025c437dc67882262354b4e3c04345dfd85f73fbd947ca5144f5b7f482feb
7
+ data.tar.gz: 0fa3c5a6e57a83f3402e5a54de1350287d6bb0230bb095d9fff7ca6c0e9bb5973d967f2e4900c31aa60e8bcaa7cda3b1253db885ecd2a2c308d5577fd74969e9
data/README.md CHANGED
@@ -28,7 +28,7 @@ Or install it yourself as:
28
28
  $ gem install doc_pages
29
29
  ```
30
30
  ## <span id="getting-started">Getting Started</span>
31
- - Run `rails g doc_pages install`
31
+ - Run `rails g docs install`
32
32
 
33
33
  ## <span id="adding-pages">Adding Pages</span>
34
34
 
@@ -1,40 +1,39 @@
1
1
  module DocPages
2
2
  module ApplicationHelper
3
- def doc_page_ids
3
+ def doc_page_ids
4
4
  HighVoltage.page_ids - ["home"]
5
5
  end
6
6
 
7
- def group_by_folder
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 without_a_folder
11
+ def orphans
12
12
  doc_page_ids.reject { |id| id.include?("/") }
13
13
  end
14
14
 
15
15
  def render_orphans
16
- without_a_folder.map { |page| link_to_page(page) }.join("").html_safe
16
+ orphans.map { |page| link_to_page(page) }.join("").html_safe
17
17
  end
18
18
 
19
- def group_by_folder_and_render
20
- group_by_folder.map do |folder, pages|
21
- <<-ERB
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("").html_safe}
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
- <<-ERB
33
+ <<~ERB
36
34
  <li>
37
- #{link_to page.split("/").last.titleize, doc_path(page), data: {turbo: false}, class: "text-white group flex gap-x-3 rounded-md p-2 text-sm leading-6 font-semibold"}
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
@@ -18,7 +18,7 @@
18
18
  </head>
19
19
  <body>
20
20
  <%= render "shared/sidebar" %>
21
- <main class="prose prose-blue 2xl:prose-xl container mx-auto px-5 md:ml-80">
21
+ <main class="prose prose-blue 2xl:prose-xl container mx-auto p-2 md:p-5 md:ml-80">
22
22
  <%= yield %>
23
23
  </main>
24
24
  </body>
@@ -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: "bg-gray-800 text-white group flex gap-x-3 rounded-md p-2 text-sm leading-6 font-semibold" do %>
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>
@@ -1,4 +1,4 @@
1
1
  <div class="overflow-y-scroll">
2
- <%= group_by_folder_and_render %>
2
+ <%= render_grouped %>
3
3
  <%= render_orphans %>
4
4
  </div>
@@ -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
  });
@@ -5,7 +5,7 @@ module DocPages
5
5
  class Engine < ::Rails::Engine
6
6
  isolate_namespace DocPages
7
7
 
8
- initializer "engine_name.assets.precompile" do |app|
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
@@ -1,3 +1,3 @@
1
1
  module DocPages
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.3"
3
3
  end
data/lib/doc_pages.rb CHANGED
@@ -2,5 +2,4 @@ require "doc_pages/version"
2
2
  require "doc_pages/engine"
3
3
 
4
4
  module DocPages
5
- # Your code goes here...
6
5
  end
@@ -24,7 +24,7 @@
24
24
  ```bash
25
25
  $ bundle add doc_pages
26
26
  ```
27
- - Run `rails g doc_pages install`
27
+ - Run `rails g docs install`
28
28
 
29
29
 
30
30
  ### <span id="adding-pages">Adding Pages</span>
@@ -19,7 +19,6 @@ module Handlers
19
19
  superscript: true,
20
20
  lax_spacing: true,
21
21
  space_after_headers: true
22
- # disable_indented_code_blocks: true # ????
23
22
  )
24
23
  "#{markdown.render(source).inspect}.html_safe"
25
24
  end
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.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-14 00:00:00.000000000 Z
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/docs
118
+ homepage: https://github.com/leopolicastro/doc_pages
91
119
  licenses:
92
120
  - MIT
93
121
  metadata:
94
- homepage_uri: https://github.com/leopolicastro/docs
95
- source_code_uri: https://github.com/leopolicastro/docs
96
- changelog_uri: https://github.com/leopolicastro/docs/blob/main/CHANGELOG.md
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: