jekyll-katex 0.3.0 → 0.3.1

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
  SHA256:
3
- metadata.gz: e5f8bbfb06ad51bf7782cdad251226adc466b011e805786e4378ffcb1cfb1ab2
4
- data.tar.gz: de2ef5092e27eb79891320b0aaa04f31adbe0b76118c09baa9cce59126e49e42
3
+ metadata.gz: 88216eeb91e0690bde0e34c619711d1b901969b3ea89cda59dbab5f2f229f926
4
+ data.tar.gz: 506cb501da0aa6b450784f4ac4d99ba174cf9c639fef5e94aaf740bc8b0cdd37
5
5
  SHA512:
6
- metadata.gz: 4e434cb16965dd70fc3440b33d6a05f93d9b1db7bf2d5889ef9eb98a2fccc0c127419f3f58cd4b4e0fde9a7fd0400c7ec1bd8a89275f7b6d38df37434a65ccc6
7
- data.tar.gz: 652891ab56be42eeaa49841d0eb3b4ff77a0b31bc2927837cd37cfd6221d70c83c0cd3badac31335d8c85a0b290e75295c8b6599e3b67e56c11677c0261c9e17
6
+ metadata.gz: ba62b1caed65453cad9220c655fe06e4509fd4bf3b3d186aab0835044d40e5f671d361de75b99a2bb76b932ebeb69d0b101bc3df1e61d888ae305710c2c3c4b2
7
+ data.tar.gz: 70692291e1706c61ef47e5c68895758877fdf1c820a10e22f6340f27c99c6de41ae131ec3e90e379f8e6d4fb3e6beafde15fc39bef9b48bbf3ee05af370d041d
@@ -10,7 +10,7 @@ module Jekyll
10
10
  LOG_TOPIC = 'Katex Configuration:'
11
11
  CONFIG_DEFAULTS = {
12
12
  js_filename: 'katex.min.js',
13
- js_path: File.join(Jekyll::Katex::LIB_ROOT, 'assets/js/'),
13
+ js_path: File.join(Jekyll::Katex::LIB_ROOT, 'assets', 'js'),
14
14
  rendering_options: {
15
15
  throw_error: true,
16
16
  error_color: '#cc0000'
@@ -23,7 +23,7 @@ module Jekyll
23
23
  js_filename = JEKYLL_CONFIG['js_filename'] || CONFIG_DEFAULTS[:js_filename]
24
24
  js_path = JEKYLL_CONFIG['js_path'] || CONFIG_DEFAULTS[:js_path]
25
25
 
26
- katex_js = Dir.glob("#{js_path}/**/#{js_filename}").first
26
+ katex_js = Dir.glob(File.join(js_path, '**', js_filename)).first
27
27
  raise 'Could not find KaTeX javascript file using provided configuration.' if katex_js.nil?
28
28
  Jekyll.logger.info LOG_TOPIC, "Found KaTeX js at: #{katex_js}"
29
29
  katex_js
@@ -31,8 +31,8 @@ module Jekyll
31
31
 
32
32
  def self.global_rendering_options
33
33
  {
34
- throwOnError: JEKYLL_CONFIG['throw_error'] || CONFIG_DEFAULTS[:throw_error],
35
- errorColor: JEKYLL_CONFIG['error_color'] || CONFIG_DEFAULTS[:error_color]
34
+ throwOnError: JEKYLL_CONFIG['rendering_options']['throw_error'] || CONFIG_DEFAULTS[:rendering_options][:throw_error],
35
+ errorColor: JEKYLL_CONFIG['rendering_options']['error_color'] || CONFIG_DEFAULTS[:rendering_options][:error_color]
36
36
  }
37
37
  end
38
38
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Jekyll
4
4
  module Katex
5
- VERSION = '0.3.0'
5
+ VERSION = '0.3.1'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-katex
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jerry Lin
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-09-26 00:00:00.000000000 Z
11
+ date: 2019-02-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: execjs
@@ -115,17 +115,8 @@ executables: []
115
115
  extensions: []
116
116
  extra_rdoc_files: []
117
117
  files:
118
- - ".gitignore"
119
- - ".rubocop.yml"
120
- - ".ruby-version"
121
- - ".travis.yml"
122
118
  - LICENSE.txt
123
- - README.md
124
- - Rakefile
125
119
  - bin/console
126
- - gems.locked
127
- - gems.rb
128
- - jekyll-katex.gemspec
129
120
  - lib/assets/js/katex.min.js
130
121
  - lib/jekyll-katex.rb
131
122
  - lib/jekyll-katex/configuration.rb
@@ -134,8 +125,6 @@ files:
134
125
  - lib/jekyll-katex/version.rb
135
126
  - lib/jekyll/tags/katex.rb
136
127
  - lib/jekyll/tags/katex_math_mode.rb
137
- - package.json
138
- - yarn.lock
139
128
  homepage: https://github.com/linjer/jekyll-katex
140
129
  licenses:
141
130
  - MIT
@@ -155,8 +144,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
155
144
  - !ruby/object:Gem::Version
156
145
  version: '0'
157
146
  requirements: []
158
- rubyforge_project:
159
- rubygems_version: 2.7.7
147
+ rubygems_version: 3.0.2
160
148
  signing_key:
161
149
  specification_version: 4
162
150
  summary: Jekyll plugin for easy KaTeX math server-side rendering.
data/.gitignore DELETED
@@ -1,44 +0,0 @@
1
- /.bundle/
2
- /.yardoc
3
- /Gemfile.lock
4
- /_yardoc/
5
- /coverage/
6
- /doc/
7
- /pkg/
8
- /spec/reports/
9
- /tmp/
10
- **/jekyll-katex-*.gem
11
-
12
- ### JetBrains template
13
- .idea
14
-
15
- ## File-based project format:
16
- *.iws
17
-
18
- ## Plugin-specific files:
19
-
20
- # IntelliJ
21
- /out/
22
-
23
- ### Node template
24
- # Logs
25
- logs
26
- *.log
27
- npm-debug.log*
28
-
29
- # nyc test coverage
30
- .nyc_output
31
-
32
- # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
33
- .grunt
34
-
35
-
36
- # Dependency directories
37
- **/node_modules/
38
- jspm_packages
39
-
40
- # Optional npm cache directory
41
- .npm
42
-
43
- # Optional REPL history
44
- .node_repl_history
@@ -1,6 +0,0 @@
1
-
2
- Metrics/LineLength:
3
- Max: 120
4
-
5
- Metrics/BlockLength:
6
- Max: 60
@@ -1 +0,0 @@
1
- 2.5.1
@@ -1,5 +0,0 @@
1
- sudo: false
2
- language: ruby
3
- rvm:
4
- - 2.5.1
5
- before_install: gem install bundler -v 1.16.2
data/README.md DELETED
@@ -1,105 +0,0 @@
1
- # jekyll-katex
2
-
3
- This is a [Jekyll](http://jekyllrb.com) plugin for performing server-side math rendering via the [KaTeX](https://github.com/Khan/KaTeX) library.
4
- KaTeX is a library for rending math on the web using LaTeX, similar to MathJax.
5
-
6
- KaTeX differs from MathJax in that it displays faster rendering speed and renders to pure HTML rather than PNGs.
7
- There are various resources in benchmarking and comparing their performance, for more info, [start here](https://khan.github.io/KaTeX/).
8
-
9
- Comes packaged with KaTeX `0.9.0` but you can specify a different version in your Jekyll `_config.yml` (see below).
10
-
11
- ## Installation
12
-
13
- ### Bundler (recommended)
14
-
15
- 1. In your Jekyll project, add the plugin to your `_config.yml`, e.g.:
16
-
17
- ```yaml
18
- plugins:
19
- - jekyll-katex
20
- ```
21
-
22
- 2. Add `jekyll-katex` to your `gems.rb`/`Gemfile` plugin block:
23
-
24
- ```ruby
25
- group :jekyll_plugins do
26
- gem 'jekyll-katex'
27
- end
28
- ```
29
-
30
- Once done, execute `bundle install`. For more information, see [here](https://jekyllrb.com/docs/plugins/).
31
-
32
- 3. Add KaTeX CSS and Fonts. Follow the installation instructions on the [KaTeX README](https://github.com/Khan/KaTeX).
33
- You can skip including the `.js` file unless you want to do client-side in-browser rendering, as well.
34
-
35
- Put the following (adjusting for your version) in your page headers:
36
-
37
- ```html
38
- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.10.0-alpha/dist/katex.min.css" integrity="sha384-BTL0nVi8DnMrNdMQZG1Ww6yasK9ZGnUxL1ZWukXQ7fygA1py52yPp9W4wrR00VML" crossorigin="anonymous">
39
- ```
40
-
41
- ## Configuration
42
-
43
- Supported configuration values, shown with default values:
44
-
45
- ```yml
46
- katex:
47
- js_path: "{{ Gem::lib_path }}/assets/js" # Path used to search for katex.min.js
48
- rendering_options:
49
- # Default KaTeX rendering options. See https://github.com/Khan/KaTeX#rendering-options
50
- throw_error: true # throwOnError - set to false if you want rendering to output error as text rather than a build error
51
- error_color: "#cc0000" # errorColor
52
- ```
53
-
54
- ## Usage
55
-
56
- There are two liquid tags: `katex` and `katexmm`.
57
-
58
- ### katex
59
-
60
- Use the `katex` liquid tag for LaTeX math equations like so:
61
-
62
- ```latex
63
- {% katex %}
64
- c = \pm\sqrt{a^2 + b^2}
65
- {% endkatex %}
66
- ```
67
-
68
- If you want the equation to be rendered in display mode (on its own line, centered, large symbols), just pass in the `display` parameter:
69
-
70
- ```latex
71
- {% katex display %}
72
- c = \pm\sqrt{a^2 + b^2}
73
- {% endkatex %}
74
- ```
75
-
76
- ### katexmm
77
-
78
- The `katex` liquid tag can be cumbersome, particularly if you have many inline blocks, which would need to be opened
79
- and closed repeatedly, cluttering the source text. `katexmm` is an alternative that supports fenced math mode blocks
80
- similar to standard latex:
81
-
82
- ```latex
83
- {% katexmm %}
84
- This is a mixed environment where you can have text and normal text and $c = \pm\sqrt{a^2 + b^2}$ fenced math. \$!
85
- {% endkatexmm %}
86
- ```
87
-
88
- * `$` for inline
89
- * `$$` for display mode
90
- * `\$` to escape `$` anywhere within the `katexmm` environment
91
-
92
- ## Development
93
-
94
- ```bash
95
- $ bundle install
96
- $ rake build
97
- ```
98
-
99
- ## Contributing
100
-
101
- Feel free to open issues and pull requests.
102
-
103
- ## License
104
-
105
- The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
data/Rakefile DELETED
@@ -1,24 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'bundler/gem_tasks'
4
-
5
- task default: :build
6
-
7
- task :js_i do
8
- sh 'yarn', 'install'
9
- cp 'node_modules/katex/dist/katex.min.js', 'lib/assets/js/katex.min.js'
10
- end
11
-
12
- task build: %i[js_i] do
13
- sh 'gem', 'build', 'jekyll-katex.gemspec'
14
- end
15
-
16
- task clobber: [:clean] do
17
- rm_rf Rake::FileList.new('*.gem')
18
- end
19
-
20
- task :stylecheck do
21
- sh 'bundle', 'exec', 'rubocop', '--auto-correct'
22
- end
23
-
24
- task release: :stylecheck
@@ -1,113 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- jekyll-katex (0.3.0)
5
- execjs (~> 2.7)
6
- jekyll (~> 3.8)
7
-
8
- GEM
9
- remote: https://rubygems.org/
10
- specs:
11
- addressable (2.5.2)
12
- public_suffix (>= 2.0.2, < 4.0)
13
- ast (2.4.0)
14
- colorator (1.1.0)
15
- concurrent-ruby (1.0.5)
16
- diff-lcs (1.3)
17
- docile (1.3.1)
18
- em-websocket (0.5.1)
19
- eventmachine (>= 0.12.9)
20
- http_parser.rb (~> 0.6.0)
21
- eventmachine (1.2.7)
22
- execjs (2.7.0)
23
- ffi (1.9.25)
24
- forwardable-extended (2.6.0)
25
- http_parser.rb (0.6.0)
26
- i18n (0.9.5)
27
- concurrent-ruby (~> 1.0)
28
- jekyll (3.8.4)
29
- addressable (~> 2.4)
30
- colorator (~> 1.0)
31
- em-websocket (~> 0.5)
32
- i18n (~> 0.7)
33
- jekyll-sass-converter (~> 1.0)
34
- jekyll-watch (~> 2.0)
35
- kramdown (~> 1.14)
36
- liquid (~> 4.0)
37
- mercenary (~> 0.3.3)
38
- pathutil (~> 0.9)
39
- rouge (>= 1.7, < 4)
40
- safe_yaml (~> 1.0)
41
- jekyll-sass-converter (1.5.2)
42
- sass (~> 3.4)
43
- jekyll-watch (2.0.0)
44
- listen (~> 3.0)
45
- json (2.1.0)
46
- kramdown (1.17.0)
47
- liquid (4.0.0)
48
- listen (3.1.5)
49
- rb-fsevent (~> 0.9, >= 0.9.4)
50
- rb-inotify (~> 0.9, >= 0.9.7)
51
- ruby_dep (~> 1.2)
52
- mercenary (0.3.6)
53
- parallel (1.12.1)
54
- parser (2.5.1.2)
55
- ast (~> 2.4.0)
56
- pathutil (0.16.1)
57
- forwardable-extended (~> 2.6)
58
- powerpack (0.1.2)
59
- public_suffix (3.0.3)
60
- rainbow (3.0.0)
61
- rake (12.3.1)
62
- rb-fsevent (0.10.3)
63
- rb-inotify (0.9.10)
64
- ffi (>= 0.5.0, < 2)
65
- rouge (3.2.1)
66
- rspec (3.8.0)
67
- rspec-core (~> 3.8.0)
68
- rspec-expectations (~> 3.8.0)
69
- rspec-mocks (~> 3.8.0)
70
- rspec-core (3.8.0)
71
- rspec-support (~> 3.8.0)
72
- rspec-expectations (3.8.1)
73
- diff-lcs (>= 1.2.0, < 2.0)
74
- rspec-support (~> 3.8.0)
75
- rspec-mocks (3.8.0)
76
- diff-lcs (>= 1.2.0, < 2.0)
77
- rspec-support (~> 3.8.0)
78
- rspec-support (3.8.0)
79
- rubocop (0.56.0)
80
- parallel (~> 1.10)
81
- parser (>= 2.5)
82
- powerpack (~> 0.1)
83
- rainbow (>= 2.2.2, < 4.0)
84
- ruby-progressbar (~> 1.7)
85
- unicode-display_width (~> 1.0, >= 1.0.1)
86
- ruby-progressbar (1.10.0)
87
- ruby_dep (1.5.0)
88
- safe_yaml (1.0.4)
89
- sass (3.6.0)
90
- sass-listen (~> 4.0.0)
91
- sass-listen (4.0.0)
92
- rb-fsevent (~> 0.9, >= 0.9.4)
93
- rb-inotify (~> 0.9, >= 0.9.7)
94
- simplecov (0.16.1)
95
- docile (~> 1.1)
96
- json (>= 1.8, < 3)
97
- simplecov-html (~> 0.10.0)
98
- simplecov-html (0.10.2)
99
- unicode-display_width (1.4.0)
100
-
101
- PLATFORMS
102
- ruby
103
-
104
- DEPENDENCIES
105
- bundler (~> 1.16)
106
- jekyll-katex!
107
- rake (~> 12.3)
108
- rspec (~> 3.7)
109
- rubocop (~> 0.56.0)
110
- simplecov (~> 0.16)
111
-
112
- BUNDLED WITH
113
- 1.16.3
data/gems.rb DELETED
@@ -1,6 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- source 'https://rubygems.org'
4
-
5
- # Specify your gem's dependencies in jekyll-katex.gemspec
6
- gemspec
@@ -1,43 +0,0 @@
1
-
2
- # frozen_string_literal: true
3
-
4
- lib = File.expand_path('lib', __dir__)
5
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
6
-
7
- require 'jekyll-katex/version'
8
-
9
- Gem::Specification.new do |spec|
10
- spec.name = 'jekyll-katex'
11
- spec.version = Jekyll::Katex::VERSION
12
- spec.authors = ['Jerry Lin']
13
- spec.email = 'linjer@gmail.com'
14
-
15
- spec.summary = 'Jekyll plugin for easy KaTeX math server-side rendering.'
16
- spec.description = 'Adds a liquid tag you can use to do server-side rendering of latex math using KaTeX'
17
- spec.homepage = 'https://github.com/linjer/jekyll-katex'
18
- spec.license = 'MIT'
19
-
20
- # Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
21
- # to allow pushing to a single host or delete this section to allow pushing to any host.
22
- # if spec.respond_to?(:metadata)
23
- # spec.metadata['allowed_push_host'] = "'http://mygemserver.com'"
24
- # else
25
- # raise 'RubyGems 2.0 or newer is required to protect against public gem pushes.'
26
- # end
27
-
28
- spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) } <<
29
- spec.bindir = 'bin'
30
- spec.executables = []
31
- spec.require_paths = ['lib']
32
-
33
- spec.required_ruby_version = '>= 2.5.1'
34
-
35
- spec.add_runtime_dependency 'execjs', '~> 2.7'
36
- spec.add_runtime_dependency 'jekyll', '~> 3.8'
37
-
38
- spec.add_development_dependency 'bundler', '~> 1.16'
39
- spec.add_development_dependency 'rake', '~> 12.3'
40
- spec.add_development_dependency 'rspec', '~> 3.7'
41
- spec.add_development_dependency 'rubocop', '~> 0.56.0'
42
- spec.add_development_dependency 'simplecov', '~> 0.16'
43
- end
@@ -1,14 +0,0 @@
1
- {
2
- "name": "jekyll-katex",
3
- "version": "0.1.3",
4
- "description": "Server-side LaTeX math rendering via KaTeX",
5
- "private": true,
6
- "directories": {},
7
- "scripts": {},
8
- "author": "Jerry Lin",
9
- "license": "MIT",
10
- "dependencies": {
11
- "katex": "^0.9.0"
12
- },
13
- "repository": "git@github.com:linjer/jekyll-katex.git"
14
- }
data/yarn.lock DELETED
@@ -1,15 +0,0 @@
1
- # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
2
- # yarn lockfile v1
3
-
4
-
5
- katex@^0.9.0:
6
- version "0.9.0"
7
- resolved "https://registry.yarnpkg.com/katex/-/katex-0.9.0.tgz#26a7d082c21d53725422d2d71da9b2d8455fbd4a"
8
- integrity sha512-lp3x90LT1tDZBW2tjLheJ98wmRMRjUHwk4QpaswT9bhqoQZ+XA4cPcjcQBxgOQNwaOSt6ZeL/a6GKQ1of3LFxQ==
9
- dependencies:
10
- match-at "^0.1.1"
11
-
12
- match-at@^0.1.1:
13
- version "0.1.1"
14
- resolved "https://registry.yarnpkg.com/match-at/-/match-at-0.1.1.tgz#25d040d291777704d5e6556bbb79230ec2de0540"
15
- integrity sha512-h4Yd392z9mST+dzc+yjuybOGFNOZjmXIPKWjxBd1Bb23r4SmDOsk2NYCU2BMUBGbSpZqwVsZYNq26QS3xfaT3Q==