cmor_blog 0.0.55.pre → 0.0.60.pre
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cc196801a448b2bfadb835f9810d25963c98834df9be23bfbe70d51fd92ad9a9
|
4
|
+
data.tar.gz: bd206c699ef12eec7ed7f8bd4d94f331a77508b2a139a94425e6497f2b4ffbaa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2edc77cd8ff31f0e39afb972d5219d544307b013e84712f72ea1b9f03bd2609489828938311c4bc372a0ac5373593288765325886285d409090eeb88abae1e60
|
7
|
+
data.tar.gz: 8d6fa880066599f317e8029e1833e17b9f5b017376f924a04357b5ea405d16333bfde6c9c91793569c0e62275eada43f7d2bc437799df59252fb1a2dd94cf2e1
|
@@ -34,7 +34,7 @@ module Cmor
|
|
34
34
|
def body(format: nil)
|
35
35
|
case format
|
36
36
|
when :html
|
37
|
-
|
37
|
+
markdown_to_html(read_attribute(:body))
|
38
38
|
else
|
39
39
|
read_attribute(:body)
|
40
40
|
end
|
@@ -42,8 +42,8 @@ module Cmor
|
|
42
42
|
|
43
43
|
private
|
44
44
|
|
45
|
-
def
|
46
|
-
|
45
|
+
def markdown_to_html(string)
|
46
|
+
instance_exec(string, &Cmor::Blog::Configuration.markdown_to_html_proc)
|
47
47
|
end
|
48
48
|
end
|
49
49
|
|
data/config/locales/en.yml
CHANGED
@@ -35,6 +35,10 @@ module Cmor
|
|
35
35
|
mattr_accessor(:post_creation_information_proc) do
|
36
36
|
-> (post) { "#{l(post.created_at)} | #{post.creator&.human}" }
|
37
37
|
end
|
38
|
+
|
39
|
+
mattr_accessor(:markdown_to_html_proc) do
|
40
|
+
-> (string) { Kramdown::Document.new(string).to_html }
|
41
|
+
end
|
38
42
|
end
|
39
43
|
end
|
40
44
|
end
|
@@ -63,4 +63,19 @@ Cmor::Blog.configure do |config|
|
|
63
63
|
# default: config.post_creation_information_proc = -> (post) { "#{l(post.created_at)} | #{post.creator&.to_s}" }
|
64
64
|
#
|
65
65
|
config.post_creation_information_proc = -> (post) { "#{l(post.created_at)} | #{post.creator&.to_s}" }
|
66
|
+
|
67
|
+
# Configure how the post body is transformed from markup to html. The default
|
68
|
+
# format is markdown. Kramdown is used for the transformation and is a
|
69
|
+
# dependency of this gem.
|
70
|
+
#
|
71
|
+
# If you want to use a different markdown language you can configure it here.
|
72
|
+
#
|
73
|
+
# For example you may want to use textile as markup. First you will need to
|
74
|
+
# add RedCloth to your Gemfile. Then you can configure it as follows:
|
75
|
+
#
|
76
|
+
# config.markdown_to_html_proc = -> (string) { RedCloth.new(string).to_html }
|
77
|
+
#
|
78
|
+
# default: config.markdown_to_html_proc = -> (string) { Kramdown::Document.new(string).to_html }
|
79
|
+
#
|
80
|
+
config.markdown_to_html_proc = -> (string) { Kramdown::Document.new(string).to_html }
|
66
81
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cmor_blog
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.60.pre
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Roberto Vasquez Angel
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-10-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -30,28 +30,28 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - '='
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 0.0.
|
33
|
+
version: 0.0.60.pre
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - '='
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 0.0.
|
40
|
+
version: 0.0.60.pre
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: cmor_core_frontend
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - '='
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 0.0.
|
47
|
+
version: 0.0.60.pre
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - '='
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: 0.0.
|
54
|
+
version: 0.0.60.pre
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: sqlite3
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|