tailwind_views_generator 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (118) hide show
  1. checksums.yaml +7 -0
  2. data/.fasterer.yml +23 -0
  3. data/.gitignore +11 -0
  4. data/.rubocop.yml +34 -0
  5. data/.simplecov +9 -0
  6. data/.tool-versions +1 -0
  7. data/.yardopts +12 -0
  8. data/CHANGELOG.md +10 -0
  9. data/CODE_OF_CONDUCT.md +22 -0
  10. data/Gemfile +13 -0
  11. data/Gemfile.lock +98 -0
  12. data/LICENSE.txt +21 -0
  13. data/README.md +121 -0
  14. data/Rakefile +16 -0
  15. data/bin/console +15 -0
  16. data/bin/setup +8 -0
  17. data/lib/generators/tailwind_views/devise_generator.rb +52 -0
  18. data/lib/generators/tailwind_views/install_generator.rb +134 -0
  19. data/lib/tailwind_views_generator.rb +10 -0
  20. data/lib/tailwind_views_generator/helpers.rb +15 -0
  21. data/lib/tailwind_views_generator/version.rb +6 -0
  22. data/lib/templates/.DS_Store +0 -0
  23. data/lib/templates/devise/.DS_Store +0 -0
  24. data/lib/templates/devise/erb/confirmations/new.html.erb.tt +25 -0
  25. data/lib/templates/devise/erb/mailer/confirmation_instructions.html.erb +5 -0
  26. data/lib/templates/devise/erb/mailer/email_changed.html.erb +7 -0
  27. data/lib/templates/devise/erb/mailer/password_change.html.erb +3 -0
  28. data/lib/templates/devise/erb/mailer/reset_password_instructions.html.erb +8 -0
  29. data/lib/templates/devise/erb/mailer/unlock_instructions.html.erb +7 -0
  30. data/lib/templates/devise/erb/passwords/edit.html.erb.tt +33 -0
  31. data/lib/templates/devise/erb/passwords/new.html.erb.tt +23 -0
  32. data/lib/templates/devise/erb/registrations/edit.html.erb.tt +53 -0
  33. data/lib/templates/devise/erb/registrations/new.html.erb.tt +37 -0
  34. data/lib/templates/devise/erb/sessions/new.html.erb.tt +36 -0
  35. data/lib/templates/devise/erb/shared/_error_messages.html.erb +15 -0
  36. data/lib/templates/devise/erb/shared/_links.html.erb +28 -0
  37. data/lib/templates/devise/erb/unlocks/new.html.erb.tt +24 -0
  38. data/lib/templates/devise/haml/confirmations/new.html.haml.tt +15 -0
  39. data/lib/templates/devise/haml/mailer/confirmation_instructions.html.haml +3 -0
  40. data/lib/templates/devise/haml/mailer/email_changed.html.haml +7 -0
  41. data/lib/templates/devise/haml/mailer/password_change.html.haml +2 -0
  42. data/lib/templates/devise/haml/mailer/reset_password_instructions.html.haml +5 -0
  43. data/lib/templates/devise/haml/mailer/unlock_instructions.html.haml +4 -0
  44. data/lib/templates/devise/haml/passwords/edit.html.haml.tt +23 -0
  45. data/lib/templates/devise/haml/passwords/new.html.haml.tt +15 -0
  46. data/lib/templates/devise/haml/registrations/edit.html.haml.tt +42 -0
  47. data/lib/templates/devise/haml/registrations/new.html.haml.tt +27 -0
  48. data/lib/templates/devise/haml/sessions/new.html.haml.tt +25 -0
  49. data/lib/templates/devise/haml/shared/_error_messages.html.haml +6 -0
  50. data/lib/templates/devise/haml/shared/_links.html.haml +20 -0
  51. data/lib/templates/devise/haml/unlocks/new.html.haml.tt +16 -0
  52. data/lib/templates/devise/simple_form/erb/confirmations/new.html.erb.tt +18 -0
  53. data/lib/templates/devise/simple_form/erb/passwords/edit.html.erb.tt +20 -0
  54. data/lib/templates/devise/simple_form/erb/passwords/new.html.erb.tt +17 -0
  55. data/lib/templates/devise/simple_form/erb/registrations/edit.html.erb.tt +27 -0
  56. data/lib/templates/devise/simple_form/erb/registrations/new.html.erb.tt +19 -0
  57. data/lib/templates/devise/simple_form/erb/sessions/new.html.erb.tt +18 -0
  58. data/lib/templates/devise/simple_form/erb/unlocks/new.html.erb.tt +17 -0
  59. data/lib/templates/devise/simple_form/haml/confirmations/new.html.haml.tt +13 -0
  60. data/lib/templates/devise/simple_form/haml/passwords/edit.html.haml.tt +15 -0
  61. data/lib/templates/devise/simple_form/haml/passwords/new.html.haml.tt +12 -0
  62. data/lib/templates/devise/simple_form/haml/registrations/edit.html.haml.tt +21 -0
  63. data/lib/templates/devise/simple_form/haml/registrations/new.html.haml.tt +14 -0
  64. data/lib/templates/devise/simple_form/haml/sessions/new.html.haml.tt +13 -0
  65. data/lib/templates/devise/simple_form/haml/unlocks/new.html.haml.tt +12 -0
  66. data/lib/templates/devise/simple_form/slim/confirmations/new.html.slim.tt +13 -0
  67. data/lib/templates/devise/simple_form/slim/passwords/edit.html.slim.tt +15 -0
  68. data/lib/templates/devise/simple_form/slim/passwords/new.html.slim.tt +12 -0
  69. data/lib/templates/devise/simple_form/slim/registrations/edit.html.slim.tt +21 -0
  70. data/lib/templates/devise/simple_form/slim/registrations/new.html.slim.tt +14 -0
  71. data/lib/templates/devise/simple_form/slim/sessions/new.html.slim.tt +13 -0
  72. data/lib/templates/devise/simple_form/slim/unlocks/new.html.slim.tt +12 -0
  73. data/lib/templates/devise/slim/confirmations/new.html.slim.tt +16 -0
  74. data/lib/templates/devise/slim/mailer/confirmation_instructions.html.slim +3 -0
  75. data/lib/templates/devise/slim/mailer/email_changed.html.slim +5 -0
  76. data/lib/templates/devise/slim/mailer/password_change.html.slim +2 -0
  77. data/lib/templates/devise/slim/mailer/reset_password_instructions.html.slim +5 -0
  78. data/lib/templates/devise/slim/mailer/unlock_instructions.html.slim +4 -0
  79. data/lib/templates/devise/slim/passwords/edit.html.slim.tt +24 -0
  80. data/lib/templates/devise/slim/passwords/new.html.slim.tt +16 -0
  81. data/lib/templates/devise/slim/registrations/edit.html.slim.tt +43 -0
  82. data/lib/templates/devise/slim/registrations/new.html.slim.tt +28 -0
  83. data/lib/templates/devise/slim/sessions/new.html.slim.tt +26 -0
  84. data/lib/templates/devise/slim/shared/_error_messages.html.slim +6 -0
  85. data/lib/templates/devise/slim/shared/_links.html.slim +20 -0
  86. data/lib/templates/devise/slim/unlocks/new.html.slim.tt +17 -0
  87. data/lib/templates/layouts/application.html.erb.tt +36 -0
  88. data/lib/templates/layouts/application.html.haml.tt +32 -0
  89. data/lib/templates/layouts/application.html.slim.tt +31 -0
  90. data/lib/templates/scaffolds/erb/_form.html.erb +22 -0
  91. data/lib/templates/scaffolds/erb/edit.html.erb.tt +13 -0
  92. data/lib/templates/scaffolds/erb/index.html.erb.tt +38 -0
  93. data/lib/templates/scaffolds/erb/new.html.erb.tt +14 -0
  94. data/lib/templates/scaffolds/erb/show.html.erb.tt +20 -0
  95. data/lib/templates/scaffolds/haml/_form.html.haml +17 -0
  96. data/lib/templates/scaffolds/haml/edit.html.haml.tt +13 -0
  97. data/lib/templates/scaffolds/haml/index.html.haml.tt +29 -0
  98. data/lib/templates/scaffolds/haml/new.html.haml.tt +10 -0
  99. data/lib/templates/scaffolds/haml/show.html.haml.tt +18 -0
  100. data/lib/templates/scaffolds/simple_form/_form.html.erb +9 -0
  101. data/lib/templates/scaffolds/simple_form/_form.html.haml +9 -0
  102. data/lib/templates/scaffolds/simple_form/_form.html.slim +9 -0
  103. data/lib/templates/scaffolds/slim/_form.html.slim +17 -0
  104. data/lib/templates/scaffolds/slim/edit.html.slim.tt +13 -0
  105. data/lib/templates/scaffolds/slim/index.html.slim.tt +29 -0
  106. data/lib/templates/scaffolds/slim/new.html.slim.tt +11 -0
  107. data/lib/templates/scaffolds/slim/show.html.slim.tt +18 -0
  108. data/lib/templates/shared/footer/_footer.html.erb.tt +5 -0
  109. data/lib/templates/shared/footer/_footer.html.haml.tt +3 -0
  110. data/lib/templates/shared/footer/_footer.html.slim.tt +3 -0
  111. data/lib/templates/shared/navigation/_navigation.html.erb.tt +32 -0
  112. data/lib/templates/shared/navigation/_navigation.html.haml.tt +23 -0
  113. data/lib/templates/shared/navigation/_navigation.html.slim.tt +23 -0
  114. data/lib/templates/shared/pagination/_pagination.html.erb +5 -0
  115. data/lib/templates/shared/pagination/_pagination.html.haml +3 -0
  116. data/lib/templates/shared/pagination/_pagination.html.slim +3 -0
  117. data/tailwind_views_generator.gemspec +38 -0
  118. metadata +223 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 6ef6570dde7818fce88ea2dad0a247dd74192a12595ef8632d76e230fdaae2fb
