Hi all,
We’ve seen the discussion in the public area of the forum, and I wanted to have a bit of a discussion privately amongst developers.
First of all, is there a consensus on whether this would be a desired feature?
Secondly, I think it’s quite clear how we’d implement it for plugins but themes are quite tricky since they’re just a collection of resources.
For plugins, we could call a method on your plugin like:
- (BOOL)canPerformExportForMode:(NSString *)mode errorMessage:(NSString **)errorMessage;
You could check the mode against a set of predefined values (preview
, publish
etc) and return YES
or NO
as you wish - obviously if you return NO
you’ll want to populate the error message too.
Bear in mind, however, that in order to even preview a page we need to generate the HTML/CSS/JS and write it to a temporary location on disk - if someone really cared enough about getting your plugin for free, they could just grab it from there (although it would negate the point of using RapidWeaver in the first place).
There’s also a question mark around whether it’d be possible to protect this from rogue code swizzling your method and returning YES
for everything.
So - again, given what you’ve seen above is there appetite for a feature like this?
As far as themes go, we’re pretty stumped on ideas for how to do this safely given the fact that a theme is just a bunch of resources (HTML/JS/CSS/images/plist), so anything we add to those can be easily rewritten. Themes do have a Preview section on the community website - is that enough?
If we receive enough feedback on this quickly enough, we may still be able to slip this feature into 7.1