rails_markdown_templates 2.0.1 → 2.1.0

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
  SHA1:
3
- metadata.gz: 2f97cf6a1652b00b245f74cf234d72c108f63f42
4
- data.tar.gz: 4b35c335ae90d38f4a61c3cc37b790812f11c5cf
3
+ metadata.gz: 15ca6d8e17662e6a00361c51d073c6addb836bc1
4
+ data.tar.gz: 50985960d6136f8104e7fad7c0f0bb2053adf4c4
5
5
  SHA512:
6
- metadata.gz: dd7d79f00f312528e050c7259af08dd6d492bbdd44adbaa9cc308b3ee4214dd064ce9833a58efc5ec886821c5f17b49cec2ecc518008b6863a678c1d007efd43
7
- data.tar.gz: ced8f43ace4d44be38014db79776dbd638f841527839b3bf38b0cfcad8adc80badc1f88d86e6eae6b79f61bd05f9393e8a388665ce9aa1cb8a8dd81da47bd859
6
+ metadata.gz: 9935b0f0eb1151b060fb65b9524706537e4e282e8033445f7657210cb357a8e07f6705a9ed03414970e708d013d793d74eb2ff8f05aba247c117e565f89d09e3
7
+ data.tar.gz: a35e86467ea87d04d9090a6e0447a7cfd709cd6f995d50947e0e7fb4d7e9233b06020002d03ee401d93bb9c608aa4e10316ec8180b5d079631ddbe37da77708a
data/README.md CHANGED
@@ -40,6 +40,19 @@ RailsMarkdownTemplates.metadata_tags_key = :my_metadata_tags
40
40
  RailsMarkdownTemplates.metadata_json_key = :my_metadata_json
41
41
  ```
42
42
 
43
+ It is also possible to override the set of options that are passed to
44
+ [Redcarpet](https://github.com/vmg/redcarpet); for example,
45
+
46
+ ```ruby
47
+ # Tweak options for the Markdown parser
48
+ RailsMarkdownTemplates.redcarpet_options = {
49
+ no_intra_emphasis: false,
50
+ disable_indented_code_blocks: false,
51
+ space_after_headers: false,
52
+ highlight: false
53
+ }
54
+ ```
55
+
43
56
  ## Embedded Ruby handling
44
57
 
45
58
  Markdown templates may contain standard erb tags.
@@ -21,7 +21,22 @@ require 'rails_markdown_templates/renderer'
21
21
  require 'rails_markdown_templates/version'
22
22
 
23
23
  module RailsMarkdownTemplates
24
- mattr_accessor :metadata_tags_key, :metadata_json_key
24
+ mattr_accessor :metadata_tags_key, :metadata_json_key, :redcarpet_options
25
25
  @@metadata_tags_key = :metadata_tags
26
26
  @@metadata_json_key = :metadata_json
27
+ @@redcarpet_options = {
28
+ no_intra_emphasis: true,
29
+ tables: true,
30
+ fenced_code_blocks: true,
31
+ autolink: true,
32
+ disable_indented_code_blocks: true,
33
+ strikethrough: true,
34
+ lax_spacing: true,
35
+ space_after_headers: true,
36
+ superscript: true,
37
+ underline: true,
38
+ highlight: true,
39
+ quote: true,
40
+ footnotes: true
41
+ }
27
42
  end
@@ -29,22 +29,7 @@ module RailsMarkdownTemplates
29
29
  attr_accessor :metadata
30
30
 
31
31
  def initialize(options={})
32
- redcarpet_options = {
33
- no_intra_emphasis: true,
34
- tables: true,
35
- fenced_code_blocks: true,
36
- autolink: true,
37
- disable_indented_code_blocks: true,
38
- strikethrough: true,
39
- lax_spacing: true,
40
- space_after_headers: true,
41
- superscript: true,
42
- underline: true,
43
- highlight: true,
44
- quote: true,
45
- footnotes: true
46
- }
47
- super redcarpet_options.merge(options)
32
+ super RailsMarkdownTemplates.redcarpet_options.merge(options)
48
33
  @metadata = {}
49
34
  end
50
35
 
@@ -17,5 +17,5 @@
17
17
  # <http://www.gnu.org/licenses/>.
18
18
 
19
19
  module RailsMarkdownTemplates
20
- VERSION = "2.0.1"
20
+ VERSION = "2.1.0"
21
21
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_markdown_templates
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.1
4
+ version: 2.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Simon Dawson