markdowndocs 0.1.1 → 0.1.3
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
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a3676879e3360254289b2fb0b936ba79d2f9a0d5fd239f31a2965a1533877009
|
|
4
|
+
data.tar.gz: b946557e2429279886c3adfc457419e80c295f093ac851f40d92d77ade4729ba
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3e2ebee186f301c5773e1bd0b8bfe611b94951c3b00ace072ffc7685a91ff10f7e616e5c47be032ad9b9ddd103fb1041e4ac1577d63eecc3843667b7fc47d2ad
|
|
7
|
+
data.tar.gz: 56b9585de9c4a0ee088d6d5618aee160e8deb7ac3cab376245810541fb517206b9d11502e8eb9edb085844c7d7a0d85a46f60609d0773e8cd77e7b913157c691
|
data/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,18 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [0.1.3] - 2026-02-20
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
|
|
12
|
+
- Install generator now injects a Tailwind `@source` directive into the host app's CSS so the gem's view templates are scanned for CSS classes. Without this, Tailwind 4 purges the gem's layout classes (grid, sticky sidebar, etc.) and the sidebar renders at the bottom of the page instead of as a column.
|
|
13
|
+
|
|
14
|
+
## [0.1.2] - 2026-02-20
|
|
15
|
+
|
|
16
|
+
### Fixed
|
|
17
|
+
|
|
18
|
+
- `root_path` in host app layouts now resolves to the host app's root (`/`) instead of the engine's root (`/docs/`). The engine defines its own `root` route, so the existing `method_missing` delegation couldn't intercept it. Added explicit `root_path`/`root_url` overrides that delegate to `main_app`.
|
|
19
|
+
|
|
8
20
|
## [0.1.1] - 2026-02-20
|
|
9
21
|
|
|
10
22
|
### Fixed
|
|
@@ -29,5 +41,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
29
41
|
- i18n support for all UI strings
|
|
30
42
|
- Install generator (`rails generate markdowndocs:install`)
|
|
31
43
|
|
|
44
|
+
[0.1.3]: https://github.com/dschmura/markdowndocs/releases/tag/v0.1.3
|
|
45
|
+
[0.1.2]: https://github.com/dschmura/markdowndocs/releases/tag/v0.1.2
|
|
32
46
|
[0.1.1]: https://github.com/dschmura/markdowndocs/releases/tag/v0.1.1
|
|
33
47
|
[0.1.0]: https://github.com/dschmura/markdowndocs/releases/tag/v0.1.0
|
|
@@ -11,6 +11,18 @@ module Markdowndocs
|
|
|
11
11
|
# against the engine's catch-all :slug route instead. This delegation
|
|
12
12
|
# ensures host app route helpers always work correctly in engine views.
|
|
13
13
|
helper do
|
|
14
|
+
# Explicitly delegate root_path/root_url to the host app.
|
|
15
|
+
# The engine defines its own root route, so these helpers exist in the
|
|
16
|
+
# engine scope and method_missing won't intercept them — but they resolve
|
|
17
|
+
# to /docs/ instead of /. Engine views use markdowndocs.root_path directly.
|
|
18
|
+
def root_path(*args)
|
|
19
|
+
main_app.root_path(*args)
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
def root_url(*args)
|
|
23
|
+
main_app.root_url(*args)
|
|
24
|
+
end
|
|
25
|
+
|
|
14
26
|
def method_missing(method, *args, &block)
|
|
15
27
|
if main_app.respond_to?(method)
|
|
16
28
|
main_app.send(method, *args, &block)
|
|
@@ -20,6 +20,25 @@ module Markdowndocs
|
|
|
20
20
|
route 'mount Markdowndocs::Engine, at: "/docs"'
|
|
21
21
|
end
|
|
22
22
|
|
|
23
|
+
def inject_tailwind_source
|
|
24
|
+
css_file = find_tailwind_css_file
|
|
25
|
+
return unless css_file
|
|
26
|
+
|
|
27
|
+
gem_views_path = Markdowndocs::Engine.root.join("app", "views")
|
|
28
|
+
source_line = %(@source "#{gem_views_path}/**/*.erb";)
|
|
29
|
+
|
|
30
|
+
if File.read(css_file).include?(source_line)
|
|
31
|
+
say_status :skip, "Tailwind @source for markdowndocs already present", :yellow
|
|
32
|
+
return
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
inject_into_file css_file, after: %(@import "tailwindcss";\n) do
|
|
36
|
+
"\n/* Markdowndocs gem views — required so Tailwind scans the gem's templates */\n#{source_line}\n"
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
say_status :inject, "Tailwind @source for markdowndocs views", :green
|
|
40
|
+
end
|
|
41
|
+
|
|
23
42
|
def show_post_install_message
|
|
24
43
|
say ""
|
|
25
44
|
say "Markdowndocs installed successfully!", :green
|
|
@@ -29,6 +48,22 @@ module Markdowndocs
|
|
|
29
48
|
say " 2. Add markdown files to app/docs/"
|
|
30
49
|
say " 3. Visit /docs to see your documentation"
|
|
31
50
|
say ""
|
|
51
|
+
unless find_tailwind_css_file
|
|
52
|
+
say " NOTE: Could not find your Tailwind CSS file.", :yellow
|
|
53
|
+
say " Add this line after @import \"tailwindcss\" in your CSS:"
|
|
54
|
+
say " @source \"#{Markdowndocs::Engine.root.join("app", "views")}/**/*.erb\";"
|
|
55
|
+
say ""
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
private
|
|
60
|
+
|
|
61
|
+
def find_tailwind_css_file
|
|
62
|
+
candidates = [
|
|
63
|
+
"app/assets/tailwind/application.css",
|
|
64
|
+
"app/assets/stylesheets/application.tailwind.css"
|
|
65
|
+
]
|
|
66
|
+
candidates.find { |f| File.exist?(Rails.root.join(f)) }&.then { |f| Rails.root.join(f).to_s }
|
|
32
67
|
end
|
|
33
68
|
end
|
|
34
69
|
end
|
data/lib/markdowndocs/version.rb
CHANGED