Merge branch 'master' into oe-patch-1

This commit is contained in:
Ashwin Maroli 2018-05-11 12:41:02 +05:30
commit 8bb98632b4
17 changed files with 25 additions and 138 deletions

View File

@ -76,7 +76,6 @@ group :jekyll_optional_dependencies do
gem "classifier-reborn", "~> 2.2.0" gem "classifier-reborn", "~> 2.2.0"
gem "liquid-c", "~> 3.0" gem "liquid-c", "~> 3.0"
gem "pygments.rb", "~> 1.0" gem "pygments.rb", "~> 1.0"
gem "rdiscount", "~> 2.0"
gem "yajl-ruby", "~> 1.3" gem "yajl-ruby", "~> 1.3"
end end

View File

@ -1,5 +1,7 @@
## HEAD ## HEAD
* Textile is only supported through a converter plugin (#7003)
### Documentation ### Documentation
* Release post for v3.8.0 (#6849) * Release post for v3.8.0 (#6849)
@ -14,6 +16,9 @@
* Update Windows install docs (#6926) * Update Windows install docs (#6926)
* Remove documentation for using Redcarpet (#6990) * Remove documentation for using Redcarpet (#6990)
* Updated nginx configuration for custom-404-page documentation (#6994) * Updated nginx configuration for custom-404-page documentation (#6994)
* List all static files variables (#7002)
* Document that _drafts need to be contained within the custom collection directory (#6985)
* proposed change for passive voice. (#7005)
### Minor Enhancements ### Minor Enhancements
@ -31,6 +36,7 @@
* We are not using Ruby 2.2 anymore (#6977) * We are not using Ruby 2.2 anymore (#6977)
* Drop support for older versions of Rouge (#6978) * Drop support for older versions of Rouge (#6978)
* Remove support for Redcarpet (#6987) * Remove support for Redcarpet (#6987)
* Remove support for rdiscount (#6988)
### Development Fixes ### Development Fixes
@ -38,6 +44,7 @@
* Loggers should accept both numbers and symbols (#6967) * Loggers should accept both numbers and symbols (#6967)
* Update instructions for releasing docs Gem (#6975) * Update instructions for releasing docs Gem (#6975)
* yajl-ruby update to v1.4.0 (#6976) * yajl-ruby update to v1.4.0 (#6976)
* Load Rouge for TestKramdown (#7007)
## 3.8.1 / 2018-05-01 ## 3.8.1 / 2018-05-01

View File

@ -56,9 +56,9 @@ defaults:
</div> </div>
<div class="note warning"> <div class="note warning">
<h5>Be sure to move posts into custom collections directory</h5> <h5>Be sure to move drafts and posts into custom collections directory</h5>
<p>If you specify a directory to store all your collections in the same place with <code>collections_dir: my_collections</code>, then you will need to move your <code>_posts</code> directory to <code>my_collections/_posts</code>. Note that, the name of your collections directory cannot start with an underscore (`_`).</p> <p>If you specify a directory to store all your collections in the same place with <code>collections_dir: my_collections</code>, then you will need to move your <code>_drafts</code> and <code>_posts</code> directory to <code>my_collections/_drafts</code> and <code>my_collections/_posts</code>. Note that, the name of your collections directory cannot start with an underscore (`_`).</p>
</div> </div>
### Step 2: Add your content {#step2} ### Step 2: Add your content {#step2}

View File

@ -16,7 +16,7 @@ Whether you're a developer, a designer, or just a Jekyll devotee, there are lots
* [Install Jekyll on your computer](https://jekyllrb.com/docs/installation/) and kick the tires. Does it work? Does it do what you'd expect? If not, [open an issue](https://github.com/jekyll/jekyll/issues/new) and let us know. * [Install Jekyll on your computer](https://jekyllrb.com/docs/installation/) and kick the tires. Does it work? Does it do what you'd expect? If not, [open an issue](https://github.com/jekyll/jekyll/issues/new) and let us know.
* Comment on some of the project's [open issues](https://github.com/jekyll/jekyll/issues). Have you experienced the same problem? Know a work around? Do you have a suggestion for how the feature could be better? * Comment on some of the project's [open issues](https://github.com/jekyll/jekyll/issues). Have you experienced the same problem? Know a work around? Do you have a suggestion for how the feature could be better?
* Read through [the documentation](https://jekyllrb.com/docs/home/), and click the "improve this page" button, any time you see something confusing, or have a suggestion for something that could be improved. * Read through [the documentation](https://jekyllrb.com/docs/home/), and click the "improve this page" button, any time you see something confusing, or have a suggestion on how to improve something.
* Browse through [the Jekyll discussion forum](https://talk.jekyllrb.com/), and lend a hand answering questions. There's a good chance you've already experienced what another user is experiencing. * Browse through [the Jekyll discussion forum](https://talk.jekyllrb.com/), and lend a hand answering questions. There's a good chance you've already experienced what another user is experiencing.
* Find [an open issue](https://github.com/jekyll/jekyll/issues) (especially [those labeled `help-wanted`](https://github.com/jekyll/jekyll/issues?q=is%3Aopen+is%3Aissue+label%3Ahelp-wanted)), and submit a proposed fix. If it's your first pull request, we promise we won't bite, and are glad to answer any questions. * Find [an open issue](https://github.com/jekyll/jekyll/issues) (especially [those labeled `help-wanted`](https://github.com/jekyll/jekyll/issues?q=is%3Aopen+is%3Aissue+label%3Ahelp-wanted)), and submit a proposed fix. If it's your first pull request, we promise we won't bite, and are glad to answer any questions.
* Help evaluate [open pull requests](https://github.com/jekyll/jekyll/pulls), by testing the changes locally and reviewing what's proposed. * Help evaluate [open pull requests](https://github.com/jekyll/jekyll/pulls), by testing the changes locally and reviewing what's proposed.

View File

@ -14,7 +14,7 @@ your `_config.yml` under `plugins`. For Jekyll 2, this is standard.
<div class="note info"> <div class="note info">
<h5>Pagination only works within HTML files</h5> <h5>Pagination only works within HTML files</h5>
<p> <p>
Pagination does not work from within Markdown or Textile files from Pagination does not work from within Markdown files from
your Jekyll site. Pagination works when called from within the HTML your Jekyll site. Pagination works when called from within the HTML
file, named <code>index.html</code>, which optionally may reside in and file, named <code>index.html</code>, which optionally may reside in and
produce pagination from within a subdirectory, via the produce pagination from within a subdirectory, via the

View File

@ -5,7 +5,8 @@ permalink: /docs/structure/
Jekyll is, at its core, a text transformation engine. The concept behind the Jekyll is, at its core, a text transformation engine. The concept behind the
system is this: you give it text written in your favorite markup language, be system is this: you give it text written in your favorite markup language, be
that Markdown, Textile, or just plain HTML, and it churns that through a layout that Markdown, [Textile](https://github.com/jekyll/jekyll-textile-converter)
, or just plain HTML, and it churns that through a layout
or a series of layout files. Throughout that process you can tweak how you want or a series of layout files. Throughout that process you can tweak how you want
the site URLs to look, what data gets displayed in the layout, and more. This the site URLs to look, what data gets displayed in the layout, and more. This
is all done through editing text files; the static web site is the final is all done through editing text files; the static web site is the final
@ -185,7 +186,7 @@ An overview of what each of these does:
<tr> <tr>
<td> <td>
<p><code>index.html</code> or <code>index.md</code> and other HTML, <p><code>index.html</code> or <code>index.md</code> and other HTML,
Markdown, Textile files</p> Markdown files</p>
</td> </td>
<td> <td>
<p> <p>

View File

@ -44,6 +44,10 @@ For `site.collections.myCollection` in Jekyll 2, you now do:
This is a bit cumbersome at first, but is easier than a big `for` loop. This is a bit cumbersome at first, but is easier than a big `for` loop.
### Textile support
We dropped native support for Textile, from now on you have to install our [jekyll-textile-converter](https://github.com/jekyll/jekyll-textile-converter) plugin to work with Textile files.
### Dropped dependencies ### Dropped dependencies
We dropped a number of dependencies the Core Team felt were optional. As such, in 3.0, they must be explicitly installed and included if you use any of the features. They are: We dropped a number of dependencies the Core Team felt were optional. As such, in 3.0, they must be explicitly installed and included if you use any of the features. They are:

View File

@ -124,8 +124,7 @@ following is a reference of the available data.
A list of all <a href="/docs/static-files/">static files</a> (i.e. A list of all <a href="/docs/static-files/">static files</a> (i.e.
files not processed by Jekyll's converters or the Liquid renderer). files not processed by Jekyll's converters or the Liquid renderer).
Each file has three properties: <code>path</code>, Each file has five properties: <code>path</code>, <code>modified_time</code>, <code>name</code>, <code>basename</code> and <code>extname</code>.
<code>modified_time</code> and <code>extname</code>.
</p></td> </p></td>
</tr> </tr>

View File

@ -21,7 +21,7 @@ overview: true
</div> </div>
<div class="unit one-third"> <div class="unit one-third">
<h2>Static</h2> <h2>Static</h2>
<p><a href="https://daringfireball.net/projects/markdown/">Markdown</a> (or <a href="http://redcloth.org/textile">Textile</a>), <a href="https://github.com/Shopify/liquid/wiki">Liquid</a>, HTML <span class="amp">&amp;</span> CSS go in. Static sites come out ready for deployment.</p> <p><a href="https://daringfireball.net/projects/markdown/">Markdown</a>, <a href="https://github.com/Shopify/liquid/wiki">Liquid</a>, HTML <span class="amp">&amp;</span> CSS go in. Static sites come out ready for deployment.</p>
<a href="/docs/templates/">Jekyll template guide &rarr;</a> <a href="/docs/templates/">Jekyll template guide &rarr;</a>
</div> </div>
<div class="unit one-third"> <div class="unit one-third">

View File

@ -65,14 +65,6 @@ Feature: Site configuration
And the "_site/Rakefile" file should not exist And the "_site/Rakefile" file should not exist
And the "_site/README" file should not exist And the "_site/README" file should not exist
Scenario: Use RDiscount for markup
Given I have an "index.markdown" page that contains "[Google](https://www.google.com)"
And I have a configuration file with "markdown" set to "rdiscount"
When I run jekyll build
Then I should get a zero exit status
And the _site directory should exist
And I should see "<a href=\"https://www.google.com\">Google</a>" in "_site/index.html"
Scenario: Use Kramdown for markup Scenario: Use Kramdown for markup
Given I have an "index.markdown" page that contains "[Google](https://www.google.com)" Given I have an "index.markdown" page that contains "[Google](https://www.google.com)"
And I have a configuration file with "markdown" set to "kramdown" And I have a configuration file with "markdown" set to "kramdown"

View File

@ -66,10 +66,6 @@ module Jekyll
"strict_variables" => false, "strict_variables" => false,
}, },
"rdiscount" => {
"extensions" => [],
},
"kramdown" => { "kramdown" => {
"auto_ids" => true, "auto_ids" => true,
"toc_levels" => "1..6", "toc_levels" => "1..6",

View File

@ -30,8 +30,7 @@ module Jekyll
# rubocop:disable Naming/AccessorMethodName # rubocop:disable Naming/AccessorMethodName
def get_processor def get_processor
case @config["markdown"].downcase case @config["markdown"].downcase
when "kramdown" then return KramdownParser.new(@config) when "kramdown" then return KramdownParser.new(@config)
when "rdiscount" then return RDiscountParser.new(@config)
else else
custom_processor custom_processor
end end
@ -43,7 +42,7 @@ module Jekyll
# are not in safe mode.) # are not in safe mode.)
def valid_processors def valid_processors
%w(rdiscount kramdown) + third_party_processors %w(kramdown) + third_party_processors
end end
# Public: A list of processors that you provide via plugins. # Public: A list of processors that you provide via plugins.
@ -52,7 +51,7 @@ module Jekyll
def third_party_processors def third_party_processors
self.class.constants - \ self.class.constants - \
%w(KramdownParser RDiscountParser PRIORITIES).map( %w(KramdownParser PRIORITIES).map(
&:to_sym &:to_sym
) )
end end

View File

@ -1,37 +0,0 @@
# frozen_string_literal: true
module Jekyll
module Converters
class Markdown
class RDiscountParser
def initialize(config)
unless defined?(RDiscount)
Jekyll::External.require_with_graceful_fail "rdiscount"
end
@config = config
@rdiscount_extensions = @config["rdiscount"]["extensions"].map(&:to_sym)
end
def convert(content)
rd = RDiscount.new(content, *@rdiscount_extensions)
html = rd.to_html
if @config["rdiscount"]["toc_token"]
html = replace_generated_toc(rd, html, @config["rdiscount"]["toc_token"])
end
html
end
private
def replace_generated_toc(rd_instance, html, toc_token)
if rd_instance.generate_toc && html.include?(toc_token)
utf8_toc = rd_instance.toc_content
utf8_toc.force_encoding("utf-8") if utf8_toc.respond_to?(:force_encoding)
html.gsub(toc_token, utf8_toc)
else
html
end
end
end
end
end
end

View File

@ -34,10 +34,6 @@ require_relative "../lib/jekyll.rb"
Jekyll.logger = Logger.new(StringIO.new, :error) Jekyll.logger = Logger.new(StringIO.new, :error)
unless jruby?
require "rdiscount"
end
require "kramdown" require "kramdown"
require "shoulda" require "shoulda"

View File

@ -1,6 +1,7 @@
# frozen_string_literal: true # frozen_string_literal: true
require "helper" require "helper"
require "rouge"
class TestKramdown < JekyllUnitTest class TestKramdown < JekyllUnitTest
context "kramdown" do context "kramdown" do

View File

@ -1,51 +0,0 @@
# frozen_string_literal: true
require "helper"
class TestRdiscount < JekyllUnitTest
context "rdiscount" do
setup do
if jruby?
then skip(
"JRuby does not perform well with CExt, test disabled."
)
end
config = {
"markdown" => "rdiscount",
"rdiscount" => {
"toc_token" => "{:toc}",
"extensions" => %w(smart generate_toc),
},
}
@markdown = Converters::Markdown.new config
end
should "pass rdiscount extensions" do
assert_equal "<p>&ldquo;smart&rdquo;</p>", @markdown.convert('"smart"').strip
end
should "render toc" do
toc = <<-TOC
<a name="Header.1"></a>
<h1>Header 1</h1>
<a name="Header.2"></a>
<h2>Header 2</h2>
<p><ul>
<li><a href="#Header.1">Header 1</a>
<ul>
<li><a href="#Header.2">Header 2</a></li>
</ul>
</li>
</ul>
</p>
TOC
assert_equal toc.strip,
@markdown.convert("# Header 1\n\n## Header 2\n\n{:toc}").strip
end
end
end

View File

@ -494,7 +494,7 @@ EOS
setup do setup do
@content = <<CONTENT @content = <<CONTENT
--- ---
title: Kramdown vs. RDiscount title: Kramdown post with pre
--- ---
_FIGHT!_ _FIGHT!_
@ -507,25 +507,6 @@ puts "3..2..1.."
CONTENT CONTENT
end end
context "using RDiscount" do
setup do
if jruby?
then skip(
"JRuby does not perform well with CExt, test disabled."
)
end
create_post(@content, {
"markdown" => "rdiscount",
})
end
should "parse correctly" do
assert_match %r{<em>FIGHT!</em>}, @result
assert_match %r!<em>FINISH HIM</em>!, @result
end
end
context "using Kramdown" do context "using Kramdown" do
setup do setup do
create_post(@content, "markdown" => "kramdown") create_post(@content, "markdown" => "kramdown")