mirror of
https://gitee.com/vnotex/vnote.git
synced 2025-07-06 06:19:52 +08:00
add config mathjax_javascript for Mathjax location and configuration
This commit is contained in:
parent
da64b8c12f
commit
d955dedcb7
@ -119,6 +119,10 @@ confirm_images_clean_up=true
|
|||||||
; Confirm before reloading folder from disk
|
; Confirm before reloading folder from disk
|
||||||
confirm_reload_folder=true
|
confirm_reload_folder=true
|
||||||
|
|
||||||
|
[web]
|
||||||
|
; Location and configuration for Mathjax
|
||||||
|
mathjax_javascript=https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.2/MathJax.js?config=TeX-MML-AM_CHTML
|
||||||
|
|
||||||
[session]
|
[session]
|
||||||
tools_dock_checked=true
|
tools_dock_checked=true
|
||||||
|
|
||||||
|
@ -561,7 +561,7 @@ QString VUtils::generateHtmlTemplate(MarkdownConverterType p_conType, bool p_exp
|
|||||||
" showProcessingMessages: false,\n"
|
" showProcessingMessages: false,\n"
|
||||||
" messageStyle: \"none\"});\n"
|
" messageStyle: \"none\"});\n"
|
||||||
"</script>\n"
|
"</script>\n"
|
||||||
"<script type=\"text/javascript\" async src=\"" + VNote::c_mathjaxJsFile + "\"></script>\n" +
|
"<script type=\"text/javascript\" async src=\"" + g_config->getMathjaxJavascript() + "\"></script>\n" +
|
||||||
"<script>var VEnableMathjax = true;</script>\n";
|
"<script>var VEnableMathjax = true;</script>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -213,6 +213,9 @@ void VConfigManager::initialize()
|
|||||||
|
|
||||||
m_confirmReloadFolder = getConfigFromSettings("global",
|
m_confirmReloadFolder = getConfigFromSettings("global",
|
||||||
"confirm_reload_folder").toBool();
|
"confirm_reload_folder").toBool();
|
||||||
|
|
||||||
|
m_mathjaxJavascript = getConfigFromSettings("web",
|
||||||
|
"mathjax_javascript").toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
void VConfigManager::readPredefinedColorsFromSettings()
|
void VConfigManager::readPredefinedColorsFromSettings()
|
||||||
|
@ -277,6 +277,8 @@ public:
|
|||||||
bool getConfirmReloadFolder() const;
|
bool getConfirmReloadFolder() const;
|
||||||
void setConfirmReloadFolder(bool p_enabled);
|
void setConfirmReloadFolder(bool p_enabled);
|
||||||
|
|
||||||
|
const QString &getMathjaxJavascript() const;
|
||||||
|
|
||||||
// Return the configured key sequence of @p_operation.
|
// Return the configured key sequence of @p_operation.
|
||||||
// Return empty if there is no corresponding config.
|
// Return empty if there is no corresponding config.
|
||||||
QString getShortcutKeySequence(const QString &p_operation) const;
|
QString getShortcutKeySequence(const QString &p_operation) const;
|
||||||
@ -557,6 +559,9 @@ private:
|
|||||||
// Confirm before reloading folder from disk.
|
// Confirm before reloading folder from disk.
|
||||||
bool m_confirmReloadFolder;
|
bool m_confirmReloadFolder;
|
||||||
|
|
||||||
|
// Location and configuration for Mathjax.
|
||||||
|
QString m_mathjaxJavascript;
|
||||||
|
|
||||||
// The name of the config file in each directory, obsolete.
|
// The name of the config file in each directory, obsolete.
|
||||||
// Use c_dirConfigFile instead.
|
// Use c_dirConfigFile instead.
|
||||||
static const QString c_obsoleteDirConfigFile;
|
static const QString c_obsoleteDirConfigFile;
|
||||||
@ -1468,4 +1473,9 @@ inline void VConfigManager::setConfirmReloadFolder(bool p_enabled)
|
|||||||
m_confirmReloadFolder);
|
m_confirmReloadFolder);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline const QString &VConfigManager::getMathjaxJavascript() const
|
||||||
|
{
|
||||||
|
return m_mathjaxJavascript;
|
||||||
|
}
|
||||||
|
|
||||||
#endif // VCONFIGMANAGER_H
|
#endif // VCONFIGMANAGER_H
|
||||||
|
@ -44,8 +44,6 @@ const QString VNote::c_mermaidForestCssFile = ":/utils/mermaid/mermaid.forest.cs
|
|||||||
const QString VNote::c_flowchartJsFile = ":/utils/flowchart.js/flowchart.min.js";
|
const QString VNote::c_flowchartJsFile = ":/utils/flowchart.js/flowchart.min.js";
|
||||||
const QString VNote::c_raphaelJsFile = ":/utils/flowchart.js/raphael.min.js";
|
const QString VNote::c_raphaelJsFile = ":/utils/flowchart.js/raphael.min.js";
|
||||||
|
|
||||||
const QString VNote::c_mathjaxJsFile = "https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML";
|
|
||||||
|
|
||||||
const QString VNote::c_highlightjsLineNumberExtraFile = ":/utils/highlightjs/highlightjs-line-numbers.min.js";
|
const QString VNote::c_highlightjsLineNumberExtraFile = ":/utils/highlightjs/highlightjs-line-numbers.min.js";
|
||||||
|
|
||||||
const QString VNote::c_shortcutsDocFile_en = ":/resources/docs/shortcuts_en.md";
|
const QString VNote::c_shortcutsDocFile_en = ":/resources/docs/shortcuts_en.md";
|
||||||
|
@ -62,9 +62,6 @@ public:
|
|||||||
static const QString c_flowchartJsFile;
|
static const QString c_flowchartJsFile;
|
||||||
static const QString c_raphaelJsFile;
|
static const QString c_raphaelJsFile;
|
||||||
|
|
||||||
// Mathjax
|
|
||||||
static const QString c_mathjaxJsFile;
|
|
||||||
|
|
||||||
// Highlight.js line number plugin
|
// Highlight.js line number plugin
|
||||||
static const QString c_highlightjsLineNumberExtraFile;
|
static const QString c_highlightjsLineNumberExtraFile;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user