Re: [Tiki-devel] Indentation plugin
Jonny Bradley via TikiWiki-devel <[email protected]>
| Newsgroups | gmane.comp.cms.tiki.devel |
|---|---|
| Message-ID | <[email protected]> |
Hi Volker Good stuff, you know you can make a draft merge request on gitlab and we could discuss it there, but here's good too! Re the undocumented properties: > 'introduced' => 24, As you guessed, is the Tiki version it first appeared in, so 24 for this is good. > 'filter' => 'wikicontent', is which filter is applied to the input data, and wikicontent is probably fine here, it means anything you would put into a wiki page (but it would be just text, a pagename or a username etc, again, probably not terribly well documented) > 'tags' => [ 'basic' ], Is should the pref for this appear in basic, advanced or even experimental views (in the control panels) - i'm not so sure that actually has much effect on plugins these days... One that is missing is the 'format' property (which seems to be missing from wikiplugin_div too). This defaults to 'wiki' but sometimes should be set to 'html' if there is no further parsing of the output required, whereas here you probably have more parsing to do on the $data in case there is formatting or something to be done on what's being indented. So good to go, i think, well done! Next, https://gitlab.com/tikiwiki/tiki/-/merge_requests/new :) jonny > On 10 Dec 2021, at 17:56, Volker Wysk <post-hhF2Jplw28UoZk/[email protected]> wrote: > > Hi! > > I made a simple plugin, which allows for the indentation of arbitrary blocks > of wiki content, not just inside of lists. It's a feature which MoinMoin > has, which (it seems) is not present in Tiki so far. I'd like it to be > included in Tiki 24. > > It's so small that I include it here: > > -----snip----- > <?php > // ... copyright notice ... > function wikiplugin_indent_info() > { > return [ > 'name' => tra('Indentation'), > 'documentation' => 'PluginIndent', > 'description' => > tra('Indent a block of wiki content by one level.'), > 'format' => 'wiki', > 'prefs' => [ 'wikiplugin_indent' ], > 'body' => tra('Wiki content (text) that is to be indented.'), > 'introduced' => 24, > 'filter' => 'wikicontent', > 'tags' => [ 'basic' ], > 'params' => [ ], > ]; > } > > function wikiplugin_indent($data, $params) > { > return "<ul><li style=\"list-style-type:none\">$data</li></ul>"; > } > -----snip----- > > I've taken PluginSup as a starting point. > > Now there are two points which need to be addressed before I can do a merge > request. > > - Please have a look at the plugin properties (above). The properties > 'introduced', 'filter' and 'tags' are guesswork. I've taken them from > PluginSup. They aren't documented in any of these places: > > https://dev.tiki.org/Hello+World#To_create_a_new_plugin > https://dev.tiki.org/Code-Howto%3A-Create-a-Wiki-Plugin > > - I'd like the wikiplugin_indent to be enabled by default. Is this okay? > > > Cheers, > Volker > _______________________________________________ > TikiWiki-devel mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/tikiwiki-devel