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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cbc24df1640795c80c5a97707ff06fa696df135596f5698a5148814f7321444e
4
- data.tar.gz: 3374e07f7af7b08170034250b467929a8644a91e66cd7b514d54ea8afa598eb4
3
+ metadata.gz: a3676879e3360254289b2fb0b936ba79d2f9a0d5fd239f31a2965a1533877009
4
+ data.tar.gz: b946557e2429279886c3adfc457419e80c295f093ac851f40d92d77ade4729ba
5
5
  SHA512:
6
- metadata.gz: 8ecdbc6e6da6a6e2f787cd9063a57a1b6d4fdfd1e43c4836cdd5682eee5e7c5fc53929ac35b7cd91c05f00282c850bb62718dd4fdfc152b1d51c916483155665
7
- data.tar.gz: 761c964f789ff77acae0451d0fec857a575fe79608ffa74313dcf5911c438f3bbffa55fc2a8eb750275b0aadcbbc314cbb704354a8ca3fc956a1caa2a7a5e753
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Markdowndocs
4
- VERSION = "0.1.2"
4
+ VERSION = "0.1.3"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: markdowndocs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dave Chmura