jekyll-cleansing-rite 1.0.0 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9fda341374b5172d97faf8ced67c4cf0238d56c25de9a3b999b82871ca240c7d
4
- data.tar.gz: 89cbf06938267af55faed3b338c51ec13e07ac1fc7b36d9c84a2d8f4e07f5fa0
3
+ metadata.gz: 3134edb3a57509e2396655752ff5882d4ec53d39a47cb66f2855fed263dd9db9
4
+ data.tar.gz: 3cb38d52a69dbbfdea6bd231428e39d1e983594097213ce5d79b0ffc03504eaf
5
5
  SHA512:
6
- metadata.gz: d64b0f717badccfb563d0cbc29ed634290e2826607bbf528ecf9fe8e6d2366a650573d11e27de1f623210515fbdd7b78c78291e437bcdb2854a02ed12bbcdecd
7
- data.tar.gz: d3337d7adef50e8c1485e9ee07030e900addd32e4cec8197d9c6d7c858aba44cc6b2e44759ec476a275b93422227abcae003896daf76c4a870f973ecee74461c
6
+ metadata.gz: 208266f5ef11f8e12c707ae525a375addd90d7bca5df302786fbe22abf40520ebed6fb8a675ac5e9ab20d66a5010b91faeba0953b141bf9da4ebaa27b1256c1d
7
+ data.tar.gz: f73530dea07dd8430a3a5fbdc3b1290bd3a575d6907c08c5fe187146c5b2ff3386e309fb32bb2a91863ce5f60e68e397216ab5ddb01cf6e6180d36f7b08181ab
data/LICENSE.md ADDED
@@ -0,0 +1,9 @@
1
+ # Released under MIT License
2
+
3
+ Copyright (c) 2024 Jamison Griffith.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
+
7
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8
+
9
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,61 @@
1
+ # Praise the Omnissiah!
2
+
3
+ Jekyll Cleansing Rite purges heretical voidspace from HTML to appease Jekyll's Machine Spirit.
4
+
5
+ ## Huh?
6
+
7
+ The Cleansing Rite first consists of lighting incense to appease Jekyll's Machine Spirit. Then, when Jekyll is rendering documents and pages, sacred Rituals will be performed to cleanse voidspace-ridden files. Those with arcane mastery of the command prompt may view these rituals if the following incantation is invoked:
8
+ ```
9
+ $ JEKYLL_LOG_LEVEL='debug' jekyll build
10
+ ```
11
+
12
+ ## The Following is Considered Great Heresy
13
+
14
+ This plugin uses [htmlbeautifier](https://github.com/threedaymonk/htmlbeautifier) to format HTML output before its written to a file in Jekyll's render pipeline. It exists because the resulting HTML source code that Jekyll outputs by default is pretty gross:
15
+
16
+ ### HTML without Cleaning Rite
17
+ ```html
18
+ <body>
19
+ <div class="container">
20
+ <header class="masthead">
21
+ <h3 class="masthead-title">
22
+ <a href="/" title="Home">Jamogriff</a>
23
+ </h3>
24
+
25
+ <ul class="nav">
26
+
27
+
28
+
29
+ <li>
30
+ <a href="/about/">About</a>
31
+ </li>
32
+
33
+
34
+ </ul>
35
+
36
+
37
+ </header>
38
+ ```
39
+
40
+ ### HTML with Cleansing Rite
41
+ ```html
42
+ <body>
43
+ <div class="container">
44
+ <header class="masthead">
45
+ <h3 class="masthead-title">
46
+ <a href="/" title="Home">Jamogriff</a>
47
+ </h3>
48
+ <ul class="nav">
49
+ <li>
50
+ <a href="/about/">About</a>
51
+ </li>
52
+ </ul>
53
+ </header>
54
+ ```
55
+
56
+ ## Available as a Gem
57
+ Just add the following to your Jekyll site's `_config.yml`:
58
+ ```yaml
59
+ plugins:
60
+ - jekyll-cleansing-rite
61
+ ```
@@ -0,0 +1,17 @@
1
+ module Jekyll
2
+ module CleansingRite
3
+ class DocumentRitual < Ritual
4
+
5
+ def initialize(logger)
6
+ super
7
+ end
8
+
9
+ def perform(doc)
10
+ @logger.debug('Cleansing Spirit:', doc.relative_path)
11
+ doc.output = self.cleanse(doc.output)
12
+ end
13
+
14
+ end
15
+ end
16
+ end
17
+
@@ -0,0 +1,17 @@
1
+ module Jekyll
2
+ module CleansingRite
3
+ class PageRitual < Ritual
4
+
5
+ def initialize(logger)
6
+ super
7
+ end
8
+
9
+ def perform(page)
10
+ @logger.debug('Cleansing Spirit:', page.name)
11
+ page.output = self.cleanse(page.output)
12
+ end
13
+
14
+ end
15
+ end
16
+ end
17
+
@@ -0,0 +1,25 @@
1
+ require 'htmlbeautifier'
2
+
3
+ module Jekyll
4
+ module CleansingRite
5
+ class Ritual
6
+ attr_reader :logger
7
+
8
+ def initialize(logger)
9
+ @logger = logger
10
+ @logger.debug("Invocation:", "#{self.class.name.split('::').last} has been instantiated")
11
+ end
12
+
13
+ def perform(file)
14
+ raise NotImplementedError, "#{self.class} has not implemented method '#{__method__}'"
15
+ end
16
+
17
+ protected
18
+
19
+ def cleanse(uncleansed_html)
20
+ HtmlBeautifier.beautify(uncleansed_html)
21
+ end
22
+
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Jekyll
4
+ module CleansingRite
5
+ VERSION = "1.0.2"
6
+ end
7
+ end
@@ -24,7 +24,7 @@ module Jekyll
24
24
  end
25
25
 
26
26
  Jekyll::Hooks.register :site, :after_init do |site|
27
- Jekyll.logger.debug('Lighting incense:', 'Jekyll\'s Machine Spirit is pleased')
27
+ puts 'Lighting incense: '.rjust(20) + ' Jekyll\'s Machine Spirit is pleased'
28
28
  end
29
29
 
30
30
  Jekyll::Hooks.register :pages, :post_render do |page|
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-cleansing-rite
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jamison Griffith
@@ -65,7 +65,13 @@ executables: []
65
65
  extensions: []
66
66
  extra_rdoc_files: []
67
67
  files:
68
+ - LICENSE.md
69
+ - README.md
68
70
  - lib/jekyll-cleansing-rite.rb
71
+ - lib/jekyll-cleansing-rite/document_ritual.rb
72
+ - lib/jekyll-cleansing-rite/page_ritual.rb
73
+ - lib/jekyll-cleansing-rite/ritual.rb
74
+ - lib/jekyll-cleansing-rite/version.rb
69
75
  homepage: https://github.com/jamogriff/jekyll-cleansing-rite
70
76
  licenses:
71
77
  - MIT