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: 0201f2ca0c8aa20e93e86be7e459ae173c8be83bdd469f7b5c1506127504480f
4
- data.tar.gz: 623eb45db211e6725087c1bea8c0549f6cb9fb89d318183ff5bbb42348771acd
3
+ metadata.gz: cc196801a448b2bfadb835f9810d25963c98834df9be23bfbe70d51fd92ad9a9
4
+ data.tar.gz: bd206c699ef12eec7ed7f8bd4d94f331a77508b2a139a94425e6497f2b4ffbaa
5
5
  SHA512:
6
- metadata.gz: 9e2816649fa64701d925ee8e74e8b33e07fd1a38f873687a5472936a3248e39b7291207d15acb1f48ddc0bcfa2fe23806e62edd147883c14ac5f40928bb44022
7
- data.tar.gz: 86c7787d940c70b8a91d7d950d58077ae428857556bb8c33ef05abdbf9f04ff560b4f7c2f770a52209c6ab9b19706cff44ded7d912c350f51f70c71a1c9bd9bb
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
- to_markdown(read_attribute(:body))
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 to_markdown(string)
46
- Kramdown::Document.new(string).to_html
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
 
@@ -52,7 +52,7 @@ en:
52
52
  render_post:
53
53
  more: 'More'
54
54
  posts:
55
- post:
55
+ show:
56
56
  back: 'Back'
57
57
  routes:
58
58
  cmor_blog_engine: blog
@@ -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.55.pre
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-06-28 00:00:00.000000000 Z
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.55.pre
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.55.pre
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.55.pre
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.55.pre
54
+ version: 0.0.60.pre
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: sqlite3
57
57
  requirement: !ruby/object:Gem::Requirement