jekyll-commonmark 1.2.0 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.rubocop.yml +7 -22
- data/.rubocop_todo.yml +39 -0
- data/.travis.yml +7 -6
- data/Gemfile +2 -1
- data/History.markdown +9 -0
- data/Readme.md +15 -1
- data/appveyor.yml +2 -4
- data/jekyll-commonmark.gemspec +5 -3
- data/lib/jekyll-commonmark.rb +39 -35
- data/lib/jekyll-commonmark/version.rb +1 -1
- data/script/console +3 -3
- metadata +16 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: f8f2b667d4e48524510c2fc1d13be5074e1e62a3e3699df727a5b9aa676eb687
|
4
|
+
data.tar.gz: ef8ab723faad439a0e717bd6251066127b2b3c22eb098c90f0f0b4305f084d64
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 789df562b30e53e50af25079dea399e06e3605e8b92a6fc2fb6a5de8507de79625f19f6f9105cb984183d7d616b0bb583487e48e1bcaf1b5036df9584ac448eb
|
7
|
+
data.tar.gz: dfb2879c01320367d9ea4809cb1ea184138c8bfc1b6ba8ac0666d33839db5d11df21c39c0b78306c74085777f45f09d1bac4bfe63bf699ff10423e6a87b22477
|
data/.rubocop.yml
CHANGED
@@ -1,27 +1,12 @@
|
|
1
|
+
inherit_from: .rubocop_todo.yml
|
2
|
+
|
3
|
+
require: rubocop-jekyll
|
4
|
+
|
1
5
|
inherit_gem:
|
2
|
-
jekyll: .rubocop.yml
|
6
|
+
rubocop-jekyll: .rubocop.yml
|
3
7
|
|
4
8
|
AllCops:
|
5
|
-
TargetRubyVersion: 2.
|
9
|
+
TargetRubyVersion: 2.4
|
6
10
|
Exclude:
|
11
|
+
- script/**/*
|
7
12
|
- vendor/**/*
|
8
|
-
|
9
|
-
Metrics/AbcSize:
|
10
|
-
Exclude:
|
11
|
-
- lib/jekyll-commonmark.rb
|
12
|
-
|
13
|
-
Metrics/MethodLength:
|
14
|
-
Exclude:
|
15
|
-
- lib/jekyll-commonmark.rb
|
16
|
-
|
17
|
-
Metrics/LineLength:
|
18
|
-
Exclude:
|
19
|
-
- lib/jekyll-commonmark.rb
|
20
|
-
|
21
|
-
Lint/Debugger:
|
22
|
-
Exclude:
|
23
|
-
- script/console
|
24
|
-
|
25
|
-
Metrics/BlockLength:
|
26
|
-
Exclude:
|
27
|
-
- spec/**/*
|
data/.rubocop_todo.yml
ADDED
@@ -0,0 +1,39 @@
|
|
1
|
+
# This configuration was generated by
|
2
|
+
# `rubocop --auto-gen-config`
|
3
|
+
# on 2019-01-03 13:58:24 +0100 using RuboCop version 0.62.0.
|
4
|
+
# The point is for the user to remove these configuration records
|
5
|
+
# one by one as the offenses are removed from the code base.
|
6
|
+
# Note that changes in the inspected code, or installation of new
|
7
|
+
# versions of RuboCop, may require this file to be generated again.
|
8
|
+
|
9
|
+
# Offense count: 1
|
10
|
+
# Configuration parameters: Max.
|
11
|
+
Metrics/AbcSize:
|
12
|
+
Exclude:
|
13
|
+
- 'lib/jekyll-commonmark.rb'
|
14
|
+
|
15
|
+
# Offense count: 1
|
16
|
+
# Configuration parameters: CountComments, Max, ExcludedMethods.
|
17
|
+
# ExcludedMethods: refine
|
18
|
+
Metrics/BlockLength:
|
19
|
+
Exclude:
|
20
|
+
- 'spec/jekyll_commonmark_spec.rb'
|
21
|
+
|
22
|
+
# Offense count: 1
|
23
|
+
# Configuration parameters: Max.
|
24
|
+
Metrics/CyclomaticComplexity:
|
25
|
+
Exclude:
|
26
|
+
- 'lib/jekyll-commonmark.rb'
|
27
|
+
|
28
|
+
# Offense count: 1
|
29
|
+
# Configuration parameters: Max, AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
|
30
|
+
# URISchemes: http, https
|
31
|
+
Metrics/LineLength:
|
32
|
+
Exclude:
|
33
|
+
- 'lib/jekyll-commonmark.rb'
|
34
|
+
|
35
|
+
# Offense count: 1
|
36
|
+
# Configuration parameters: CountComments, Max, ExcludedMethods.
|
37
|
+
Metrics/MethodLength:
|
38
|
+
Exclude:
|
39
|
+
- 'lib/jekyll-commonmark.rb'
|
data/.travis.yml
CHANGED
@@ -1,13 +1,10 @@
|
|
1
1
|
language: ruby
|
2
2
|
cache: bundler
|
3
|
-
sudo: false
|
4
3
|
rvm:
|
5
|
-
- 2.
|
4
|
+
- 2.6
|
6
5
|
- 2.4
|
7
|
-
- 2.3
|
8
|
-
- 2.2
|
9
6
|
git:
|
10
|
-
depth:
|
7
|
+
depth: 3
|
11
8
|
|
12
9
|
# we need a more recent cmake than travis/linux provides (at least 2.8.9):
|
13
10
|
addons:
|
@@ -18,7 +15,11 @@ addons:
|
|
18
15
|
- cmake
|
19
16
|
|
20
17
|
before_install:
|
18
|
+
- gem update --system
|
21
19
|
- gem install bundler
|
22
|
-
|
23
20
|
before_script: bundle update
|
24
21
|
script: script/cibuild
|
22
|
+
|
23
|
+
env:
|
24
|
+
global:
|
25
|
+
- NOKOGIRI_USE_SYSTEM_LIBRARIES=true
|
data/Gemfile
CHANGED
data/History.markdown
CHANGED
data/Readme.md
CHANGED
@@ -7,7 +7,10 @@
|
|
7
7
|
[![Windows Build status](https://img.shields.io/appveyor/ci/pathawks/jekyll-commonmark/master.svg?label=Windows%20build)](https://ci.appveyor.com/project/pathawks/jekyll-commonmark)
|
8
8
|
[![Dependency Status](https://img.shields.io/gemnasium/pathawks/jekyll-commonmark.svg)](https://gemnasium.com/pathawks/jekyll-commonmark)
|
9
9
|
|
10
|
-
Jekyll Markdown converter that uses [libcmark](https://github.com/jgm/CommonMark), the reference parser for CommonMark.
|
10
|
+
Jekyll Markdown converter that uses [libcmark](https://github.com/jgm/CommonMark), the reference parser for CommonMark.
|
11
|
+
As a result, it is faster than Kramdown.
|
12
|
+
|
13
|
+
GitHub Pages supports CommonMark through https://github.com/github/jekyll-commonmark-ghpages
|
11
14
|
|
12
15
|
## Installation
|
13
16
|
|
@@ -24,3 +27,14 @@ and modify your `_config.yml` to use **CommonMark** as your Markdown converter
|
|
24
27
|
```yaml
|
25
28
|
markdown: CommonMark
|
26
29
|
```
|
30
|
+
|
31
|
+
## Configuration
|
32
|
+
|
33
|
+
To specify [extensions](https://github.com/gjtorikian/commonmarker#extensions) and [options](https://github.com/gjtorikian/commonmarker#options) for use in converting Markdown to HTML, supply options to the Markdown converter:
|
34
|
+
|
35
|
+
```yaml
|
36
|
+
commonmark:
|
37
|
+
options: ["SMART", "FOOTNOTES"]
|
38
|
+
extensions: ["strikethrough", "autolink", "table"]
|
39
|
+
```
|
40
|
+
|
data/appveyor.yml
CHANGED
@@ -8,11 +8,9 @@ install:
|
|
8
8
|
|
9
9
|
environment:
|
10
10
|
matrix:
|
11
|
+
- RUBY_FOLDER_VER: "25"
|
12
|
+
- RUBY_FOLDER_VER: "25-x64"
|
11
13
|
- RUBY_FOLDER_VER: "24"
|
12
|
-
- RUBY_FOLDER_VER: "24-x64"
|
13
|
-
- RUBY_FOLDER_VER: "23"
|
14
|
-
- RUBY_FOLDER_VER: "22"
|
15
|
-
- RUBY_FOLDER_VER: "21"
|
16
14
|
|
17
15
|
test_script:
|
18
16
|
- ruby --version
|
data/jekyll-commonmark.gemspec
CHANGED
@@ -17,11 +17,13 @@ Gem::Specification.new do |spec|
|
|
17
17
|
spec.test_files = spec.files.grep(%r!^(test|spec|features)/!)
|
18
18
|
spec.require_paths = ["lib"]
|
19
19
|
|
20
|
+
spec.required_ruby_version = ">= 2.4.0"
|
21
|
+
|
20
22
|
spec.add_runtime_dependency "commonmarker", "~> 0.14"
|
21
|
-
spec.add_runtime_dependency "jekyll",
|
23
|
+
spec.add_runtime_dependency "jekyll", ">= 3.7", "< 5.0"
|
22
24
|
|
23
|
-
spec.add_development_dependency "bundler"
|
25
|
+
spec.add_development_dependency "bundler"
|
24
26
|
spec.add_development_dependency "rake", "~> 12.0"
|
25
27
|
spec.add_development_dependency "rspec", "~> 3.0"
|
26
|
-
spec.add_development_dependency "rubocop", "~> 0.
|
28
|
+
spec.add_development_dependency "rubocop-jekyll", "~> 0.5"
|
27
29
|
end
|
data/lib/jekyll-commonmark.rb
CHANGED
@@ -2,46 +2,50 @@
|
|
2
2
|
|
3
3
|
module Jekyll
|
4
4
|
module Converters
|
5
|
-
class Markdown
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
5
|
+
class Markdown
|
6
|
+
class CommonMark
|
7
|
+
def initialize(config)
|
8
|
+
Jekyll::External.require_with_graceful_fail "commonmarker"
|
9
|
+
begin
|
10
|
+
options = config["commonmark"]["options"].collect { |e| e.upcase.to_sym }
|
11
|
+
rescue NoMethodError
|
12
|
+
options = []
|
13
|
+
else
|
14
|
+
valid_opts = Set.new(CommonMarker::Config::Parse.keys + CommonMarker::Config::Render.keys)
|
15
|
+
options.reject! do |e|
|
16
|
+
next if valid_opts.include? e
|
17
|
+
|
18
|
+
Jekyll.logger.warn "CommonMark:", "#{e} is not a valid option"
|
19
|
+
Jekyll.logger.info "Valid options:", valid_opts.to_a.join(", ")
|
20
|
+
true
|
21
|
+
end
|
19
22
|
end
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
23
|
+
begin
|
24
|
+
@extensions = config["commonmark"]["extensions"].collect(&:to_sym)
|
25
|
+
rescue NoMethodError
|
26
|
+
@extensions = []
|
27
|
+
else
|
28
|
+
@extensions.reject! do |e|
|
29
|
+
next if CommonMarker.extensions.include? e.to_s
|
30
|
+
|
31
|
+
Jekyll.logger.warn "CommonMark:", "#{e} is not a valid extension"
|
32
|
+
Jekyll.logger.info "Valid extensions:", CommonMarker.extensions.join(", ")
|
33
|
+
true
|
34
|
+
end
|
31
35
|
end
|
32
|
-
end
|
33
36
|
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
+
options_set = Set.new(options).freeze
|
38
|
+
@parse_options = (options_set & CommonMarker::Config::Parse.keys).to_a
|
39
|
+
@render_options = (options_set & CommonMarker::Config::Render.keys).to_a
|
37
40
|
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
+
@parse_options = :DEFAULT if @parse_options.empty?
|
42
|
+
@render_options = :DEFAULT if @render_options.empty?
|
43
|
+
end
|
41
44
|
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
+
def convert(content)
|
46
|
+
CommonMarker.render_doc(content, @parse_options, @extensions)
|
47
|
+
.to_html(@render_options, @extensions)
|
48
|
+
end
|
45
49
|
end
|
46
50
|
end
|
47
51
|
end
|
data/script/console
CHANGED
@@ -21,11 +21,11 @@ def dest_dir(*files)
|
|
21
21
|
end
|
22
22
|
|
23
23
|
def config(overrides = {})
|
24
|
-
Jekyll.configuration(
|
24
|
+
Jekyll.configuration(
|
25
25
|
"source" => source_dir,
|
26
26
|
"destination" => dest_dir,
|
27
|
-
"url" => "http://example.org"
|
28
|
-
|
27
|
+
"url" => "http://example.org"
|
28
|
+
).merge(overrides)
|
29
29
|
end
|
30
30
|
|
31
31
|
def site(configuration = config)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll-commonmark
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pat Hawks
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-03-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: commonmarker
|
@@ -30,34 +30,34 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '3.
|
33
|
+
version: '3.7'
|
34
34
|
- - "<"
|
35
35
|
- !ruby/object:Gem::Version
|
36
|
-
version: '
|
36
|
+
version: '5.0'
|
37
37
|
type: :runtime
|
38
38
|
prerelease: false
|
39
39
|
version_requirements: !ruby/object:Gem::Requirement
|
40
40
|
requirements:
|
41
41
|
- - ">="
|
42
42
|
- !ruby/object:Gem::Version
|
43
|
-
version: '3.
|
43
|
+
version: '3.7'
|
44
44
|
- - "<"
|
45
45
|
- !ruby/object:Gem::Version
|
46
|
-
version: '
|
46
|
+
version: '5.0'
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: bundler
|
49
49
|
requirement: !ruby/object:Gem::Requirement
|
50
50
|
requirements:
|
51
|
-
- - "
|
51
|
+
- - ">="
|
52
52
|
- !ruby/object:Gem::Version
|
53
|
-
version: '
|
53
|
+
version: '0'
|
54
54
|
type: :development
|
55
55
|
prerelease: false
|
56
56
|
version_requirements: !ruby/object:Gem::Requirement
|
57
57
|
requirements:
|
58
|
-
- - "
|
58
|
+
- - ">="
|
59
59
|
- !ruby/object:Gem::Version
|
60
|
-
version: '
|
60
|
+
version: '0'
|
61
61
|
- !ruby/object:Gem::Dependency
|
62
62
|
name: rake
|
63
63
|
requirement: !ruby/object:Gem::Requirement
|
@@ -87,19 +87,19 @@ dependencies:
|
|
87
87
|
- !ruby/object:Gem::Version
|
88
88
|
version: '3.0'
|
89
89
|
- !ruby/object:Gem::Dependency
|
90
|
-
name: rubocop
|
90
|
+
name: rubocop-jekyll
|
91
91
|
requirement: !ruby/object:Gem::Requirement
|
92
92
|
requirements:
|
93
93
|
- - "~>"
|
94
94
|
- !ruby/object:Gem::Version
|
95
|
-
version: 0.
|
95
|
+
version: '0.5'
|
96
96
|
type: :development
|
97
97
|
prerelease: false
|
98
98
|
version_requirements: !ruby/object:Gem::Requirement
|
99
99
|
requirements:
|
100
100
|
- - "~>"
|
101
101
|
- !ruby/object:Gem::Version
|
102
|
-
version: 0.
|
102
|
+
version: '0.5'
|
103
103
|
description:
|
104
104
|
email: pat@pathawks.com
|
105
105
|
executables: []
|
@@ -109,6 +109,7 @@ files:
|
|
109
109
|
- ".github/stale.yml"
|
110
110
|
- ".gitignore"
|
111
111
|
- ".rubocop.yml"
|
112
|
+
- ".rubocop_todo.yml"
|
112
113
|
- ".travis.yml"
|
113
114
|
- Gemfile
|
114
115
|
- History.markdown
|
@@ -138,15 +139,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
138
139
|
requirements:
|
139
140
|
- - ">="
|
140
141
|
- !ruby/object:Gem::Version
|
141
|
-
version:
|
142
|
+
version: 2.4.0
|
142
143
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
143
144
|
requirements:
|
144
145
|
- - ">="
|
145
146
|
- !ruby/object:Gem::Version
|
146
147
|
version: '0'
|
147
148
|
requirements: []
|
148
|
-
|
149
|
-
rubygems_version: 2.6.14
|
149
|
+
rubygems_version: 3.0.3
|
150
150
|
signing_key:
|
151
151
|
specification_version: 4
|
152
152
|
summary: CommonMark generator for Jekyll
|