1 MoaiEditor plugin for DokuWiki 2 ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ 3 4Documentation and source code 5‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ 6 Documentation, source code and explanatory videos for this plugin 7 can be found at: https://moaitools.org/dokuwiki/plugins/moaieditor 8 9Instalation 10‾‾‾‾‾‾‾‾‾‾‾ 11 If you install this plugin manually, make sure it is installed in 12 lib/plugins/moaieditor/ - if the folder is called different it 13 will not work! 14 15 Please refer to http://www.dokuwiki.org/extensions for additional 16 info on how to install extensions in DokuWiki. 17 18Instructions for supporting other templates 19‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ 20 0. If MoaiEditor's toggle button is not showing up in the Doku- 21 wiki editing page, it is because it had trouble locating some 22 of the HTML elements it needs in order to work. So, before 23 anything else, open the browser's console to see the error. 24 Most probably it will tell you that it could not locate certain 25 element. Or it might throw an error because it could not parse 26 the content of an element. After you know the issue, proceed 27 with the following steps. 28 29 Note: this error could take up to 10 seconds to appear after 30 the page has loaded because MoaiEditor will give the 31 template and plugins some time to render all elements 32 before giving up. 33 34 1. Start by copying any of the existing JS template files located 35 in the 'templates/' folder of the plugin to the 'user_templates/' 36 folder. For example copy 'sprintdoc.js' and rename it to something 37 like 'mytemplate.js'. The only JS file in that directory that you 38 should NOT use as a starting point is 'default.js' because it is 39 different from the rest. 40 41 Note: The files inside the 'user_templates/' folder will not be 42 deleted or overwritten when the plugin is updated to a new 43 version, so your files are safe in that directory. 44 45 2. Modify the contents of the file according to what it is explained 46 in the comments of said file. 47 48 3. Optionally add a CSS file to the 'user_templates/' folder with the 49 same name as your other file. For example: 'mytemplate.css'. This 50 is only necesary if you want to fine-tune the look of the editor 51 to match your template. 52 53 4. Finally, let's talk about the 'importance()' funcion inside the 54 template file. This is not going to be needed by most people but 55 it solves a specific problem you might encounter. 56 57 Let's say that you don't like the way the bundled 'sprintdoc.js' 58 file is handling the SprintDoc template. So you decide to copy 59 this file and put it in the 'user_templates/' folder in order to 60 customize it to your liking. 61 62 The only problem is that now both the original file and your file 63 will return 'True' when their 'detectTemplate()' function is called. 64 So nobody knows which of both files will be used by MoaiEditor when 65 the SprintDoc template is in use. The solution to this is changing 66 the value of the 'importance()' funcion which by default is 1. You 67 can put any number higher than the other file (say 10 or 100) to be 68 sure your file "wins". This is of course only necessary if there is 69 more than one file handling the same template. 70 71 Note: You can know which template file is being used by MoaiEditor 72 by hovering your mouse over the stone statue logo in order 73 to display the tooltip. User template files will always start 74 by 'user/'. For example 'user/sprintdoc'. 75 76---- 77 78Copyright (C) 2026 MoaiTools <info@moaitools.org> 79 80This program is free software; you can redistribute it and/or modify 81it under the terms of the GNU General Public License as published by 82the Free Software Foundation; either version 2 of the License, or 83(at your option) any later version. 84 85This program is distributed in the hope that it will be useful, 86but WITHOUT ANY WARRANTY; without even the implied warranty of 87MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 88GNU General Public License for more details. 89 90You should have received a copy of the GNU General Public License along 91with this program; if not, write to the Free Software Foundation, Inc., 9251 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 93 94 95