Learn about DokuWiki
Learn about DokuWiki
Compatible with DokuWiki
BatchEdit is an admin plugin that allows you to use regular expressions to search and replace text on DokuWiki pages. As it works with raw DokuWiki text, the plugin can be also used to modify markup of the pages. This can be very helpful when there are multiple pages with similar markup. For example, you can update pages created from a namespace template if you decide to change the template.
After installation BatchEdit shows up on the Administration page.
When started, the plugin displays a form with four edit fields:
Below the edit fields there are two buttons:
BatchEdit displays every match of the search results in a separate box. On top of the box the plugin shows a check box with the page name and a character offset where the match occurred. The check box is used to select matches for the replacement. In order to prevent unexpected results the check box is unchecked by default requiring the user to confirm every replacement. To the right from the page name there are two icons: the first one links to the page itself and the second one to the editor. The rest of the box is split in two parts: matched text with some context on the left side; and the same fragment with applied replacement on the right. Both the matched text and the replacement are highlighted.
After the replacement, the matches show up with no check box in the caption and replaced text is highlighted with green.
BatchEdit does not rely on any caching to do the search, so every time Preview or Apply button is clicked the DokuWiki server reads all the pages from a hard drive. To reduce the server load and search time use Namespace field that limits the search scope.
While BatchEdit locks pages during replacement, there is still a small possibility for the data corruption. The replacement is performed in two stages:
If the page is modified between these two stages, BatchEdit will apply the replacement to random data in the updated page. Though the chances of such corruption are rather small, the administrators should take care to minimize DokuWiki activity when Batchedit is used.
BatchEdit uses DokuWiki page index to get the list of existing pages instead of going through the data directories. If the index is incomplete the plugin will not see some pages. This also applies to the “special” pages, for example, namespace templates.
Please report bugs or feature requests at the bug tracker.