jekyll-commonmark-1.3.1/ 0000755 0000041 0000041 00000000000 13514203551 015176 5 ustar www-data www-data jekyll-commonmark-1.3.1/jekyll-commonmark.gemspec 0000644 0000041 0000041 00000002075 13514203551 022202 0 ustar www-data www-data # frozen_string_literal: true $LOAD_PATH.unshift File.expand_path("lib", __dir__) require "jekyll-commonmark/version" Gem::Specification.new do |spec| spec.name = "jekyll-commonmark" spec.summary = "CommonMark generator for Jekyll" spec.version = Jekyll::CommonMark::VERSION spec.authors = ["Pat Hawks"] spec.email = "pat@pathawks.com" spec.homepage = "https://github.com/pathawks/jekyll-commonmark" spec.licenses = ["MIT"] spec.files = `git ls-files -z`.split("\x0") spec.executables = spec.files.grep(%r!^bin/!) { |f| File.basename(f) } spec.test_files = spec.files.grep(%r!^(test|spec|features)/!) spec.require_paths = ["lib"] spec.required_ruby_version = ">= 2.3.0" spec.add_runtime_dependency "commonmarker", "~> 0.14" spec.add_runtime_dependency "jekyll", ">= 3.7", "< 5.0" spec.add_development_dependency "bundler" spec.add_development_dependency "rake", "~> 12.0" spec.add_development_dependency "rspec", "~> 3.0" spec.add_development_dependency "rubocop-jekyll", "~> 0.5" end jekyll-commonmark-1.3.1/.travis.yml 0000644 0000041 0000041 00000001142 13514203551 017305 0 ustar www-data www-data language: ruby cache: bundler rvm: - &latest_ruby 2.6 - 2.4 - 2.3 git: depth: 3 # we need a more recent cmake than travis/linux provides (at least 2.8.9): addons: apt: sources: - kalakris-cmake packages: - cmake before_install: - gem update --system - gem install bundler before_script: bundle update script: script/cibuild env: global: - NOKOGIRI_USE_SYSTEM_LIBRARIES=true matrix: - JEKYLL_VERSION="~> 3.8" matrix: include: - rvm: *latest_ruby env: JEKYLL_VERSION="~> 3.7.4" - rvm: *latest_ruby env: JEKYLL_VERSION=">= 4.0.0.pre.alpha1" jekyll-commonmark-1.3.1/spec/ 0000755 0000041 0000041 00000000000 13514203551 016130 5 ustar www-data www-data jekyll-commonmark-1.3.1/spec/jekyll_commonmark_spec.rb 0000644 0000041 0000041 00000004511 13514203551 023205 0 ustar www-data www-data # frozen_string_literal: true require "spec_helper" describe(Jekyll::Converters::Markdown::CommonMark) do let(:options) { [] } let(:extensions) { [] } let(:config) do { "commonmark" => { "options" => options, "extensions" => extensions, }, } end let(:commonmark) { described_class.new(config) } let(:output) { commonmark.convert(content) } context "with default configuration" do it "produces the correct script tag" do actual = commonmark.convert("# Heading") expected = "
a\nb
" expect(actual).to match(expected) end it "treats double linebreaks as a new paragraph" do actual = commonmark.convert("a\n\nb") expected = "a
\nb
" expect(actual).to match(expected) end it "escapes quotes" do actual = commonmark.convert('"SmartyPants"') expected = ""SmartyPants"
" expect(actual).to match(expected) end it "does not link urls" do actual = commonmark.convert("https://example.com") expected = "https://example.com" expect(actual).to match(expected) end end context "with SmartyPants enabled" do let(:options) { ["SMART"] } it "makes quotes curly" do actual = commonmark.convert('"SmartyPants"') expected = "“SmartyPants”
" expect(actual).to match(expected) end end context "with hardbreaks enabled" do let(:options) { ["HARDBREAKS"] } it "treats newlines as hardbreaks" do actual = commonmark.convert("a\nb") expected = "a
\nb
a b
" expect(actual).to match(expected) end end context "with autolink enabled" do let(:extensions) { ["autolink"] } it "links urls" do actual = commonmark.convert("https://example.com") expected = '' expect(actual).to match(expected) end end end jekyll-commonmark-1.3.1/spec/spec_helper.rb 0000644 0000041 0000041 00000000407 13514203551 020747 0 ustar www-data www-data # frozen_string_literal: true require "jekyll" require_relative "../lib/jekyll-commonmark.rb" Jekyll.logger.log_level = :info RSpec.configure do |config| config.run_all_when_everything_filtered = true config.filter_run :focus config.order = "random" end jekyll-commonmark-1.3.1/.rubocop.yml 0000644 0000041 0000041 00000000270 13514203551 017447 0 ustar www-data www-data inherit_from: .rubocop_todo.yml require: rubocop-jekyll inherit_gem: rubocop-jekyll: .rubocop.yml AllCops: TargetRubyVersion: 2.3 Exclude: - script/**/* - vendor/**/* jekyll-commonmark-1.3.1/.gitignore 0000644 0000041 0000041 00000000045 13514203551 017165 0 ustar www-data www-data *.gem Gemfile.lock spec/dest .bundle jekyll-commonmark-1.3.1/script/ 0000755 0000041 0000041 00000000000 13514203551 016502 5 ustar www-data www-data jekyll-commonmark-1.3.1/script/release 0000755 0000041 0000041 00000000125 13514203551 020046 0 ustar www-data www-data #!/bin/sh # Tag and push a release. set -e script/cibuild bundle exec rake release jekyll-commonmark-1.3.1/script/console 0000755 0000041 0000041 00000001311 13514203551 020066 0 ustar www-data www-data #! /usr/bin/env ruby # frozen_string_literal: true def relative_to_root(path) File.expand_path(path, File.dirname(File.dirname(__FILE__))) end require "jekyll" require relative_to_root("lib/jekyll-smartify.rb") require "pry-debugger" SOURCE_DIR = relative_to_root("spec/fixtures") DEST_DIR = relative_to_root("spec/dest") def source_dir(*files) File.join(SOURCE_DIR, *files) end def dest_dir(*files) File.join(DEST_DIR, *files) end def config(overrides = {}) Jekyll.configuration( "source" => source_dir, "destination" => dest_dir, "url" => "http://example.org" ).merge(overrides) end def site(configuration = config) Jekyll::Site.new(configuration) end binding.pry jekyll-commonmark-1.3.1/script/cibuild 0000755 0000041 0000041 00000000053 13514203551 020041 0 ustar www-data www-data #! /bin/bash script/fmt bundle exec rspec jekyll-commonmark-1.3.1/script/bootstrap 0000755 0000041 0000041 00000000035 13514203551 020443 0 ustar www-data www-data #! /bin/bash bundle install jekyll-commonmark-1.3.1/script/fmt 0000755 0000041 0000041 00000000137 13514203551 017217 0 ustar www-data www-data #!/bin/sh set -e echo "Rubocop $(bundle exec rubocop --version)" bundle exec rubocop -D -E $@ jekyll-commonmark-1.3.1/LICENSE 0000644 0000041 0000041 00000002137 13514203551 016206 0 ustar www-data www-data The MIT License (MIT) Copyright (c) 2015-present Pat Hawks and jekyll-commonmark contributors Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. jekyll-commonmark-1.3.1/.rubocop_todo.yml 0000644 0000041 0000041 00000002235 13514203551 020477 0 ustar www-data www-data # This configuration was generated by # `rubocop --auto-gen-config` # on 2019-01-03 13:58:24 +0100 using RuboCop version 0.62.0. # The point is for the user to remove these configuration records # one by one as the offenses are removed from the code base. # Note that changes in the inspected code, or installation of new # versions of RuboCop, may require this file to be generated again. # Offense count: 1 # Configuration parameters: Max. Metrics/AbcSize: Exclude: - 'lib/jekyll-commonmark.rb' # Offense count: 1 # Configuration parameters: CountComments, Max, ExcludedMethods. # ExcludedMethods: refine Metrics/BlockLength: Exclude: - 'spec/jekyll_commonmark_spec.rb' # Offense count: 1 # Configuration parameters: Max. Metrics/CyclomaticComplexity: Exclude: - 'lib/jekyll-commonmark.rb' # Offense count: 1 # Configuration parameters: Max, AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns. # URISchemes: http, https Metrics/LineLength: Exclude: - 'lib/jekyll-commonmark.rb' # Offense count: 1 # Configuration parameters: CountComments, Max, ExcludedMethods. Metrics/MethodLength: Exclude: - 'lib/jekyll-commonmark.rb' jekyll-commonmark-1.3.1/Readme.md 0000644 0000041 0000041 00000002716 13514203551 016723 0 ustar www-data www-data # jekyll-commonmark *CommonMark Markdown converter for Jekyll* [](https://rubygems.org/gems/jekyll-commonmark) [](https://travis-ci.org/jekyll/jekyll-commonmark) [](https://ci.appveyor.com/project/pathawks/jekyll-commonmark) [](https://gemnasium.com/pathawks/jekyll-commonmark) Jekyll Markdown converter that uses [libcmark](https://github.com/jgm/CommonMark), the reference parser for CommonMark. As a result, it is faster than Kramdown. GitHub Pages supports CommonMark through https://github.com/github/jekyll-commonmark-ghpages ## Installation Add the following to your `Gemfile` ```ruby group :jekyll_plugins do gem 'jekyll-commonmark' end ``` and modify your `_config.yml` to use **CommonMark** as your Markdown converter ```yaml markdown: CommonMark ``` ## Configuration 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: ```yaml commonmark: options: ["SMART", "FOOTNOTES"] extensions: ["strikethrough", "autolink", "table"] ``` jekyll-commonmark-1.3.1/Rakefile 0000644 0000041 0000041 00000000224 13514203551 016641 0 ustar www-data www-data # frozen_string_literal: true require "bundler/gem_tasks" require "rspec/core/rake_task" RSpec::Core::RakeTask.new(:spec) task :default => :spec jekyll-commonmark-1.3.1/lib/ 0000755 0000041 0000041 00000000000 13514203551 015744 5 ustar www-data www-data jekyll-commonmark-1.3.1/lib/jekyll-commonmark.rb 0000755 0000041 0000041 00000003410 13514203551 021725 0 ustar www-data www-data # frozen-string-literal: true module Jekyll module Converters class Markdown class CommonMark def initialize(config) Jekyll::External.require_with_graceful_fail "commonmarker" begin options = config["commonmark"]["options"].collect { |e| e.upcase.to_sym } rescue NoMethodError options = [] else valid_opts = Set.new(CommonMarker::Config::Parse.keys + CommonMarker::Config::Render.keys) options.reject! do |e| next if valid_opts.include? e Jekyll.logger.warn "CommonMark:", "#{e} is not a valid option" Jekyll.logger.info "Valid options:", valid_opts.to_a.join(", ") true end end begin @extensions = config["commonmark"]["extensions"].collect(&:to_sym) rescue NoMethodError @extensions = [] else @extensions.reject! do |e| next if CommonMarker.extensions.include? e.to_s Jekyll.logger.warn "CommonMark:", "#{e} is not a valid extension" Jekyll.logger.info "Valid extensions:", CommonMarker.extensions.join(", ") true end end options_set = Set.new(options).freeze @parse_options = (options_set & CommonMarker::Config::Parse.keys).to_a @render_options = (options_set & CommonMarker::Config::Render.keys).to_a @parse_options = :DEFAULT if @parse_options.empty? @render_options = :DEFAULT if @render_options.empty? end def convert(content) CommonMarker.render_doc(content, @parse_options, @extensions) .to_html(@render_options, @extensions) end end end end end jekyll-commonmark-1.3.1/lib/jekyll-commonmark/ 0000755 0000041 0000041 00000000000 13514203551 021377 5 ustar www-data www-data jekyll-commonmark-1.3.1/lib/jekyll-commonmark/version.rb 0000644 0000041 0000041 00000000141 13514203551 023405 0 ustar www-data www-data # frozen_string_literal: true module Jekyll module CommonMark VERSION = "1.3.1" end end jekyll-commonmark-1.3.1/History.markdown 0000644 0000041 0000041 00000001060 13514203551 020400 0 ustar www-data www-data ## 1.3.1 / 2019-03-25 ### Bug Fixes * Re-introduce Ruby 2.3 support and test Jekyll 3.7+ (#32) ## 1.3.0 / 2019-03-22 ### Development Fixes * Allow Jekyll v4 (still alpha) * Drop Ruby < 2.4 * chore(deps): rubocop-jekyll 0.3.0 (#25) * Target Ruby 2.4 (#30) ## 1.2.0 / 2018-03-29 ### Minor Enhancements * Allow render options (#4) * Only set options once (#17) ### Development Fixes * Test plugin on Windows (#13) * Allow options passed to Rubocop (#15) * Add tests (#16) * Test against Ruby 2.5 (#18) * Version with class (#19) jekyll-commonmark-1.3.1/Gemfile 0000644 0000041 0000041 00000000203 13514203551 016464 0 ustar www-data www-data # frozen_string_literal: true source "https://rubygems.org" gemspec gem "jekyll", ENV["JEKYLL_VERSION"] if ENV["JEKYLL_VERSION"] jekyll-commonmark-1.3.1/appveyor.yml 0000644 0000041 0000041 00000001201 13514203551 017560 0 ustar www-data www-data version: "{build}" clone_depth: 5 build: off install: - SET PATH=C:\Ruby%RUBY_FOLDER_VER%-x64\bin;%PATH% - bundle install --retry 5 --jobs=%NUMBER_OF_PROCESSORS% --clean --path vendor\bundle environment: JEKYLL_VERSION: "~> 3.8" matrix: - RUBY_FOLDER_VER: "26" JEKYLL_VERSION : "~> 3.7.4" - RUBY_FOLDER_VER: "26" JEKYLL_VERSION : ">= 4.0.0.pre.alpha1" - RUBY_FOLDER_VER: "26" - RUBY_FOLDER_VER: "24" - RUBY_FOLDER_VER: "23" test_script: - ruby --version - gem --version - bundler --version - bash script/cibuild cache: - 'vendor\bundle -> appveyor.yml,Gemfile,jekyll-commonmark.gemspec' jekyll-commonmark-1.3.1/.github/ 0000755 0000041 0000041 00000000000 13514203551 016536 5 ustar www-data www-data jekyll-commonmark-1.3.1/.github/stale.yml 0000644 0000041 0000041 00000001254 13514203551 020373 0 ustar www-data www-data # Number of days of inactivity before an issue becomes stale daysUntilStale: 60 # Number of days of inactivity before a stale issue is closed daysUntilClose: 7 # Issues with these labels will never be considered stale exemptLabels: - pinned - security # Label to use when marking an issue as stale staleLabel: wontfix # Comment to post when marking an issue as stale. Set to `false` to disable markComment: > This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. # Comment to post when closing a stale issue. Set to `false` to disable closeComment: false