saschaleib / dokuwiki-plugin-adhoctags

A secure but flexible way to insert HTML tags into DokuWiki
GNU General Public License v2.0
1 stars 0 forks source link

DokuWiki Plugin Ad-Hoc HTML

A secure but flexible way to insert HTML tags into DokuWiki

This is an attempt to enable direct insertion of HTML tags in DokuWiki that is not reliant on the HTML option, which is no longer available in current versions of DokuWiki.

More information on the Plugin Page on DokuWiki.

HTML Elements

The following HTML elements are added by this plugin (in alphabetic order):

Please note that <div> and <span> are also handled by the Wrap Plugin and having them enabled while Wrap is also active can lead to unexpected results. If you need the attribute features of this plugin with these tags, it is better to disable Wrap, and possibly use Ad-Hoc Wrap instead as a replacement.

Attributes

Instead of specifying the attributes in the HTML format, this plugin replicates and expands the formats used by the wrap plugin, which allows to specify the attributes as in the following example:

<tagname #tagid csswidth :lang &datetime classname classname2>

Generally, attributes can appear in any order and are always optional!

Migration Notes

If you previously used <html> tags to embed HTML code into your DokuWiki site, you need to replace them with the format used by this plugin. The best way to get started is to make a run a couple of search-replace operations on the data/pages/ directory in your DokuWiki installation.

:bangbang: Important: It is advisable to run the following searches on a copy of this directory and also keep a backup of the original state, in case of problems that only show up later. The following search-replace operations can do serious damage to your site content. The autor does not take any responsibility for any damages that follow from applying this procedure: :bangbang:

:information_source: Tool: The autor has made good experiences with the Search-Replace function of Notepad++, an open-source, free and very powerful text editor for Windows. Other editors may of course also offer similar functionality.

1. Remove the \<html> tags

2. Remove the attribute name from title="…" attributes

**3. Format the language specifications (if needed)

4. Simplify any classes

In most cases, these should take care of the vast majority of HTML attributes. Make sure to check each file and clean up anything that these searches didn't catch.

If needed, similar searches can also be used for other attributes (e.g. style="([^\"]*)" -> [style=$1] for style), but it is probably a good idea to manually update these, rather than relying on automatisms.