blogdoor 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/blogdoor/builder.rb +2 -2
- data/lib/blogdoor/converter.rb +14 -0
- data/lib/blogdoor/version.rb +1 -1
- data/lib/blogdoor.rb +1 -0
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9acdaf409f2eeaa0756fac9cd04b76ff29cede4d
|
4
|
+
data.tar.gz: 2e4804a75002852a98cbc2131d3ca435d2659a35
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 040ca60c84cf640f88fb8f639ceed599f25968b84c620b54958efa3d77979228e61a04d3ca4b784f01c979be16ad93555edd54d725f43ebc4431fac2f035ceea
|
7
|
+
data.tar.gz: 401ada9d189f99c0963996ccf71f014c93d3e73764c3c668c24c1cbffa72eea7c4e92513f35a1088196cc5a5cabdb762fa177b8f604695492cfd7363f7acc85d
|
data/lib/blogdoor/builder.rb
CHANGED
@@ -10,7 +10,7 @@ module Blogdoor
|
|
10
10
|
|
11
11
|
layout_path = Pathname.new(args[:layout_path] || "./layout.erb")
|
12
12
|
@layout = ERB.new(layout_path.read)
|
13
|
-
@
|
13
|
+
@converter = Converter.new
|
14
14
|
@client = Client.new
|
15
15
|
end
|
16
16
|
|
@@ -25,7 +25,7 @@ module Blogdoor
|
|
25
25
|
filename = post_path.basename(".md")
|
26
26
|
html_path = @builds_path.join("#{filename}.html")
|
27
27
|
|
28
|
-
content = @
|
28
|
+
content = @converter.convert(post_path.read)
|
29
29
|
context = Context.new({ title: filename, created_at: post_path.mtime, content: content })
|
30
30
|
html = @layout.result(context.to_binding)
|
31
31
|
html = insert_script_tags(html)
|
@@ -0,0 +1,14 @@
|
|
1
|
+
require "redcarpet"
|
2
|
+
|
3
|
+
module Blogdoor
|
4
|
+
class Converter
|
5
|
+
def initialize
|
6
|
+
renderer = Redcarpet::Render::HTML.new(prettify: true)
|
7
|
+
@markdown = Redcarpet::Markdown.new(renderer, fenced_code_blocks: true)
|
8
|
+
end
|
9
|
+
|
10
|
+
def convert(content)
|
11
|
+
@markdown.render(content)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
data/lib/blogdoor/version.rb
CHANGED
data/lib/blogdoor.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: blogdoor
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Naoto Kaneko
|
@@ -141,6 +141,7 @@ files:
|
|
141
141
|
- lib/blogdoor/builder.rb
|
142
142
|
- lib/blogdoor/client.rb
|
143
143
|
- lib/blogdoor/command.rb
|
144
|
+
- lib/blogdoor/converter.rb
|
144
145
|
- lib/blogdoor/server.rb
|
145
146
|
- lib/blogdoor/version.rb
|
146
147
|
- lib/blogdoor/watcher.rb
|