dokuwiki_plugin_wrap icon indicating copy to clipboard operation
dokuwiki_plugin_wrap copied to clipboard

Define the preset inserted WRAP-wikicode outside the plugin (and possibly add/remove presets) (Feature request)

Open erik-alm opened this issue 3 years ago • 5 comments

I would like to be able to add some content in the wiki-text that renders when using a predefined box from the toolbar.

How about defining the actual content of the boxes in files and then using some unique sequence of chars, for instance, box_content or {{selected_text}} (or ${BODY} if you're IntelliJ fans...) to insert the box content, either from the selection or some default content.

This is how the TODO box might be defined in such a file:

<WRAP center round todo 60%>
${BODY}
</WRAP>

Preferably the changes would happen in some "local" config file or similar so they could survive plugin updates.

Further (or complementary?), it would also be nice to be able to add or remove preset formats. Which likely would be possible using the same approach as allowing the content of the boxes to change. (Plus some more configuration of things like icons and so on).

erik-alm avatar Jun 26 '22 04:06 erik-alm

Probably I did get your point not correctly, but the configuration settings has already the option to exclude or include certain classes. See https://www.dokuwiki.org/plugin:wrap#configuration_options restrictedClasses and restrictionType

Klap-in avatar Jun 26 '22 17:06 Klap-in

Yes, you're not getting my point correctly. ;)

I'm talking about the ability to define the actual text being pasted into the editor text area when clicking the icons displayed when clicking the WRAP-icon in the editing toolbar.

This text is currently being produced by combining data from several PHP arrays (if I remember correctly what I gathered when checking out the code).

So it may not be that hard to instead pick it from an external file. I didn't get that far in my code check (plus I'm not that good at PHP... or DokuWiki plugin coding...)

erik-alm avatar Jun 29 '22 00:06 erik-alm

Probably I did get your point not correctly, but the configuration settings has already the option to exclude or include certain classes. See https://www.dokuwiki.org/plugin:wrap#configuration_options restrictedClasses and restrictionType

I updated the title to try and make it clearer what the request is...

erik-alm avatar Jun 29 '22 00:06 erik-alm

I see. Related to #193 as well.

Klap-in avatar Jun 29 '22 08:06 Klap-in

I see. Related to #193 as well.

Yes, #193 is the same as the second part of my suggestion, though I guess part 2 would be best implemented using tech from part 1.

I feel the ability to change what is inserted (part 1) is prio 1 and to add new inserts (part 2 and #193) is prio 2, at least from my point of view.

If push comes to shove being able to redefine the inserts would make it possible to add your own formats/classes for the given slots... theoretically even do some light hacking and change the icons.

erik-alm avatar Jul 02 '22 09:07 erik-alm