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 'json'
|
||||||
require 'icalendar'
|
require 'icalendar'
|
||||||
|
require 'kramdown'
|
||||||
|
require 'kramdown-math-katex'
|
||||||
|
|
||||||
|
|
||||||
# Important!!!
|
# Important!!!
|
||||||
|
|
|
@ -15,7 +15,6 @@ pre .line-numbers {
|
||||||
transition: all .15s ease;
|
transition: all .15s ease;
|
||||||
|
|
||||||
box-shadow: 0 4px 6px rgba(50,50,93,.11), 0 1px 3px rgba(0,0,0,.08);
|
box-shadow: 0 4px 6px rgba(50,50,93,.11), 0 1px 3px rgba(0,0,0,.08);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
a.box:hover {
|
a.box:hover {
|
||||||
|
|
|
@ -5,13 +5,12 @@ class KatexDataSource < ::Nanoc::DataSource
|
||||||
|
|
||||||
def items
|
def items
|
||||||
katex_css_path = File.join(Katex.gem_path, 'vendor', 'katex', 'stylesheets', 'katex.css')
|
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', '*')]
|
||||||
|
|
||||||
[
|
font_items = katex_font_paths.map do |e|
|
||||||
new_item(
|
font_name = File.split(e)[-1]
|
||||||
File.open(katex_css_path).read,
|
new_item(File.open(e).read, {}, "/fonts/#{font_name}")
|
||||||
{},
|
end
|
||||||
"/katex.css"
|
[new_item(File.open(katex_css_path).read, {}, "/katex.css")] + font_items
|
||||||
)
|
|
||||||
]
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue