MoaiEditor plugin for DokuWiki ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ Documentation and source code ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ Documentation, source code and explanatory videos for this plugin can be found at: https://moaitools.org/dokuwiki/plugins/moaieditor Instalation ‾‾‾‾‾‾‾‾‾‾‾ If you install this plugin manually, make sure it is installed in lib/plugins/moaieditor/ - if the folder is called different it will not work! Please refer to http://www.dokuwiki.org/extensions for additional info on how to install extensions in DokuWiki. Instructions for supporting other templates ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ 0. If MoaiEditor's toggle button is not showing up in the Doku- wiki editing page, it is because it had trouble locating some of the HTML elements it needs in order to work. So, before anything else, open the browser's console to see the error. Most probably it will tell you that it could not locate certain element. Or it might throw an error because it could not parse the content of an element. After you know the issue, proceed with the following steps. Note: this error could take up to 10 seconds to appear after the page has loaded because MoaiEditor will give the template and plugins some time to render all elements before giving up. 1. Start by copying any of the existing JS template files located in the 'templates/' folder of the plugin to the 'user_templates/' folder. For example copy 'sprintdoc.js' and rename it to something like 'mytemplate.js'. The only JS file in that directory that you should NOT use as a starting point is 'default.js' because it is different from the rest. Note: The files inside the 'user_templates/' folder will not be deleted or overwritten when the plugin is updated to a new version, so your files are safe in that directory. 2. Modify the contents of the file according to what it is explained in the comments of said file. 3. Optionally add a CSS file to the 'user_templates/' folder with the same name as your other file. For example: 'mytemplate.css'. This is only necesary if you want to fine-tune the look of the editor to match your template. 4. Finally, let's talk about the 'importance()' funcion inside the template file. This is not going to be needed by most people but it solves a specific problem you might encounter. Let's say that you don't like the way the bundled 'sprintdoc.js' file is handling the SprintDoc template. So you decide to copy this file and put it in the 'user_templates/' folder in order to customize it to your liking. The only problem is that now both the original file and your file will return 'True' when their 'detectTemplate()' function is called. So nobody knows which of both files will be used by MoaiEditor when the SprintDoc template is in use. The solution to this is changing the value of the 'importance()' funcion which by default is 1. You can put any number higher than the other file (say 10 or 100) to be sure your file "wins". This is of course only necessary if there is more than one file handling the same template. Note: You can know which template file is being used by MoaiEditor by hovering your mouse over the stone statue logo 🗿 in order to display the tooltip. User template files will always start by 'user/'. For example 'user/sprintdoc'. ---- Copyright (C) 2026 MoaiTools 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; either version 2 of the License, or (at your option) any later version. 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. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.