jekyll-commonmark 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 7ecca1ff5c65a1138c4950a17b6c295e0678af92
4
+ data.tar.gz: 2f95c17b8990d0df8cb30e581e74681c8b2c26b9
5
+ SHA512:
6
+ metadata.gz: 0f64d199adee5c38684a0d91768e108e962bbe3ccfbf8c5fb792ee40af0bbc00a3a178ea835583e3b9e2d19d1cbb5436060d800536a9a035fb278c4b87ff0141
7
+ data.tar.gz: 8dae5371527a02fe592c20f97cdb4219c0d776637a22ee5672520e93a4b5d8687dcaaed0282e271aabb7b690aefaf08f99e93e8dd99aba5daf6516a569f2a1ce
@@ -0,0 +1,4 @@
1
+ *.gem
2
+ Gemfile.lock
3
+ spec/dest
4
+ .bundle
@@ -0,0 +1,24 @@
1
+ language: ruby
2
+ cache: bundler
3
+ rvm:
4
+ - 2.2
5
+ - 2.1
6
+ - 2.0
7
+ git:
8
+ depth: 10
9
+
10
+ sudo: false
11
+
12
+ # we need a more recent cmake than travis/linux provides (at least 2.8.9):
13
+ addons:
14
+ apt:
15
+ sources:
16
+ - kalakris-cmake
17
+ packages:
18
+ - cmake
19
+
20
+ before_install:
21
+ - gem install bundler
22
+
23
+ before_script: bundle update
24
+ script: script/cibuild
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source "https://rubygems.org"
2
+
3
+ gemspec
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2015 Pat Hawks
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,6 @@
1
+ require "bundler/gem_tasks"
2
+ require 'rspec/core/rake_task'
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task :default => :spec
@@ -0,0 +1,25 @@
1
+ # jekyll-commonmark
2
+
3
+ *CommonMark Markdown converter for Jekyll*
4
+
5
+ [![Gem Version](https://img.shields.io/gem/v/jekyll-commonmark.svg)](https://rubygems.org/gems/jekyll-commonmark)
6
+ [![Build Status](https://img.shields.io/travis/pathawks/jekyll-commonmark/master.svg)](https://travis-ci.org/pathawks/jekyll-commonmark)
7
+ [![Dependency Status](https://img.shields.io/gemnasium/pathawks/jekyll-commonmark.svg)](https://gemnasium.com/pathawks/jekyll-commonmark)
8
+
9
+ Jekyll Markdown converter that uses [libcmark](https://github.com/jgm/CommonMark), the reference parser for CommonMark.
10
+
11
+ ## Installation
12
+
13
+ Add the following to your `Gemfile`
14
+
15
+ ```ruby
16
+ group :jekyll_plugins do
17
+ gem 'jekyll-commonmark', :github => 'pathawks/jekyll-commonmark'
18
+ end
19
+ ```
20
+
21
+ and modify your `_config.yml` to use **CommonMark** as your Markdown converter
22
+
23
+ ```yaml
24
+ markdown: CommonMark
25
+ ```
@@ -0,0 +1,23 @@
1
+ # coding: utf-8
2
+
3
+ Gem::Specification.new do |spec|
4
+ spec.name = "jekyll-commonmark"
5
+ spec.summary = "CommonMark generator for Jekyll"
6
+ spec.version = "0.0.1"
7
+ spec.authors = ["Pat Hawks"]
8
+ spec.email = "pat@pathawks.com"
9
+ spec.homepage = "https://github.com/pathawks/Jekyll-CMark"
10
+ spec.licenses = ["MIT"]
11
+
12
+ spec.files = `git ls-files -z`.split("\x0")
13
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
14
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
15
+ spec.require_paths = ["lib"]
16
+
17
+ spec.add_runtime_dependency "commonmarker", "~> 0.5.1"
18
+ spec.add_runtime_dependency "jekyll", [">= 3.0", "< 4.0"]
19
+
20
+ spec.add_development_dependency "rspec", "~> 3.0"
21
+ spec.add_development_dependency "rake"
22
+ spec.add_development_dependency "bundler", "~> 1.6"
23
+ end
@@ -0,0 +1,29 @@
1
+ # Frozen-string-literal: true
2
+ # Encoding: utf-8
3
+
4
+ module Jekyll
5
+ module Converters
6
+ class Markdown::CommonMark
7
+ def initialize(config)
8
+ Jekyll::External.require_with_graceful_fail "commonmarker"
9
+ begin
10
+ @options = config['commonmark']['options'].collect { |e| e.to_sym }
11
+ rescue NoMethodError
12
+ @options = [:default]
13
+ else
14
+ @options.reject! do |e|
15
+ unless CommonMarker::Config::Parse.keys.include? e.to_sym
16
+ Jekyll.logger.warn "CommonMark:", "#{e} is not a valid option"
17
+ Jekyll.logger.info "Valid options:", CommonMarker::Config::Parse.keys.join(", ")
18
+ true
19
+ end
20
+ end
21
+ end
22
+ end
23
+
24
+ def convert(content)
25
+ CommonMarker.render_doc(content, @options).to_html
26
+ end
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,3 @@
1
+ #! /bin/bash
2
+
3
+ bundle install
@@ -0,0 +1,3 @@
1
+ #! /bin/bash
2
+
3
+ bundle exec rspec
@@ -0,0 +1,34 @@
1
+ #! /usr/bin/env ruby
2
+
3
+ def relative_to_root(path)
4
+ File.expand_path(path, File.dirname(File.dirname(__FILE__)))
5
+ end
6
+
7
+ require 'jekyll'
8
+ require relative_to_root('lib/jekyll-smartify.rb')
9
+ require 'pry-debugger'
10
+
11
+ SOURCE_DIR = relative_to_root('spec/fixtures')
12
+ DEST_DIR = relative_to_root('spec/dest')
13
+
14
+ def source_dir(*files)
15
+ File.join(SOURCE_DIR, *files)
16
+ end
17
+
18
+ def dest_dir(*files)
19
+ File.join(DEST_DIR, *files)
20
+ end
21
+
22
+ def config(overrides = {})
23
+ Jekyll.configuration({
24
+ "source" => source_dir,
25
+ "destination" => dest_dir,
26
+ "url" => "http://example.org"
27
+ }).merge(overrides)
28
+ end
29
+
30
+ def site(configuration = config)
31
+ Jekyll::Site.new(configuration)
32
+ end
33
+
34
+ binding.pry
@@ -0,0 +1,7 @@
1
+ #!/bin/sh
2
+ # Tag and push a release.
3
+
4
+ set -e
5
+
6
+ script/cibuild
7
+ bundle exec rake release
metadata ADDED
@@ -0,0 +1,131 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: jekyll-commonmark
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Pat Hawks
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-12-30 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: commonmarker
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: 0.5.1
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: 0.5.1
27
+ - !ruby/object:Gem::Dependency
28
+ name: jekyll
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '3.0'
34
+ - - "<"
35
+ - !ruby/object:Gem::Version
36
+ version: '4.0'
37
+ type: :runtime
38
+ prerelease: false
39
+ version_requirements: !ruby/object:Gem::Requirement
40
+ requirements:
41
+ - - ">="
42
+ - !ruby/object:Gem::Version
43
+ version: '3.0'
44
+ - - "<"
45
+ - !ruby/object:Gem::Version
46
+ version: '4.0'
47
+ - !ruby/object:Gem::Dependency
48
+ name: rspec
49
+ requirement: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - "~>"
52
+ - !ruby/object:Gem::Version
53
+ version: '3.0'
54
+ type: :development
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - - "~>"
59
+ - !ruby/object:Gem::Version
60
+ version: '3.0'
61
+ - !ruby/object:Gem::Dependency
62
+ name: rake
63
+ requirement: !ruby/object:Gem::Requirement
64
+ requirements:
65
+ - - ">="
66
+ - !ruby/object:Gem::Version
67
+ version: '0'
68
+ type: :development
69
+ prerelease: false
70
+ version_requirements: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - ">="
73
+ - !ruby/object:Gem::Version
74
+ version: '0'
75
+ - !ruby/object:Gem::Dependency
76
+ name: bundler
77
+ requirement: !ruby/object:Gem::Requirement
78
+ requirements:
79
+ - - "~>"
80
+ - !ruby/object:Gem::Version
81
+ version: '1.6'
82
+ type: :development
83
+ prerelease: false
84
+ version_requirements: !ruby/object:Gem::Requirement
85
+ requirements:
86
+ - - "~>"
87
+ - !ruby/object:Gem::Version
88
+ version: '1.6'
89
+ description:
90
+ email: pat@pathawks.com
91
+ executables: []
92
+ extensions: []
93
+ extra_rdoc_files: []
94
+ files:
95
+ - ".gitignore"
96
+ - ".travis.yml"
97
+ - Gemfile
98
+ - LICENSE
99
+ - Rakefile
100
+ - Readme.md
101
+ - jekyll-commonmark.gemspec
102
+ - lib/jekyll-commonmark.rb
103
+ - script/bootstrap
104
+ - script/cibuild
105
+ - script/console
106
+ - script/release
107
+ homepage: https://github.com/pathawks/Jekyll-CMark
108
+ licenses:
109
+ - MIT
110
+ metadata: {}
111
+ post_install_message:
112
+ rdoc_options: []
113
+ require_paths:
114
+ - lib
115
+ required_ruby_version: !ruby/object:Gem::Requirement
116
+ requirements:
117
+ - - ">="
118
+ - !ruby/object:Gem::Version
119
+ version: '0'
120
+ required_rubygems_version: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
125
+ requirements: []
126
+ rubyforge_project:
127
+ rubygems_version: 2.2.2
128
+ signing_key:
129
+ specification_version: 4
130
+ summary: CommonMark generator for Jekyll
131
+ test_files: []