jekyll 3.9.3 → 4.0.0.pre.alpha1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +27 -50
- data/LICENSE +1 -1
- data/README.markdown +46 -17
- data/lib/blank_template/_config.yml +3 -0
- data/lib/blank_template/_layouts/default.html +12 -0
- data/lib/blank_template/_sass/main.scss +9 -0
- data/lib/blank_template/assets/css/main.scss +4 -0
- data/lib/blank_template/index.md +8 -0
- data/lib/jekyll/cache.rb +183 -0
- data/lib/jekyll/cleaner.rb +2 -1
- data/lib/jekyll/collection.rb +78 -8
- data/lib/jekyll/command.rb +31 -6
- data/lib/jekyll/commands/build.rb +11 -20
- data/lib/jekyll/commands/clean.rb +2 -0
- data/lib/jekyll/commands/doctor.rb +15 -8
- data/lib/jekyll/commands/help.rb +1 -1
- data/lib/jekyll/commands/new.rb +37 -42
- data/lib/jekyll/commands/new_theme.rb +30 -28
- data/lib/jekyll/commands/serve/live_reload_reactor.rb +6 -10
- data/lib/jekyll/commands/serve/servlet.rb +15 -19
- data/lib/jekyll/commands/serve.rb +46 -86
- data/lib/jekyll/configuration.rb +26 -26
- data/lib/jekyll/converters/identity.rb +18 -0
- data/lib/jekyll/converters/markdown/kramdown_parser.rb +1 -10
- data/lib/jekyll/converters/markdown.rb +49 -40
- data/lib/jekyll/converters/smartypants.rb +34 -14
- data/lib/jekyll/convertible.rb +11 -13
- data/lib/jekyll/deprecator.rb +1 -3
- data/lib/jekyll/document.rb +44 -41
- data/lib/jekyll/drops/collection_drop.rb +2 -3
- data/lib/jekyll/drops/document_drop.rb +2 -1
- data/lib/jekyll/drops/drop.rb +3 -6
- data/lib/jekyll/drops/excerpt_drop.rb +4 -0
- data/lib/jekyll/drops/site_drop.rb +4 -13
- data/lib/jekyll/drops/unified_payload_drop.rb +1 -0
- data/lib/jekyll/drops/url_drop.rb +1 -0
- data/lib/jekyll/entry_filter.rb +2 -1
- data/lib/jekyll/excerpt.rb +45 -34
- data/lib/jekyll/external.rb +10 -5
- data/lib/jekyll/filters/date_filters.rb +6 -3
- data/lib/jekyll/filters/grouping_filters.rb +1 -2
- data/lib/jekyll/filters/url_filters.rb +6 -1
- data/lib/jekyll/filters.rb +72 -31
- data/lib/jekyll/frontmatter_defaults.rb +35 -19
- data/lib/jekyll/hooks.rb +2 -3
- data/lib/jekyll/liquid_extensions.rb +0 -2
- data/lib/jekyll/liquid_renderer/file.rb +14 -3
- data/lib/jekyll/liquid_renderer/table.rb +67 -65
- data/lib/jekyll/liquid_renderer.rb +13 -1
- data/lib/jekyll/log_adapter.rb +5 -1
- data/lib/jekyll/mime.types +80 -195
- data/lib/jekyll/page.rb +10 -11
- data/lib/jekyll/page_without_a_file.rb +0 -4
- data/lib/jekyll/plugin.rb +5 -11
- data/lib/jekyll/plugin_manager.rb +2 -0
- data/lib/jekyll/reader.rb +38 -8
- data/lib/jekyll/readers/data_reader.rb +5 -5
- data/lib/jekyll/readers/layout_reader.rb +2 -12
- data/lib/jekyll/readers/post_reader.rb +29 -17
- data/lib/jekyll/readers/static_file_reader.rb +1 -1
- data/lib/jekyll/readers/theme_assets_reader.rb +7 -5
- data/lib/jekyll/regenerator.rb +4 -12
- data/lib/jekyll/renderer.rb +14 -25
- data/lib/jekyll/site.rb +78 -34
- data/lib/jekyll/static_file.rb +47 -11
- data/lib/jekyll/stevenson.rb +2 -3
- data/lib/jekyll/tags/highlight.rb +22 -52
- data/lib/jekyll/tags/include.rb +27 -48
- data/lib/jekyll/tags/link.rb +11 -7
- data/lib/jekyll/tags/post_url.rb +17 -16
- data/lib/jekyll/theme.rb +12 -23
- data/lib/jekyll/theme_builder.rb +91 -89
- data/lib/jekyll/url.rb +3 -2
- data/lib/jekyll/utils/ansi.rb +1 -1
- data/lib/jekyll/utils/exec.rb +0 -1
- data/lib/jekyll/utils/internet.rb +2 -4
- data/lib/jekyll/utils/platforms.rb +8 -8
- data/lib/jekyll/utils/thread_event.rb +1 -5
- data/lib/jekyll/utils/win_tz.rb +47 -18
- data/lib/jekyll/utils.rb +5 -4
- data/lib/jekyll/version.rb +1 -1
- data/lib/jekyll.rb +5 -0
- data/lib/site_template/.gitignore +2 -0
- data/lib/site_template/404.html +1 -0
- data/lib/site_template/_config.yml +17 -5
- data/lib/site_template/_posts/0000-00-00-welcome-to-jekyll.markdown.erb +5 -1
- data/lib/site_template/{about.md → about.markdown} +0 -0
- data/lib/site_template/{index.md → index.markdown} +0 -0
- data/lib/theme_template/gitignore.erb +1 -0
- data/rubocop/jekyll/assert_equal_literal_actual.rb +149 -0
- metadata +75 -48
- data/lib/jekyll/commands/serve/mime_types_charset.json +0 -71
- data/lib/jekyll/converters/markdown/rdiscount_parser.rb +0 -37
- data/lib/jekyll/converters/markdown/redcarpet_parser.rb +0 -112
- data/lib/jekyll/utils/rouge.rb +0 -22
@@ -1,112 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
class Jekyll::Converters::Markdown::RedcarpetParser
|
4
|
-
module CommonMethods
|
5
|
-
def add_code_tags(code, lang)
|
6
|
-
code = code.to_s
|
7
|
-
code = code.sub(
|
8
|
-
%r!<pre>!,
|
9
|
-
"<pre><code class=\"language-#{lang}\" data-lang=\"#{lang}\">"
|
10
|
-
)
|
11
|
-
code = code.sub(%r!</pre>!, "</code></pre>")
|
12
|
-
code
|
13
|
-
end
|
14
|
-
end
|
15
|
-
|
16
|
-
module WithPygments
|
17
|
-
include CommonMethods
|
18
|
-
def block_code(code, lang)
|
19
|
-
unless defined?(Pygments)
|
20
|
-
Jekyll::External.require_with_graceful_fail("pygments")
|
21
|
-
end
|
22
|
-
lang = lang && lang.split.first || "text"
|
23
|
-
add_code_tags(
|
24
|
-
Pygments.highlight(
|
25
|
-
code,
|
26
|
-
{
|
27
|
-
:lexer => lang,
|
28
|
-
:options => { :encoding => "utf-8" },
|
29
|
-
}
|
30
|
-
),
|
31
|
-
lang
|
32
|
-
)
|
33
|
-
end
|
34
|
-
end
|
35
|
-
|
36
|
-
module WithoutHighlighting
|
37
|
-
require "cgi"
|
38
|
-
|
39
|
-
include CommonMethods
|
40
|
-
|
41
|
-
def code_wrap(code)
|
42
|
-
"<figure class=\"highlight\"><pre>#{CGI.escapeHTML(code)}</pre></figure>"
|
43
|
-
end
|
44
|
-
|
45
|
-
def block_code(code, lang)
|
46
|
-
lang = lang && lang.split.first || "text"
|
47
|
-
add_code_tags(code_wrap(code), lang)
|
48
|
-
end
|
49
|
-
end
|
50
|
-
|
51
|
-
module WithRouge
|
52
|
-
def block_code(_code, lang)
|
53
|
-
code = "<pre>#{super}</pre>"
|
54
|
-
|
55
|
-
"<div class=\"highlight\">#{add_code_tags(code, lang)}</div>"
|
56
|
-
end
|
57
|
-
|
58
|
-
protected
|
59
|
-
def rouge_formatter(_lexer)
|
60
|
-
Jekyll::Utils::Rouge.html_formatter(:wrap => false)
|
61
|
-
end
|
62
|
-
end
|
63
|
-
|
64
|
-
def initialize(config)
|
65
|
-
unless defined?(Redcarpet)
|
66
|
-
Jekyll::External.require_with_graceful_fail("redcarpet")
|
67
|
-
end
|
68
|
-
@config = config
|
69
|
-
@redcarpet_extensions = {}
|
70
|
-
@config["redcarpet"]["extensions"].each do |e|
|
71
|
-
@redcarpet_extensions[e.to_sym] = true
|
72
|
-
end
|
73
|
-
|
74
|
-
@renderer ||= class_with_proper_highlighter(@config["highlighter"])
|
75
|
-
end
|
76
|
-
|
77
|
-
def class_with_proper_highlighter(highlighter)
|
78
|
-
Class.new(Redcarpet::Render::HTML) do
|
79
|
-
case highlighter
|
80
|
-
when "pygments"
|
81
|
-
include WithPygments
|
82
|
-
when "rouge"
|
83
|
-
Jekyll::External.require_with_graceful_fail(%w(
|
84
|
-
rouge rouge/plugins/redcarpet
|
85
|
-
))
|
86
|
-
|
87
|
-
unless Gem::Version.new(Rouge.version) > Gem::Version.new("1.3.0")
|
88
|
-
abort "Please install Rouge 1.3.0 or greater and try running Jekyll again."
|
89
|
-
end
|
90
|
-
|
91
|
-
include Rouge::Plugins::Redcarpet
|
92
|
-
include CommonMethods
|
93
|
-
include WithRouge
|
94
|
-
else
|
95
|
-
include WithoutHighlighting
|
96
|
-
end
|
97
|
-
end
|
98
|
-
end
|
99
|
-
|
100
|
-
def convert(content)
|
101
|
-
@redcarpet_extensions[:fenced_code_blocks] = \
|
102
|
-
!@redcarpet_extensions[:no_fenced_code_blocks]
|
103
|
-
if @redcarpet_extensions[:smart]
|
104
|
-
@renderer.send :include, Redcarpet::Render::SmartyPants
|
105
|
-
end
|
106
|
-
markdown = Redcarpet::Markdown.new(
|
107
|
-
@renderer.new(@redcarpet_extensions),
|
108
|
-
@redcarpet_extensions
|
109
|
-
)
|
110
|
-
markdown.render(content)
|
111
|
-
end
|
112
|
-
end
|
data/lib/jekyll/utils/rouge.rb
DELETED
@@ -1,22 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
Jekyll::External.require_with_graceful_fail("rouge")
|
4
|
-
|
5
|
-
module Jekyll
|
6
|
-
module Utils
|
7
|
-
module Rouge
|
8
|
-
|
9
|
-
def self.html_formatter(*args)
|
10
|
-
if old_api?
|
11
|
-
::Rouge::Formatters::HTML.new(*args)
|
12
|
-
else
|
13
|
-
::Rouge::Formatters::HTMLLegacy.new(*args)
|
14
|
-
end
|
15
|
-
end
|
16
|
-
|
17
|
-
def self.old_api?
|
18
|
-
::Rouge.version.to_s < "2"
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|