katex2html 0.1.6 → 0.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ee002540decf9dcef38dda4230362840cff1de98
4
- data.tar.gz: 0455d48a4a9d6e87aeae21da4f5541076f0ac450
3
+ metadata.gz: d8bee17322f037483ca43115f0b345dae6851094
4
+ data.tar.gz: d4b40ebb70d49abb5d66a029ff93378e30f17cb0
5
5
  SHA512:
6
- metadata.gz: a2608f28a7c9a507596aa4b2a63c07468459178973a4975b8312ee2df9a604d370520d4306c081e4a8d68a59c505e356e078671e0516cd85eaa4a1e94a5e6239
7
- data.tar.gz: 0a7d90aea74c4c9bd4254bd91b43ee491643a852ebd8eb881596eea95d6cf637bf049672a69f53f5bc7b58e6eb1979bb89156c153c76c88092c38aeb38ea415d
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 rspec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
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
-
@@ -2,11 +2,12 @@ require "execjs"
2
2
 
3
3
  module Katex2HTML
4
4
  class Renderer
5
- def initialize(_options = {})
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
@@ -1,3 +1,3 @@
1
1
  module Katex2HTML
2
- VERSION = "0.1.6"
2
+ VERSION = "0.1.7"
3
3
  end
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.6
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: 2015-12-22 00:00:00.000000000 Z
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.4.8
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.