add --mathjax [CONFIG] to inject root-repo/[CONFIG] file,
which is similar to the behavior of --css and --js. CONFIG is "mathjax.config.js" by default.
This commit is contained in:
@@ -91,6 +91,7 @@ module Precious
|
||||
settings.wiki_options.merge!({ :base_path => @base_url })
|
||||
@css = settings.wiki_options[:css]
|
||||
@js = settings.wiki_options[:js]
|
||||
@mathjax_config = settings.wiki_options[:mathjax_config]
|
||||
end
|
||||
|
||||
get '/' do
|
||||
|
||||
@@ -31,15 +31,21 @@
|
||||
<script type="text/javascript" src="{{base_url}}/javascript/identicon_canvas.js"></script>
|
||||
{{/use_identicon}}
|
||||
{{#mathjax}}
|
||||
<script type="text/x-mathjax-config">
|
||||
MathJax.Hub.Config({
|
||||
{{^mathjax_config}}
|
||||
<script type="text/javascript">
|
||||
window.MathJax = {
|
||||
tex2jax: {
|
||||
inlineMath: [ ['\\(','\\)'] ],
|
||||
displayMath: [ ['$$','$$'], ['\\[','\\]'] ],
|
||||
processEscapes: true
|
||||
},
|
||||
TeX: { extensions: ["autoload-all.js"] }});
|
||||
TeX: { extensions: ["autoload-all.js"] }
|
||||
};
|
||||
</script>
|
||||
{{/mathjax_config}}
|
||||
{{#mathjax_config}}
|
||||
<script type="text/javascript" src="{{base_url}}/{{mathjax_config}}"></script>
|
||||
{{/mathjax_config}}
|
||||
<script>(function(d,j){
|
||||
j = d.createElement('script');
|
||||
j.src = '//cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML';
|
||||
|
||||
@@ -110,6 +110,10 @@ module Precious
|
||||
@mathjax
|
||||
end
|
||||
|
||||
def mathjax_config
|
||||
@mathjax_config
|
||||
end
|
||||
|
||||
def use_identicon
|
||||
@page.wiki.user_icons == 'identicon'
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user