Add mathjax using SSL CDN.
This commit is contained in:
@@ -52,6 +52,10 @@ opts = OptionParser.new do |opts|
|
||||
opts.on("--ref [REF]", "Specify the repository ref to use (default: master).") do |ref|
|
||||
wiki_options[:ref] = ref
|
||||
end
|
||||
|
||||
opts.on("--no-mathjax", "Disables mathjax.") do
|
||||
options['mathjax'] = false
|
||||
end
|
||||
end
|
||||
|
||||
# Read command line options into `options` hash
|
||||
|
||||
@@ -138,6 +138,7 @@ module Precious
|
||||
@page = wiki.preview_page(@name, params[:content], params[:format])
|
||||
@content = @page.formatted_data
|
||||
@toc_content = wiki.universal_toc ? @page.toc_data : nil
|
||||
@mathjax = wiki.mathjax
|
||||
@editable = false
|
||||
mustache :page
|
||||
end
|
||||
@@ -235,6 +236,7 @@ module Precious
|
||||
@editable = true
|
||||
@content = page.formatted_data
|
||||
@toc_content = wiki.universal_toc ? @page.toc_data : nil
|
||||
@mathjax = wiki.mathjax
|
||||
|
||||
mustache :page
|
||||
elsif file = wiki.file(name)
|
||||
|
||||
@@ -16,8 +16,8 @@
|
||||
<script type="text/javascript" src="/javascript/gollum.dialog.js"></script>
|
||||
<script type="text/javascript" src="/javascript/gollum.placeholder.js"></script>
|
||||
|
||||
<script type="text/javascript"
|
||||
src="/javascript/editor/gollum.editor.js"></script>
|
||||
<script type="text/javascript" src="/javascript/editor/gollum.editor.js"></script>
|
||||
{{#mathjax}}<script type="text/javascript" src="https://c328740.ssl.cf1.rackcdn.com/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>{{/mathjax}}
|
||||
<title>{{title}}</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
@@ -67,12 +67,18 @@ module Precious
|
||||
def sidebar_format
|
||||
has_sidebar && @sidebar.format.to_s
|
||||
end
|
||||
|
||||
def has_toc
|
||||
!@toc_content.nil?
|
||||
end
|
||||
|
||||
def toc_content
|
||||
@toc_content
|
||||
end
|
||||
|
||||
def mathjax
|
||||
@mathjax
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -149,6 +149,7 @@ module Gollum
|
||||
# :page_file_dir - String the directory in which all page files reside
|
||||
# :ref - String the repository ref to retrieve pages from
|
||||
# :ws_subs - Array of chars to sub for ws in filenames.
|
||||
# :mathjax - Set to false to disable mathjax.
|
||||
#
|
||||
# Returns a fresh Gollum::Repo.
|
||||
def initialize(path, options = {})
|
||||
@@ -173,6 +174,7 @@ module Gollum
|
||||
@history_sanitization = options[:history_sanitization] ||
|
||||
self.class.history_sanitization
|
||||
@universal_toc = options.fetch(:universal_toc, false)
|
||||
@mathjax = options[:mathjax] || true
|
||||
end
|
||||
|
||||
# Public: check whether the wiki's git repo exists on the filesystem.
|
||||
@@ -539,6 +541,9 @@ module Gollum
|
||||
# Toggles display of universal table of contents
|
||||
attr_reader :universal_toc
|
||||
|
||||
# Toggles mathjax.
|
||||
attr_reader :mathjax
|
||||
|
||||
# Normalize the data.
|
||||
#
|
||||
# data - The String data to be normalized.
|
||||
|
||||
Reference in New Issue
Block a user