katex2html 0.1.6 → 0.1.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -2
- data/lib/katex2html/renderer.rb +11 -2
- data/lib/katex2html/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d8bee17322f037483ca43115f0b345dae6851094
|
4
|
+
data.tar.gz: d4b40ebb70d49abb5d66a029ff93378e30f17cb0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3c19dd3264dc5ca17175de41654e2da453f731e0ec1f5fdf264e907105235c081b72b53dd8c10c808fc00e718e0ee9dca6bf946c9b873ffcb6b6fba29f8b6cf2
|
7
|
+
data.tar.gz: ec1043bbdc7b5e48df980bcd1fc2fbac68899a8a3f73270e8c9984c5d63bdc673a0559c16d63a9fe704dc39ff32888238ca11f98b66cc8d0629c0fdd6ed6a991
|
data/README.md
CHANGED
@@ -72,7 +72,7 @@ Katex2HTML.render(latex_html, delimiters: ['BOF', 'EOF'], renderer: :html) # Ret
|
|
72
72
|
|
73
73
|
## Development
|
74
74
|
|
75
|
-
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake
|
75
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
76
76
|
|
77
77
|
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
78
78
|
|
@@ -84,4 +84,3 @@ Bug reports and pull requests are welcome on GitHub at https://github.com/apppro
|
|
84
84
|
## License
|
85
85
|
|
86
86
|
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
87
|
-
|
data/lib/katex2html/renderer.rb
CHANGED
@@ -2,11 +2,12 @@ require "execjs"
|
|
2
2
|
|
3
3
|
module Katex2HTML
|
4
4
|
class Renderer
|
5
|
-
def initialize(
|
5
|
+
def initialize(options = {})
|
6
|
+
@options = default_opts.merge(options)
|
6
7
|
end
|
7
8
|
|
8
9
|
def render(latex)
|
9
|
-
context.call("katex.renderToString", latex)
|
10
|
+
context.call("katex.renderToString", latex, @options)
|
10
11
|
end
|
11
12
|
|
12
13
|
private
|
@@ -18,5 +19,13 @@ module Katex2HTML
|
|
18
19
|
def source
|
19
20
|
@source ||= File.read(File.expand_path("../../../vendor/katex.min.js", __FILE__))
|
20
21
|
end
|
22
|
+
|
23
|
+
def default_opts
|
24
|
+
{
|
25
|
+
displayMode: false,
|
26
|
+
throwOnError: true,
|
27
|
+
errorColor: '#cc0000'
|
28
|
+
}
|
29
|
+
end
|
21
30
|
end
|
22
31
|
end
|
data/lib/katex2html/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: katex2html
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- João Fraga
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-04-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: execjs
|
@@ -138,7 +138,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
138
138
|
version: '0'
|
139
139
|
requirements: []
|
140
140
|
rubyforge_project:
|
141
|
-
rubygems_version: 2.
|
141
|
+
rubygems_version: 2.6.1
|
142
142
|
signing_key:
|
143
143
|
specification_version: 4
|
144
144
|
summary: An easy way to convert LaTeX formules into Katex HTML using Ruby.
|