New Plugin Goodness

Hello everyone!

We know that some plugins work with only one instance of the plugin per project. So, starting with RapidWeaver 7, you’ll be able to specify the number of times a plugin can be used per project.

https://github.com/realmacsoftware/RWPluginKit/tree/7.x

This is a dynamic setting, so could be something you limit for all customers, or choose to limit the number of times a plugin can be used in demo mode.

We’ll be updating the Wiki to document this further shortly, but I wanted to make you aware of this now.

Cheers,

—N

2 Likes

And here is said documentation on the wiki!

https://github.com/realmacsoftware/RWPluginKit/wiki/Changes-in-RapidWeaver-7

Cheers,

—Nik

2 Likes

That’s cool. Thanks!

I’ve had a look at new + (BOOL)canCreateNewPage:(NSError **)errorRef class method and related example in documentation. It doesn’t seem to be multi-document friendly.

Let’s say I want to limit my plugin to max n pages per document. Using a static shared NSInteger variable like currentNumberOfPages in doc example won’t fit this need.

Am I missing anything?

This is simply an example / reference implementation. Anything more complex is up to you :wink: We’re keeping the API as simple as possible, to allow you to be creative :slightly_smiling:

—Nik

Well, I was creative enough to implement a “max page per project limit” in RCP+RW6 without relying on this API at all, but I’m still struggling to make it perfectly working in some limit cases (e.g. I can’t catch when the user drags a page between two open documents).

That said, this implementation is quite limited to me, so consider this a feature request to have an official API to set a maximum plugin instance per project. :wink:

Developer Preview 3 will enforce this check whenever a page is created / duplicated / dragged.

—N

@gibo Give this build a spin: https://dl.devmate.com/com.realmacsoftware.rapidweaver/15963b/1452080941/RapidWeaver-15963b.zip This should improve things for those extra use cases. Drop me an email with any feedback!

—Nik

1 Like