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 +4 -4
- data/README.md +13 -0
- data/lib/rails_markdown_templates.rb +16 -1
- data/lib/rails_markdown_templates/renderer.rb +1 -16
- data/lib/rails_markdown_templates/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 15ca6d8e17662e6a00361c51d073c6addb836bc1
|
4
|
+
data.tar.gz: 50985960d6136f8104e7fad7c0f0bb2053adf4c4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
|