jekyll-tailwindcss 0.1.0-x64-mingw32
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE +21 -0
- data/LICENSE-DEPENDENCIES +26 -0
- data/README.md +53 -0
- data/Rakefile +10 -0
- data/exe/tailwindcss +18 -0
- data/exe/x64-mingw32/tailwindcss +0 -0
- data/lib/jekyll/converters/tailwindcss.rb +25 -0
- data/lib/jekyll-tailwindcss/version.rb +7 -0
- data/lib/jekyll-tailwindcss.rb +15 -0
- data/lib/tailwindcss/commands.rb +92 -0
- data/lib/tailwindcss/upstream.rb +17 -0
- metadata +56 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: ccb6520ae45fdc4a106d15bf12fdcaa0ccb3f35da68b6cedf187f7074949898d
|
4
|
+
data.tar.gz: fd4dee767a3e28f55836a6a97678939029160875c411738f4846a7b209bb8ed9
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 3f2ddb7dcd329a150a804e0e2683715071302405fb335471d15360131278010432aad09c7b99ed81cbbc3ad7ea7164a5e1ef9a29d20c1c6e840a7ebf1180ccb7
|
7
|
+
data.tar.gz: 5b71d526abff5186ffbe89b0af6858dd23e3102bac13040beebe08627f5e6ab51b6f982013d29cb3989c09ce62387d8ab19e772c80c28ccd851c2e023444fbd9
|
data/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2024 Mike Vormwald
|
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.
|
@@ -0,0 +1,26 @@
|
|
1
|
+
jekyll-tailwindcss may redistribute executables from the https://github.com/tailwindlabs/tailwindcss project
|
2
|
+
|
3
|
+
The license for that software can be found at https://github.com/tailwindlabs/tailwindcss/blob/master/LICENSE which is reproduced here for your convenience:
|
4
|
+
|
5
|
+
MIT License
|
6
|
+
|
7
|
+
Copyright (c) Adam Wathan <adam.wathan@gmail.com>
|
8
|
+
Copyright (c) Jonathan Reinink <jonathan@reinink.ca>
|
9
|
+
|
10
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
11
|
+
of this software and associated documentation files (the "Software"), to deal
|
12
|
+
in the Software without restriction, including without limitation the rights
|
13
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
14
|
+
copies of the Software, and to permit persons to whom the Software is
|
15
|
+
furnished to do so, subject to the following conditions:
|
16
|
+
|
17
|
+
The above copyright notice and this permission notice shall be included in all
|
18
|
+
copies or substantial portions of the Software.
|
19
|
+
|
20
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
21
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
22
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
23
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
24
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
25
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
26
|
+
SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,53 @@
|
|
1
|
+
# Jekyll::Tailwindcss
|
2
|
+
|
3
|
+
## Installation
|
4
|
+
|
5
|
+
Install the gem in your jekyll project's Gemfile by executing the following:
|
6
|
+
|
7
|
+
```sh
|
8
|
+
$ bundle add jekyll-tailwindcss
|
9
|
+
```
|
10
|
+
|
11
|
+
Add it to your list of jekyll-plugins
|
12
|
+
|
13
|
+
```yml
|
14
|
+
plugins:
|
15
|
+
- jekyll-tailwindcss
|
16
|
+
```
|
17
|
+
|
18
|
+
## Usage
|
19
|
+
|
20
|
+
Currently, this gem assumes you have several files in your project:
|
21
|
+
|
22
|
+
**`tailwind.config.js`**
|
23
|
+
|
24
|
+
This is the tailwind configuration for your project. Learn [more here](https://tailwindcss.com/docs/configuration).
|
25
|
+
|
26
|
+
**`_input.css`**
|
27
|
+
|
28
|
+
This file will contain your tailwind directives and any custom classes. Read more in the [docs here](https://tailwindcss.com/docs/functions-and-directives#config)
|
29
|
+
|
30
|
+
**`*.tailwindcss`**
|
31
|
+
|
32
|
+
Any files with this extension (and contain [frontmatter](https://jekyllrb.com/docs/front-matter/)) will be processed by tailwind, and converted into a corresponding filename with a `.css` extension.
|
33
|
+
|
34
|
+
For instance, `assets/css/styles.tailwindcss` will convert to `_site/assets/css/styles.css`
|
35
|
+
|
36
|
+
|
37
|
+
## Development
|
38
|
+
|
39
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
40
|
+
|
41
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
42
|
+
|
43
|
+
## Contributing
|
44
|
+
|
45
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/vormwald/jekyll-tailwindcss. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/vormwald/jekyll-tailwindcss/blob/main/CODE_OF_CONDUCT.md).
|
46
|
+
|
47
|
+
## License
|
48
|
+
|
49
|
+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
50
|
+
|
51
|
+
## Code of Conduct
|
52
|
+
|
53
|
+
Everyone interacting in the Jekyll::Tailwindcss project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/vormwald/jekyll-tailwindcss/blob/main/CODE_OF_CONDUCT.md).
|
data/Rakefile
ADDED
data/exe/tailwindcss
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
#! /usr/bin/env ruby
|
2
|
+
# because rubygems shims assume a gem's executables are Ruby
|
3
|
+
|
4
|
+
require "tailwindcss/commands"
|
5
|
+
|
6
|
+
begin
|
7
|
+
command = [Tailwindcss::Commands.executable, *ARGV]
|
8
|
+
if Gem.win_platform?
|
9
|
+
# use system rather than exec as exec inexplicably fails to find the executable on Windows
|
10
|
+
# see related https://github.com/rubys/sprockets-esbuild/pull/4
|
11
|
+
system(*command, exception: true)
|
12
|
+
else
|
13
|
+
exec(*command)
|
14
|
+
end
|
15
|
+
rescue Tailwindcss::Commands::UnsupportedPlatformException, Tailwindcss::Commands::ExecutableNotFoundException => e
|
16
|
+
warn("ERROR: " + e.message)
|
17
|
+
exit 1
|
18
|
+
end
|
Binary file
|
@@ -0,0 +1,25 @@
|
|
1
|
+
module Jekyll
|
2
|
+
module Converters
|
3
|
+
class Tailwindcss < Converter
|
4
|
+
safe true
|
5
|
+
priority :low
|
6
|
+
|
7
|
+
def matches(ext)
|
8
|
+
/^\.tailwindcss$/i.match?(ext)
|
9
|
+
end
|
10
|
+
|
11
|
+
def output_ext(ext)
|
12
|
+
".css"
|
13
|
+
end
|
14
|
+
|
15
|
+
def convert(content)
|
16
|
+
dev_mode = Jekyll.env == "development"
|
17
|
+
Jekyll.logger.info "Jekyll Tailwind:", "Generating #{dev_mode ? "" : "minified "}CSS"
|
18
|
+
|
19
|
+
compile_command = ::Tailwindcss::Commands.compile_command(debug: dev_mode).join(" ")
|
20
|
+
|
21
|
+
`#{compile_command}`
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "jekyll"
|
4
|
+
require_relative "jekyll-tailwindcss/version"
|
5
|
+
require_relative "jekyll/converters/tailwindcss"
|
6
|
+
require_relative "tailwindcss/commands"
|
7
|
+
require_relative "tailwindcss/upstream"
|
8
|
+
|
9
|
+
module Jekyll
|
10
|
+
module Tailwindcss
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
module Tailwindcss
|
15
|
+
end
|
@@ -0,0 +1,92 @@
|
|
1
|
+
require_relative "upstream"
|
2
|
+
|
3
|
+
module Tailwindcss
|
4
|
+
module Commands
|
5
|
+
DEFAULT_DIR = File.expand_path(File.join(__dir__, "..", "..", "exe"))
|
6
|
+
GEM_NAME = "jekyll-tailwindcss"
|
7
|
+
|
8
|
+
# raised when the host platform is not supported by upstream tailwindcss's binary releases
|
9
|
+
class UnsupportedPlatformException < StandardError
|
10
|
+
end
|
11
|
+
|
12
|
+
# raised when the tailwindcss executable could not be found where we expected it to be
|
13
|
+
class ExecutableNotFoundException < StandardError
|
14
|
+
end
|
15
|
+
|
16
|
+
# raised when TAILWINDCSS_INSTALL_DIR does not exist
|
17
|
+
class DirectoryNotFoundException < StandardError
|
18
|
+
end
|
19
|
+
|
20
|
+
class << self
|
21
|
+
def platform
|
22
|
+
[:cpu, :os].map { |m| Gem::Platform.local.send(m) }.join("-")
|
23
|
+
end
|
24
|
+
|
25
|
+
def executable(exe_path: DEFAULT_DIR)
|
26
|
+
tailwindcss_install_dir = ENV["TAILWINDCSS_INSTALL_DIR"]
|
27
|
+
if tailwindcss_install_dir
|
28
|
+
if File.directory?(tailwindcss_install_dir)
|
29
|
+
warn "NOTE: using TAILWINDCSS_INSTALL_DIR to find tailwindcss executable: #{tailwindcss_install_dir}"
|
30
|
+
exe_path = tailwindcss_install_dir
|
31
|
+
exe_file = File.expand_path(File.join(tailwindcss_install_dir, "tailwindcss"))
|
32
|
+
else
|
33
|
+
raise DirectoryNotFoundException, <<~MESSAGE
|
34
|
+
TAILWINDCSS_INSTALL_DIR is set to #{tailwindcss_install_dir}, but that directory does not exist.
|
35
|
+
MESSAGE
|
36
|
+
end
|
37
|
+
else
|
38
|
+
if Tailwindcss::Upstream::NATIVE_PLATFORMS.keys.none? { |p| Gem::Platform.match_gem?(Gem::Platform.new(p), GEM_NAME) }
|
39
|
+
raise UnsupportedPlatformException, <<~MESSAGE
|
40
|
+
jekyll-tailwindcss does not support the #{platform} platform
|
41
|
+
Please install tailwindcss following instructions at https://tailwindcss.com/docs/installation
|
42
|
+
MESSAGE
|
43
|
+
end
|
44
|
+
|
45
|
+
exe_file = Dir.glob(File.expand_path(File.join(exe_path, "*", "tailwindcss"))).find do |f|
|
46
|
+
Gem::Platform.match_gem?(Gem::Platform.new(File.basename(File.dirname(f))), GEM_NAME)
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
if exe_file.nil? || !File.exist?(exe_file)
|
51
|
+
raise ExecutableNotFoundException, <<~MESSAGE
|
52
|
+
Cannot find the tailwindcss executable for #{platform} in #{exe_path}
|
53
|
+
|
54
|
+
If you're using bundler, please make sure you're on the latest bundler version:
|
55
|
+
|
56
|
+
gem install bundler
|
57
|
+
bundle update --bundler
|
58
|
+
|
59
|
+
Then make sure your lock file includes this platform by running:
|
60
|
+
|
61
|
+
bundle lock --add-platform #{platform}
|
62
|
+
bundle install
|
63
|
+
|
64
|
+
See `bundle lock --help` output for details.
|
65
|
+
|
66
|
+
TODO If you're still seeing this message after taking those steps, try running
|
67
|
+
`bundle config` and ensure `force_ruby_platform` isn't set to `true`. See
|
68
|
+
https://github.com/vormwald/jekyll-tailwindcss#check-bundle_force_ruby_platform
|
69
|
+
for more details.
|
70
|
+
MESSAGE
|
71
|
+
end
|
72
|
+
|
73
|
+
exe_file
|
74
|
+
end
|
75
|
+
|
76
|
+
def compile_command(debug: false, **kwargs)
|
77
|
+
command = [
|
78
|
+
executable(**kwargs),
|
79
|
+
"-i", "./_input.css",
|
80
|
+
"-c", "./tailwind.config.js"
|
81
|
+
]
|
82
|
+
|
83
|
+
command << "--minify" unless debug
|
84
|
+
|
85
|
+
postcss_path = "postcss.config.js"
|
86
|
+
command += ["--postcss", postcss_path] if File.exist?(postcss_path)
|
87
|
+
|
88
|
+
command
|
89
|
+
end
|
90
|
+
end
|
91
|
+
end
|
92
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module Tailwindcss
|
2
|
+
# constants describing the upstream tailwindcss project
|
3
|
+
module Upstream
|
4
|
+
VERSION = "v3.4.3"
|
5
|
+
|
6
|
+
# rubygems platform name => upstream release filename
|
7
|
+
NATIVE_PLATFORMS = {
|
8
|
+
"arm64-darwin" => "tailwindcss-macos-arm64",
|
9
|
+
"x64-mingw32" => "tailwindcss-windows-x64.exe",
|
10
|
+
"x64-mingw-ucrt" => "tailwindcss-windows-x64.exe",
|
11
|
+
"x86_64-darwin" => "tailwindcss-macos-x64",
|
12
|
+
"x86_64-linux" => "tailwindcss-linux-x64",
|
13
|
+
"aarch64-linux" => "tailwindcss-linux-arm64",
|
14
|
+
"arm-linux" => "tailwindcss-linux-armv7"
|
15
|
+
}
|
16
|
+
end
|
17
|
+
end
|
metadata
ADDED
@@ -0,0 +1,56 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: jekyll-tailwindcss
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: x64-mingw32
|
6
|
+
authors:
|
7
|
+
- Mike Vormwald
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2024-04-16 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
13
|
+
description:
|
14
|
+
email:
|
15
|
+
- mvormwald@gmail.com
|
16
|
+
executables:
|
17
|
+
- tailwindcss
|
18
|
+
extensions: []
|
19
|
+
extra_rdoc_files: []
|
20
|
+
files:
|
21
|
+
- LICENSE
|
22
|
+
- LICENSE-DEPENDENCIES
|
23
|
+
- README.md
|
24
|
+
- Rakefile
|
25
|
+
- exe/tailwindcss
|
26
|
+
- exe/x64-mingw32/tailwindcss
|
27
|
+
- lib/jekyll-tailwindcss.rb
|
28
|
+
- lib/jekyll-tailwindcss/version.rb
|
29
|
+
- lib/jekyll/converters/tailwindcss.rb
|
30
|
+
- lib/tailwindcss/commands.rb
|
31
|
+
- lib/tailwindcss/upstream.rb
|
32
|
+
homepage: https://github.com/vormwald/jekyll-tailwindcss
|
33
|
+
licenses:
|
34
|
+
- MIT
|
35
|
+
metadata:
|
36
|
+
homepage_uri: https://github.com/vormwald/jekyll-tailwindcss
|
37
|
+
post_install_message:
|
38
|
+
rdoc_options: []
|
39
|
+
require_paths:
|
40
|
+
- lib
|
41
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
42
|
+
requirements:
|
43
|
+
- - ">="
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: 3.0.0
|
46
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
47
|
+
requirements:
|
48
|
+
- - ">="
|
49
|
+
- !ruby/object:Gem::Version
|
50
|
+
version: '0'
|
51
|
+
requirements: []
|
52
|
+
rubygems_version: 3.4.20
|
53
|
+
signing_key:
|
54
|
+
specification_version: 4
|
55
|
+
summary: Integrate Tailwind CSS into your Jekyll site.
|
56
|
+
test_files: []
|