From 2de5419316750f93cc9c84ba94141deb58c31ed6 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 1 Dec 2024 20:40:25 +0100 Subject: Adding mathjax version 20211120 (fccaddf). Signed-off-by: Daniel Baumann --- plugins/55/mathjax/README | 28 ++++++ plugins/55/mathjax/action/enable.php | 68 +++++++++++++ plugins/55/mathjax/conf/default.php | 19 ++++ plugins/55/mathjax/conf/metadata.php | 13 +++ plugins/55/mathjax/lang/en/settings.php | 8 ++ plugins/55/mathjax/lang/zh/settings.php | 6 ++ plugins/55/mathjax/plugin.info.txt | 7 ++ plugins/55/mathjax/syntax/protecttex.php | 161 +++++++++++++++++++++++++++++++ 8 files changed, 310 insertions(+) create mode 100644 plugins/55/mathjax/README create mode 100644 plugins/55/mathjax/action/enable.php create mode 100644 plugins/55/mathjax/conf/default.php create mode 100644 plugins/55/mathjax/conf/metadata.php create mode 100644 plugins/55/mathjax/lang/en/settings.php create mode 100644 plugins/55/mathjax/lang/zh/settings.php create mode 100644 plugins/55/mathjax/plugin.info.txt create mode 100644 plugins/55/mathjax/syntax/protecttex.php diff --git a/plugins/55/mathjax/README b/plugins/55/mathjax/README new file mode 100644 index 0000000..29f57ba --- /dev/null +++ b/plugins/55/mathjax/README @@ -0,0 +1,28 @@ +MathJax Plugin for DokuWiki + +Enables MathJax parsing of TeX math expressions in wiki pages +(See https://www.mathjax.org/) + +All documentation for this plugin can be found at +https://www.dokuwiki.org/plugin:mathjax + +If you install this plugin manually, make sure it is installed in +lib/plugins/mathjax/ - if the folder is named differently, it +will not work! + +Please refer to https://www.dokuwiki.org/plugins for additional info +on how to install plugins in DokuWiki. + +---- +Copyright (C) Mark Liffiton + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; version 2 of the License + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +See the COPYING file in your DokuWiki folder for details diff --git a/plugins/55/mathjax/action/enable.php b/plugins/55/mathjax/action/enable.php new file mode 100644 index 0000000..5063a5f --- /dev/null +++ b/plugins/55/mathjax/action/enable.php @@ -0,0 +1,68 @@ + + */ + +// must be run within Dokuwiki +if (!defined('DOKU_INC')) die(); + +/** + * Add scripts via an event handler + */ +class action_plugin_mathjax_enable extends DokuWiki_Action_Plugin { + + /** + * Registers our handler for the TPL_METAHEADER_OUTPUT event + */ + public function register(Doku_Event_Handler $controller) { + $controller->register_hook('TPL_METAHEADER_OUTPUT', 'BEFORE', $this, 'handle_tpl_metaheader_output'); + } + + /** + * Add