daimon-markdown 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +0 -1
- data/README.md +1 -2
- data/daimon-markdown.gemspec +3 -3
- data/lib/daimon/markdown/filter/redcarpet.rb +1 -2
- data/lib/daimon/markdown/plugin/math.rb +10 -5
- data/lib/daimon/markdown/version.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4e20e55ed32a19fb66f20fdbead98a4b47861e17
|
4
|
+
data.tar.gz: 1ce624b14e5eabeff31dd59b61880964b39d2108
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9bab7bef899fe56780ca7ed03161da612b11c4391556bc89d90e30e2a5295120e45bcf989d0c27ce42694594c7f4be5bf8bc840e7f2f52814825710cd82db52f
|
7
|
+
data.tar.gz: 03abedc0dbad66b922b5d4bde77d2a6f41eebcee28a765412dd3260748a7459dece2d5da8f9ce92abf23536b0487d9835554698ea532fdbc8c71c2b2cd0396a0
|
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -57,14 +57,13 @@ Use 2 backslashes if you want to use commands start with backslash.
|
|
57
57
|
|
58
58
|
Currently support LaTeX and AsciiMath.
|
59
59
|
|
60
|
-
```
|
60
|
+
```text
|
61
61
|
# Inline style
|
62
62
|
|
63
63
|
This is a expression {{math("$1 + 1 = 2$")}}. And {{math("$2^10 = 1024$")}} .
|
64
64
|
|
65
65
|
# Block style
|
66
66
|
|
67
|
-
```
|
68
67
|
{{math("$$
|
69
68
|
\\begin{aligned}
|
70
69
|
\\dot{x} & = \\sigma(y-x) \\\\
|
data/daimon-markdown.gemspec
CHANGED
@@ -6,15 +6,15 @@ require 'daimon/markdown/version'
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
7
|
spec.name = "daimon-markdown"
|
8
8
|
spec.version = Daimon::Markdown::VERSION
|
9
|
-
spec.authors = ["
|
10
|
-
spec.email = ["
|
9
|
+
spec.authors = ["daimon developers"]
|
10
|
+
spec.email = [""]
|
11
11
|
|
12
12
|
spec.summary = %q{Markdown renderer for Daimon}
|
13
13
|
spec.description = %q{Markdown renderer for Daimon}
|
14
14
|
spec.homepage = "https://github.com/bm-sms/daimon-markdown"
|
15
15
|
spec.license = "MIT"
|
16
16
|
|
17
|
-
spec.required_ruby_version = ">= 2.
|
17
|
+
spec.required_ruby_version = ">= 2.3.0"
|
18
18
|
|
19
19
|
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
20
20
|
spec.bindir = "bin"
|
@@ -14,9 +14,8 @@ module Daimon
|
|
14
14
|
private
|
15
15
|
|
16
16
|
def markdown
|
17
|
-
renderer = Daimon::Markdown::Redcarpet::HTMLRenderer.new(hard_wrap: true)
|
18
17
|
@markdown ||= ::Redcarpet::Markdown.new(
|
19
|
-
|
18
|
+
Daimon::Markdown::Redcarpet::HTMLRenderer.new(hard_wrap: true),
|
20
19
|
fenced_code_blocks: true,
|
21
20
|
tables: true)
|
22
21
|
end
|
@@ -5,11 +5,7 @@ module Daimon
|
|
5
5
|
Plugin.register("math", self)
|
6
6
|
|
7
7
|
def self.script_tag
|
8
|
-
<<~TAG
|
9
|
-
<script type="text/javascript"
|
10
|
-
async
|
11
|
-
src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML">
|
12
|
-
</script>
|
8
|
+
tag = <<~TAG
|
13
9
|
<script type="text/x-mathjax-config">
|
14
10
|
MathJax.Hub.Config({
|
15
11
|
tex2jax: {inlineMath: [['$','$']]},
|
@@ -17,7 +13,16 @@ module Daimon
|
|
17
13
|
TeX: {extensions: ["mhchem.js"]}
|
18
14
|
});
|
19
15
|
</script>
|
16
|
+
<script type="text/javascript"
|
17
|
+
async
|
18
|
+
src="https://cdn.mathjax.org/mathjax/2.6-latest/MathJax.js?config=TeX-MML-AM_CHTML">
|
19
|
+
</script>
|
20
20
|
TAG
|
21
|
+
if tag.respond_to?(:html_safe)
|
22
|
+
tag.html_safe
|
23
|
+
else
|
24
|
+
tag
|
25
|
+
end
|
21
26
|
end
|
22
27
|
|
23
28
|
def call(expression)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: daimon-markdown
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
-
|
7
|
+
- daimon developers
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-05-
|
11
|
+
date: 2016-05-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: html-pipeline
|
@@ -110,7 +110,7 @@ dependencies:
|
|
110
110
|
version: '0'
|
111
111
|
description: Markdown renderer for Daimon
|
112
112
|
email:
|
113
|
-
-
|
113
|
+
- ''
|
114
114
|
executables: []
|
115
115
|
extensions: []
|
116
116
|
extra_rdoc_files: []
|
@@ -149,7 +149,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
149
149
|
requirements:
|
150
150
|
- - ">="
|
151
151
|
- !ruby/object:Gem::Version
|
152
|
-
version: 2.
|
152
|
+
version: 2.3.0
|
153
153
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
154
154
|
requirements:
|
155
155
|
- - ">="
|