From cfd0246b241cb6e58153e68f7e30ed56b9bf054b Mon Sep 17 00:00:00 2001 From: EuAndreh Date: Sun, 17 Nov 2024 20:15:02 -0300 Subject: Remove jekyll infrastructure setup --- _plugins/generate-pastebin-plaintext-alternate.rb | 44 ----------------------- 1 file changed, 44 deletions(-) delete mode 100644 _plugins/generate-pastebin-plaintext-alternate.rb (limited to '_plugins/generate-pastebin-plaintext-alternate.rb') diff --git a/_plugins/generate-pastebin-plaintext-alternate.rb b/_plugins/generate-pastebin-plaintext-alternate.rb deleted file mode 100644 index e4e798e..0000000 --- a/_plugins/generate-pastebin-plaintext-alternate.rb +++ /dev/null @@ -1,44 +0,0 @@ -require 'cgi' -CODE_BLOCK = /
(.*?)<\/pre><\/td>/m
-
-module Jekyll
-  class PlainTextGenerator < Generator
-    safe true
-
-    def generate(site)
-      site.collections.each do |collection|
-        collection_name, collection_documents = collection
-        if collection_name != "slides"
-          collection_documents.docs.each do |document|
-            n = 0
-            Renderer
-              .new(site, document)                       # create a renderer for the document
-              .run                                       # generate the HTML string
-              .scan(CODE_BLOCK)                          # match all occurrences of regexp
-              .each do |code_block|                      # iterate on each match
-                unhighlighted_code = code_block[0]       # regexp only defines 1 match (only 1 parens)
-                                      .gsub(/(.*?)<\/span>/m, '\1')
-                content = CGI.unescapeHTML unhighlighted_code
-                name = "#{document.url}.#{n}.txt"
-                plain = PlaintextPageWithoutAFile.new(site, site.source, '', name)
-                plain.content = content
-                site.pages << plain
-                n += 1
-            end
-          end
-        end
-      end
-    end
-  end
-
-  # Taken from:
-  # https://github.com/jekyll/jekyll-feed/blob/c552b8ef7bd7a4babcfb5aec2b22283a5bc354dd/lib/jekyll-feed/page-without-a-file.rb#L4
-  class PlaintextPageWithoutAFile < Jekyll::Page
-    def read_yaml(*)
-      @data ||= {
-        "plaintext" => true,
-        "generated" => true
-      }
-    end
-  end
-end
-- 
cgit v1.2.3