4
+ data.tar.gz: 07fcf1984092c48d4af6daae098a52a85744c86de70f043291ec1bff0352513a
5
+ SHA512:
6
+ metadata.gz: 3155abe4791ddcab539d6dd4791e08d0613f52e9f20e8e49c5b7035ccfa98685c24a3f69c465631956f7cf5f66e20a526568fa4a79640a54f40ef514fad8806e
7
+ data.tar.gz: 36aa93b65f88bfb513d7302b1c09ab715daac2ed184b3eda02d8f35262e27bf2ac554a8b3056ce8702eccf7c1b6b195d5f330ee53df698cb023f579d62c3e075
data/.fasterer.yml ADDED
@@ -0,0 +1,23 @@
1
+ speedups:
2
+ rescue_vs_respond_to: true
3
+ module_eval: true
4
+ shuffle_first_vs_sample: true
5
+ for_loop_vs_each: true
6
+ each_with_index_vs_while: false
7
+ map_flatten_vs_flat_map: true
8
+ reverse_each_vs_reverse_each: true
9
+ select_first_vs_detect: true
10
+ sort_vs_sort_by: true
11
+ fetch_with_argument_vs_block: true
12
+ keys_each_vs_each_key: true
13
+ hash_merge_bang_vs_hash_brackets: true
14
+ block_vs_symbol_to_proc: true
15
+ proc_call_vs_yield: true
16
+ gsub_vs_tr: true
17
+ select_last_vs_reverse_detect: true
18
+ getter_vs_attr_reader: true
19
+ setter_vs_attr_writer: true
20
+
21
+ exclude_paths:
22
+ - 'docs/'
23
+ - 'lib/tailwind_views_generator/templates/**/**'
data/.gitignore ADDED
@@ -0,0 +1,11 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
9
+ *.gem
10
+ .vscode
11
+ .idea
data/.rubocop.yml ADDED
@@ -0,0 +1,34 @@
1
+ require:
2
+ - rubocop-performance
3
+
4
+ AllCops:
5
+ NewCops: disable
6
+ Exclude:
7
+ - '**.gem'
8
+ - '**.gemspec'
9
+ - Gemfile
10
+ - Guardfile
11
+ - Rakefile
12
+ - 'bin/**'
13
+ - 'docs/**/*'
14
+ - 'hidden/**/*'
15
+ - 'lib/tailwind_views_generator/templates/**/*'
16
+ - 'node_modules/**/*'
17
+ - 'pkg/**/*'
18
+ - 'test/**/*'
19
+ - 'vendor/**/*'
20
+ - '**/*.tt'
21
+ - '**/*.erb'
22
+ - '**/*.slim'
23
+ - '**/*.haml'
24
+ - '**/*.yml'
25
+ - '.**'
26
+ TargetRubyVersion: 2.6
27
+ UseCache: true
28
+
29
+ Layout/LineLength:
30
+ Max: 137
31
+ Metrics/AbcSize:
32
+ Enabled: false
33
+ Style/Documentation:
34
+ Enabled: false
data/.simplecov ADDED
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'simplecov'
4
+ SimpleCov.start('rails') do
5
+ add_filter('/bin/')
6
+ add_filter('/lib/templates/**.**')
7
+ end
8
+ SimpleCov.minimum_coverage(90)
9
+ SimpleCov.use_merging(false)
data/.tool-versions ADDED
@@ -0,0 +1 @@
1
+ ruby 2.6.5
data/.yardopts ADDED
@@ -0,0 +1,12 @@
1
+ --title 'TailwindViewsGenerator'
2
+ --quiet
3
+ --exclude lib/tailwind_views_generator/templates
4
+ --exclude lib/tailwind_views_generator/generators
5
+ --exclude spec
6
+ --asset docs/images:images
7
+ -
8
+ CHANGELOG.md
9
+ LICENSE
10
+ README.md
11
+ *.md
12
+ # Docs -> https://manpages.debian.org/stretch/yard/yardoc.1
data/CHANGELOG.md ADDED
@@ -0,0 +1,10 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## 2021-04-14
9
+
10
+ - Initial commit
@@ -0,0 +1,22 @@
1
+ # Contributor Code of Conduct
2
+
3
+ As contributors and maintainers of this project, and in the interest of fostering an open and welcoming community, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.
4
+
5
+ We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, religion, or nationality.
6
+
7
+ Examples of unacceptable behavior by participants include:
8
+
9
+ * The use of sexualized language or imagery
10
+ * Personal attacks
11
+ * Trolling or insulting/derogatory comments
12
+ * Public or private harassment
13
+ * Publishing other's private information, such as physical or electronic addresses, without explicit permission
14
+ * Other unethical or unprofessional conduct.
15
+
16
+ Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. By adopting this Code of Conduct, project maintainers commit themselves to fairly and consistently applying these principles to every aspect of managing this project. Project maintainers who do not follow or enforce the Code of Conduct may be permanently removed from the project team.
17
+
18
+ This code of conduct applies both within project spaces and in public spaces when an individual is representing the project or its community.
19
+
20
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.
21
+
22
+ This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.2.0, available at [http://contributor-covenant.org/version/1/2/0/](http://contributor-covenant.org/version/1/2/0/)
data/Gemfile ADDED
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ source 'https://rubygems.org'
4
+
5
+ # Specify your gem's dependencies in tailwind_views_generator.gemspec
6
+ gemspec
7
+
8
+ gem 'rake'
9
+
10
+ group :developmentt do
11
+ # gem 'rubocop', require: false
12
+ # gem 'rubocop-performance', require: false
13
+ end
data/Gemfile.lock ADDED
@@ -0,0 +1,98 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ tailwind_views_generator (0.0.1)
5
+ railties (>= 4.0, <= 7)
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ actionpack (6.1.1)
11
+ actionview (= 6.1.1)
12
+ activesupport (= 6.1.1)
13
+ rack (~> 2.0, >= 2.0.9)
14
+ rack-test (>= 0.6.3)
15
+ rails-dom-testing (~> 2.0)
16
+ rails-html-sanitizer (~> 1.0, >= 1.2.0)
17
+ actionview (6.1.1)
18
+ activesupport (= 6.1.1)
19
+ builder (~> 3.1)
20
+ erubi (~> 1.4)
21
+ rails-dom-testing (~> 2.0)
22
+ rails-html-sanitizer (~> 1.1, >= 1.2.0)
23
+ activesupport (6.1.1)
24
+ concurrent-ruby (~> 1.0, >= 1.0.2)
25
+ i18n (>= 1.6, < 2)
26
+ minitest (>= 5.1)
27
+ tzinfo (~> 2.0)
28
+ zeitwerk (~> 2.3)
29
+ ast (2.4.2)
30
+ builder (3.2.4)
31
+ concurrent-ruby (1.1.8)
32
+ crass (1.0.6)
33
+ erubi (1.10.0)
34
+ i18n (1.8.7)
35
+ concurrent-ruby (~> 1.0)
36
+ loofah (2.9.0)
37
+ crass (~> 1.0.2)
38
+ nokogiri (>= 1.5.9)
39
+ method_source (1.0.0)
40
+ minitest (5.14.3)
41
+ nokogiri (1.11.1-x86_64-darwin)
42
+ racc (~> 1.4)
43
+ parallel (1.20.1)
44
+ parser (3.0.0.0)
45
+ ast (~> 2.4.1)
46
+ racc (1.5.2)
47
+ rack (2.2.3)
48
+ rack-test (1.1.0)
49
+ rack (>= 1.0, < 3)
50
+ rails-dom-testing (2.0.3)
51
+ activesupport (>= 4.2.0)
52
+ nokogiri (>= 1.6)
53
+ rails-html-sanitizer (1.3.0)
54
+ loofah (~> 2.3)
55
+ railties (6.1.1)
56
+ actionpack (= 6.1.1)
57
+ activesupport (= 6.1.1)
58
+ method_source
59
+ rake (>= 0.8.7)
60
+ thor (~> 1.0)
61
+ rainbow (3.0.0)
62
+ rake (13.0.3)
63
+ regexp_parser (2.0.3)
64
+ rexml (3.2.4)
65
+ rubocop (1.8.1)
66
+ parallel (~> 1.10)
67
+ parser (>= 3.0.0.0)
68
+ rainbow (>= 2.2.2, < 4.0)
69
+ regexp_parser (>= 1.8, < 3.0)
70
+ rexml
71
+ rubocop-ast (>= 1.2.0, < 2.0)
72
+ ruby-progressbar (~> 1.7)
73
+ unicode-display_width (>= 1.4.0, < 3.0)
74
+ rubocop-ast (1.4.1)
75
+ parser (>= 2.7.1.5)
76
+ rubocop-performance (1.9.2)
77
+ rubocop (>= 0.90.0, < 2.0)
78
+ rubocop-ast (>= 0.4.0)
79
+ ruby-progressbar (1.11.0)
80
+ thor (1.1.0)
81
+ tzinfo (2.0.4)
82
+ concurrent-ruby (~> 1.0)
83
+ unicode-display_width (2.0.0)
84
+ zeitwerk (2.4.2)
85
+
86
+ PLATFORMS
87
+ x86_64-darwin-20
88
+
89
+ DEPENDENCIES
90
+ bundler (>= 1.17, <= 3)
91
+ minitest
92
+ rake
93
+ rubocop
94
+ rubocop-performance
95
+ tailwind_views_generator!
96
+
97
+ BUNDLED WITH
98
+ 2.2.6
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2021 Brandon Hicks
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,121 @@
1
+ # Tailwind Views Generator
2
+
3
+ ![](https://ruby-gem-downloads-badge.herokuapp.com/tailwind_views_generator?type=total) [![MIT license](http://img.shields.io/badge/license-MIT-brightgreen.svg)](http://opensource.org/licenses/MIT) [![Gem Version](https://badge.fury.io/rb/tailwind_views_generator.svg)](https://badge.fury.io/rb/tailwind_views_generator)
4
+
5
+ This gem is used for generating tailwind based scaffold views for your Rails application. They can be Erb, Slim, or HAML. You can include pagination (using Pagy), simple_form (for the form components), and if you'd like you can utilize the meta-tags gems to all dynamic page titles when switching between your view components.
6
+
7
+ This is more or less a sister project of the [bootstrap_views_generator](https://github.com/tarellel/bootstrap_views_generator) and [semantic_ui_views_generator](https://github.com/tarellel/semantic_ui_views_generator) gems, but for those who prefer to use TailwindCSS.
8
+
9
+ ## Installation
10
+
11
+ Add this line to your application's Gemfile:
12
+
13
+ ```ruby
14
+ gem 'tailwind_views_generator', group: :development
15
+
16
+ # Before continuing make sure you have the tailwind yarn package or rails tailwind gem installed and included in your application.scss file so tailwind will be available for the applications frontend
17
+ gem 'tailwindcss-rails'
18
+
19
+ ```
20
+
21
+ And then execute:
22
+
23
+ $ bundle
24
+
25
+ Or install it yourself as:
26
+
27
+ $ gem install tailwind_views_generator
28
+
29
+ ## Usage
30
+
31
+ ```shell
32
+ Usage:
33
+ rails g tailwind_views:install [options]
34
+
35
+ Options:
36
+ Options:
37
+ -t, [--template-engine=TEMPLATE_ENGINE] # Indicates when to generate using a designated template engine (erb, slim, haml)
38
+ # Default: erb
39
+ --simpleform # Indicates if simple_form is to be used to generate the forms
40
+ # Default: false
41
+ --pagination # Specify if you want to add pagination to the index pages
42
+ # Defaults: false (requires Pagy to use pagination)
43
+ --metatags # If you want the pages titles to use the meta-tags gem function for the page title
44
+ # Default: false
45
+ --layout # Over-write your application layout file with a Tailwind based layout
46
+ # Default: false
47
+ --devise # If you want to generate tailwind based devise views
48
+ # Default: false
49
+ --skip_javascript # If you want to skip adding javascript_include_tag || javascript_pack_tag to the layouts
50
+ # Default: false
51
+ --skip_turbolinks # Do you want to skip associating turbolinks with the assets and views
52
+ # Default: false
53
+ ```
54
+
55
+ ## Options
56
+
57
+ ##### Template Engines
58
+
59
+ Supported Template Engines
60
+
61
+ * ERB
62
+ * HAML
63
+ * Slim
64
+
65
+ **HAML**
66
+
67
+ Make sure you have haml added to your your Gemfile
68
+ ```ruby
69
+ gem 'haml-rails'
70
+
71
+ # generate haml views
72
+ rails g tailwind_views:install --template_engine=haml
73
+ ```
74
+
75
+ **Slim**
76
+ Make sure you have Slim added to your Gemfile
77
+ ```ruby
78
+ gem 'slim-rails'
79
+
80
+ # generate Slim views
81
+ rails g tailwind_views:install --template_engine=slim
82
+ ```
83
+
84
+ #### Pagination
85
+
86
+ Ensure you have [Pagy](https://github.com/ddnexus/pagy) gem installed
87
+ ```ruby
88
+ gem 'pagy'
89
+ ```
90
+
91
+ And ensure you have pagy's [tailwind extras](https://ddnexus.github.io/pagy/extras/tailwind) included in your applications stylesheets to format your pagination.
92
+
93
+
94
+ #### Meta-Tags
95
+ Ensure you have the [meta-tags](https://github.com/kpumuk/meta-tags) gem installed
96
+ ```ruby
97
+ gem 'meta-tags'
98
+ ```
99
+
100
+ ### Examples
101
+
102
+ Generate tailwind views with pagination enabled
103
+ ```shell
104
+ rails g tailwind_views:install --pagination
105
+ ```
106
+
107
+ Generate tailwind views with slim and using simple_form
108
+ ```shell
109
+ rails g tailwind_views:install --template_engine=slim --simpleform
110
+ ```
111
+
112
+ Generate tailwind scaffolds, devise views, while using simpleform, metatags, and slim template engine.
113
+ ```shell
114
+ rails g tailwind_views:install --devise --simpleform --metatags --template_engine=slim
115
+ ```
116
+
117
+ ### Extras
118
+
119
+ * If you like to use the [meta-tags](https://github.com/kpumuk/meta-tags) gem to add page titles based on the views.
120
+ * Pagination defaults to using [Pagy](https://github.com/ddnexus/pagy) on the index pages.
121
+ * With [simple_form](https://github.com/plataformatec/simple_form) it generates a `config/initializers/simple_form.rb` file for your simple_form formatting.
data/Rakefile ADDED
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'bundler/gem_tasks'
4
+ require 'rake/testtask'
5
+
6
+ Rake::TestTask.new(:test) do |t|
7
+ t.libs << 'test'
8
+ t.libs << 'lib'
9
+ t.test_files = FileList['test/**/*_test.rb']
10
+ end
11
+
12
+ require 'rubocop/rake_task'
13
+
14
+ RuboCop::RakeTask.new
15
+
16
+ task default: %i[test rubocop]
data/bin/console ADDED
@@ -0,0 +1,15 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ require 'bundler/setup'
5
+ require 'tailwind_views_generator'
6
+
7
+ # You can add fixtures and/or initialization code here to make experimenting
8
+ # with your gem easier. You can also use a different console, if you like.
9
+
10
+ # (If you use this, don't forget to add pry to your Gemfile!)
11
+ # require 'pry'
12
+ # Pry.start
13
+
14
+ require 'irb'
15
+ IRB.start(__FILE__)
data/bin/setup ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here