markdowndocs 0.1.2 → 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 +4 -4
- data/CHANGELOG.md +7 -0
- data/lib/generators/markdowndocs/install/install_generator.rb +35 -0
- data/lib/markdowndocs/version.rb +1 -1
- 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: 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,12 @@ 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
|
+
|
|
8
14
|
## [0.1.2] - 2026-02-20
|
|
9
15
|
|
|
10
16
|
### Fixed
|
|
@@ -35,6 +41,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
35
41
|
- i18n support for all UI strings
|
|
36
42
|
- Install generator (`rails generate markdowndocs:install`)
|
|
37
43
|
|
|
44
|
+
[0.1.3]: https://github.com/dschmura/markdowndocs/releases/tag/v0.1.3
|
|
38
45
|
[0.1.2]: https://github.com/dschmura/markdowndocs/releases/tag/v0.1.2
|
|
39
46
|
[0.1.1]: https://github.com/dschmura/markdowndocs/releases/tag/v0.1.1
|
|
40
47
|
[0.1.0]: https://github.com/dschmura/markdowndocs/releases/tag/v0.1.0
|
|
@@ -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