jekyll-markdown-block 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ YjI2MGE4YTdmNTk4MTMzNTVkNTg1Y2ExMmQ2NzY1MTMxNWY3ODIzZg==
5
+ data.tar.gz: !binary |-
6
+ Zjg1YjJhOTA3NzM2ZjU4ODcyYTIxZTdmODQzZTM1MjZiM2VjODJjMw==
7
+ !binary "U0hBNTEy":
8
+ metadata.gz: !binary |-
9
+ NTcwYmU0NGQ4OTU4ODQ4MThmNjlhODgzYzI4OGY4MmJkYjIxOWYyYTBhNzhm
10
+ OTMyZjIzYzA2ZDMyNTgzNjg4MzcxNmFhZjRlNmY4YmJmN2YzMTE0NzZlZmY2
11
+ M2ZmMjZjNjg2ODRmMTI2NTBkMTU2NTc2MTdjZjdjZjI1ZWE5Yjg=
12
+ data.tar.gz: !binary |-
13
+ NTg4N2QxMDM2YjhlZGNjYWFhYzEzMmVmZjI4ZWFlMGUxNDBiNzllNjQ0ODQ0
14
+ YzRhMDgxZTU0OTAyMTkyNDcyYjQ2NzIxOWQ2YzE0M2FiYWM2MDc1ODU1ZGQ4
15
+ NDU0YjZiZDY5MGExOTViMTIxNGRiODg1Y2UwMzU4ZWIyYTI2ODY=
data/.gitignore ADDED
@@ -0,0 +1,17 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
data/.travis.yml ADDED
@@ -0,0 +1,3 @@
1
+ language: ruby
2
+ rvm: 1.9.3
3
+ script: cd test && ruby test.rb
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in jekyll-markdown-block.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2013 Brandon Mathis
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,73 @@
1
+ # Jekyll Markdown Block
2
+
3
+ [![Gem Version](https://badge.fury.io/rb/jekyll-markdown-block.png)](http://badge.fury.io/rb/jekyll-markdown-block) [![Build Status](https://travis-ci.org/imathis/jekyll-markdown-block.png)](https://travis-ci.org/imathis/jekyll-markdown-block)
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile under
8
+ the :jekyll_plugins group:
9
+
10
+ ```ruby
11
+ group :jekyll_plugins do
12
+ gem 'jekyll-markdown-block'
13
+ end
14
+ ```
15
+
16
+ And then execute:
17
+
18
+ $ bundle
19
+
20
+ Next add this to your plugins folder to automatically load any Jekyll plugins in your :jekyll_plugins group.
21
+
22
+ ```ruby
23
+ # in _plugins/bundler.rb
24
+ require "bundler/setup"
25
+ Bundler.require(:jekyll_plugins)
26
+
27
+ ```
28
+
29
+ Or you can just add a ruby file to your Jekyll plugins directory with the line `require "jekyll-markdown-block"`
30
+
31
+ ## Usage
32
+
33
+ #### Embed Markdown in HTML
34
+
35
+ Drop some markdown in your html, and it will render nicely
36
+
37
+ ```html
38
+ <!-- Some random HTML file-->
39
+ <div>
40
+ {% markdown %}
41
+
42
+ ## That's right folks!
43
+
44
+ Markdown in your `HTML`!
45
+
46
+ - Any template
47
+ - Any time
48
+
49
+ {% endmarkdown %}
50
+ </div>
51
+ ```
52
+
53
+ #### Convert includes with markdown
54
+
55
+ Correctly render markdown files which are included in an HTML page.
56
+
57
+ ```html
58
+ <!-- Another random HTML file-->
59
+
60
+ <div>
61
+ {% markdown %}{% include coolcat.md %}{% endmarkdown %}
62
+ </div>
63
+ ```
64
+
65
+ That's pretty much it. Have fun!
66
+
67
+ ## Contributing
68
+
69
+ 1. Fork it
70
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
71
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
72
+ 4. Push to the branch (`git push origin my-new-feature`)
73
+ 5. Create new Pull Request
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
@@ -0,0 +1,25 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'jekyll-markdown-block/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "jekyll-markdown-block"
8
+ spec.version = Jekyll::MarkdownBlockVersion::VERSION
9
+ spec.authors = ["Brandon Mathis"]
10
+ spec.email = ["brandon@imathis.com"]
11
+ spec.description = %q{A Liquid Block which lets you use markdown in any Jekyll template.}
12
+ spec.summary = %q{A Liquid Block which lets you use markdown in any Jekyll template.}
13
+ spec.homepage = "https://github.com/imathis/jekyll-markdown-block"
14
+ spec.license = "MIT"
15
+
16
+ spec.files = `git ls-files`.split($/)
17
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+ spec.require_paths = ["lib"]
20
+
21
+ spec.add_development_dependency "bundler", "~> 1.3"
22
+ spec.add_development_dependency "rake"
23
+
24
+ spec.add_runtime_dependency "jekyll", "~> 1.0"
25
+ end
@@ -0,0 +1,21 @@
1
+ module Jekyll
2
+ class MarkdownBlock < Liquid::Block
3
+ alias_method :render_block, :render
4
+
5
+ def initialize(tag_name, markup, tokens)
6
+ super
7
+ end
8
+
9
+ # Uses the default Jekyll markdown parser to
10
+ # parse the contents of this block
11
+ #
12
+ def render(context)
13
+ site = context.registers[:site]
14
+ converter = site.getConverterImpl(::Jekyll::Converters::Markdown)
15
+ converter.convert(render_block(context))
16
+ end
17
+ end
18
+ end
19
+
20
+ Liquid::Template.register_tag('markdown', Jekyll::MarkdownBlock)
21
+
@@ -0,0 +1,6 @@
1
+ module Jekyll
2
+ module MarkdownBlockVersion
3
+ VERSION = "1.0.0"
4
+ end
5
+ end
6
+
data/test/.gitignore ADDED
@@ -0,0 +1 @@
1
+ _site
data/test/Gemfile ADDED
@@ -0,0 +1,7 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in jekyll-markdown-block.gemspec
4
+ group :jekyll_plugins do
5
+ gem "jekyll-markdown-block", path: "../"
6
+ end
7
+
data/test/_config.yml ADDED
@@ -0,0 +1,6 @@
1
+ name: Your New Jekyll Site
2
+ markdown: redcarpet
3
+ source: source
4
+ destination: site
5
+ plugins: source/_plugins
6
+ pygments: false
@@ -0,0 +1,59 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
6
+ <title>Your New Jekyll Site</title>
7
+ <meta name="viewport" content="width=device-width">
8
+ </head>
9
+ <body>
10
+
11
+ <div class="site">
12
+ <div class="header">
13
+ <h1 class="title"><a href="/">Your New Jekyll Site</a></h1>
14
+ <a class="extra" href="/">home</a>
15
+ </div>
16
+
17
+ <div id="home">
18
+ <h1>Test</h1>
19
+ <h2>Testing testing, 1, 2, 3</h2>
20
+
21
+ <p>Let&#39;s see how <em><a href="https://github.com/imathis/jekyll-markdown-block">this</a></em> does.</p>
22
+ <div class="highlight"><pre><code class="text language-text" data-lang="text">puts 'awesome' unless not_awesome?
23
+ </code></pre></div>
24
+ <ul>
25
+ <li>One item</li>
26
+ <li>Two item</li>
27
+ <li>Three Item</li>
28
+ <li>Four!</li>
29
+ </ul>
30
+
31
+ <p>And… scene!</p>
32
+
33
+ <h2>Also, lets test <strong>inline</strong> markdown.</h2>
34
+
35
+ <p>How&#39;d it go?</p>
36
+
37
+ </ul>
38
+ </div>
39
+
40
+
41
+ <div class="footer">
42
+ <div class="contact">
43
+ <p>
44
+ Your Name<br />
45
+ What You Are<br />
46
+ you@example.com
47
+ </p>
48
+ </div>
49
+ <div class="contact">
50
+ <p>
51
+ <a href="https://github.com/yourusername">github.com/yourusername</a><br />
52
+ <a href="https://twitter.com/yourusername">twitter.com/yourusername</a><br />
53
+ </p>
54
+ </div>
55
+ </div>
56
+ </div>
57
+
58
+ </body>
59
+ </html>
@@ -0,0 +1,59 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
6
+ <title>Your New Jekyll Site</title>
7
+ <meta name="viewport" content="width=device-width">
8
+ </head>
9
+ <body>
10
+
11
+ <div class="site">
12
+ <div class="header">
13
+ <h1 class="title"><a href="/">Your New Jekyll Site</a></h1>
14
+ <a class="extra" href="/">home</a>
15
+ </div>
16
+
17
+ <div id="home">
18
+ <h1>Test</h1>
19
+ <h2>Testing testing, 1, 2, 3</h2>
20
+
21
+ <p>Let&#39;s see how <em><a href="https://github.com/imathis/jekyll-markdown-block">this</a></em> does.</p>
22
+ <div class="highlight"><pre><code class="text language-text" data-lang="text">puts 'awesome' unless not_awesome?
23
+ </code></pre></div>
24
+ <ul>
25
+ <li>One item</li>
26
+ <li>Two item</li>
27
+ <li>Three Item</li>
28
+ <li>Four!</li>
29
+ </ul>
30
+
31
+ <p>And… scene!</p>
32
+
33
+ <h2>Also, lets test <strong>inline</strong> markdown.</h2>
34
+
35
+ <p>How&#39;d it go?</p>
36
+
37
+ </ul>
38
+ </div>
39
+
40
+
41
+ <div class="footer">
42
+ <div class="contact">
43
+ <p>
44
+ Your Name<br />
45
+ What You Are<br />
46
+ you@example.com
47
+ </p>
48
+ </div>
49
+ <div class="contact">
50
+ <p>
51
+ <a href="https://github.com/yourusername">github.com/yourusername</a><br />
52
+ <a href="https://twitter.com/yourusername">twitter.com/yourusername</a><br />
53
+ </p>
54
+ </div>
55
+ </div>
56
+ </div>
57
+
58
+ </body>
59
+ </html>
@@ -0,0 +1,13 @@
1
+ ## Testing testing, 1, 2, 3
2
+
3
+ Let's see how *[this](https://github.com/imathis/jekyll-markdown-block)* does.
4
+
5
+ puts 'awesome' unless not_awesome?
6
+
7
+ - One item
8
+ - Two item
9
+ - Three Item
10
+ - Four!
11
+
12
+ And… scene!
13
+
@@ -0,0 +1,37 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
6
+ <title>{{ page.title }}</title>
7
+ <meta name="viewport" content="width=device-width">
8
+ </head>
9
+ <body>
10
+
11
+ <div class="site">
12
+ <div class="header">
13
+ <h1 class="title"><a href="/">{{ site.name }}</a></h1>
14
+ <a class="extra" href="/">home</a>
15
+ </div>
16
+
17
+ {{ content }}
18
+
19
+ <div class="footer">
20
+ <div class="contact">
21
+ <p>
22
+ Your Name<br />
23
+ What You Are<br />
24
+ you@example.com
25
+ </p>
26
+ </div>
27
+ <div class="contact">
28
+ <p>
29
+ <a href="https://github.com/yourusername">github.com/yourusername</a><br />
30
+ <a href="https://twitter.com/yourusername">twitter.com/yourusername</a><br />
31
+ </p>
32
+ </div>
33
+ </div>
34
+ </div>
35
+
36
+ </body>
37
+ </html>
@@ -0,0 +1,6 @@
1
+ begin
2
+ require "bundler/setup"
3
+ Bundler.require(:jekyll_plugins)
4
+ rescue LoadError
5
+ end
6
+
@@ -0,0 +1,14 @@
1
+ ---
2
+ layout: default
3
+ title: Your New Jekyll Site
4
+ ---
5
+
6
+ <div id="home">
7
+ <h1>Test</h1>
8
+ {% markdown %}{% include test.md %}{% endmarkdown %}
9
+ {% markdown %}
10
+ ## Also, lets test **inline** markdown.
11
+ How'd it go?
12
+ {% endmarkdown %}
13
+ </ul>
14
+ </div>
data/test/test.rb ADDED
@@ -0,0 +1,14 @@
1
+ require 'colorator'
2
+
3
+ `bundle exec jekyll build --trace`
4
+
5
+ diff = `diff expected.html site/index.html`
6
+
7
+ if diff.size == 0
8
+ puts "passed".green
9
+ else
10
+ puts "failed".red
11
+ puts diff
12
+ abort
13
+ end
14
+
metadata ADDED
@@ -0,0 +1,115 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: jekyll-markdown-block
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Brandon Mathis
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2013-10-24 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ~>
18
+ - !ruby/object:Gem::Version
19
+ version: '1.3'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ~>
25
+ - !ruby/object:Gem::Version
26
+ version: '1.3'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ! '>='
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ! '>='
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: jekyll
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ~>
46
+ - !ruby/object:Gem::Version
47
+ version: '1.0'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ~>
53
+ - !ruby/object:Gem::Version
54
+ version: '1.0'
55
+ description: A Liquid Block which lets you use markdown in any Jekyll template.
56
+ email:
57
+ - brandon@imathis.com
58
+ executables: []
59
+ extensions: []
60
+ extra_rdoc_files: []
61
+ files:
62
+ - .gitignore
63
+ - .travis.yml
64
+ - Gemfile
65
+ - LICENSE.txt
66
+ - README.md
67
+ - Rakefile
68
+ - jekyll-markdown-block.gemspec
69
+ - lib/jekyll-markdown-block.rb
70
+ - lib/jekyll-markdown-block/version.rb
71
+ - test/.gitignore
72
+ - test/Gemfile
73
+ - test/_config.yml
74
+ - test/expected.html
75
+ - test/site/index.html
76
+ - test/source/_includes/test.md
77
+ - test/source/_layouts/default.html
78
+ - test/source/_plugins/bundler.rb
79
+ - test/source/index.html
80
+ - test/test.rb
81
+ homepage: https://github.com/imathis/jekyll-markdown-block
82
+ licenses:
83
+ - MIT
84
+ metadata: {}
85
+ post_install_message:
86
+ rdoc_options: []
87
+ require_paths:
88
+ - lib
89
+ required_ruby_version: !ruby/object:Gem::Requirement
90
+ requirements:
91
+ - - ! '>='
92
+ - !ruby/object:Gem::Version
93
+ version: '0'
94
+ required_rubygems_version: !ruby/object:Gem::Requirement
95
+ requirements:
96
+ - - ! '>='
97
+ - !ruby/object:Gem::Version
98
+ version: '0'
99
+ requirements: []
100
+ rubyforge_project:
101
+ rubygems_version: 2.0.7
102
+ signing_key:
103
+ specification_version: 4
104
+ summary: A Liquid Block which lets you use markdown in any Jekyll template.
105
+ test_files:
106
+ - test/.gitignore
107
+ - test/Gemfile
108
+ - test/_config.yml
109
+ - test/expected.html
110
+ - test/site/index.html
111
+ - test/source/_includes/test.md
112
+ - test/source/_layouts/default.html
113
+ - test/source/_plugins/bundler.rb
114
+ - test/source/index.html
115
+ - test/test.rb