-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add manual-markdown plugin that allows explicit declaration of markdo…
…wn blocks in liquid syntax
- Loading branch information
1 parent
a7f52bf
commit 6550724
Showing
6 changed files
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# frozen_string_literal: true | ||
|
||
source "https://rubygems.org" | ||
gemspec |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
module Jekyll | ||
class MarkdownBlock < Liquid::Block | ||
def initialize(tag_name, text, tokens) | ||
super | ||
end | ||
require "kramdown" | ||
def render(context) | ||
content = super | ||
"#{Kramdown::Document.new(content).to_html}" | ||
end | ||
end | ||
end | ||
|
||
Liquid::Template.register_tag('markdown', Jekyll::MarkdownBlock) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# frozen_string_literal: true | ||
|
||
Gem::Specification.new do |spec| | ||
spec.name = "manual-markdown" | ||
spec.version = "0.1.0" | ||
spec.authors = ["Quincy Morgan"] | ||
spec.email = ["[email protected]"] | ||
|
||
spec.summary = "Declare markdown blocks using {% markdown %} and {% endmarkdown %}" | ||
spec.homepage = "https://github.com/osmus/dogwood" | ||
spec.license = "MIT" | ||
|
||
spec.files = Dir["lib/**/*"] | ||
|
||
spec.add_runtime_dependency "jekyll", "~> 4.3" | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters