Merge pull request #449 from ZeusWPI/fix-katex
Fix KaTeX (math mode) fonts
This commit is contained in:
commit
3a2b233f45
3 changed files with 8 additions and 8 deletions
2
Rules
2
Rules
|
@ -3,6 +3,8 @@
|
|||
|
||||
require 'json'
|
||||
require 'icalendar'
|
||||
require 'kramdown'
|
||||
require 'kramdown-math-katex'
|
||||
|
||||
|
||||
# Important!!!
|
||||
|
|
|
@ -15,7 +15,6 @@ pre .line-numbers {
|
|||
transition: all .15s ease;
|
||||
|
||||
box-shadow: 0 4px 6px rgba(50,50,93,.11), 0 1px 3px rgba(0,0,0,.08);
|
||||
|
||||
}
|
||||
|
||||
a.box:hover {
|
||||
|
|
|
@ -5,13 +5,12 @@ class KatexDataSource < ::Nanoc::DataSource
|
|||
|
||||
def items
|
||||
katex_css_path = File.join(Katex.gem_path, 'vendor', 'katex', 'stylesheets', 'katex.css')
|
||||
katex_font_paths = Dir[File.join(Katex.gem_path, 'vendor', 'katex', 'fonts', '*')]
|
||||
|
||||
[
|
||||
new_item(
|
||||
File.open(katex_css_path).read,
|
||||
{},
|
||||
"/katex.css"
|
||||
)
|
||||
]
|
||||
font_items = katex_font_paths.map do |e|
|
||||
font_name = File.split(e)[-1]
|
||||
new_item(File.open(e).read, {}, "/fonts/#{font_name}")
|
||||
end
|
||||
[new_item(File.open(katex_css_path).read, {}, "/katex.css")] + font_items
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue