Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
erik-alm opened this issue Jun 26, 2022 · 5 comments
Labels

Comments

@erik-alm
Copy link

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).

@Klap-in
Copy link
Collaborator

Klap-in commented Jun 26, 2022

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

@erik-alm
Copy link
Author

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 erik-alm changed the title Define the preset boxes outside the plugin (and possibly add/remove boxes) (Feature request) Define the preset inserted WRAP-wikicode outside the plugin (and possibly add/remove presets) (Feature request) Jun 29, 2022
@erik-alm
Copy link
Author

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...

@Klap-in
Copy link
Collaborator

Klap-in commented Jun 29, 2022

I see. Related to #193 as well.

@erik-alm
Copy link
Author

erik-alm commented Jul 2, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants