I am not familiar with Mark’s code but I do spot a lot of syntax errors. I highly recommend taking the time to familiarize yourself with basic wikitext syntax.
This version below corrects the syntax issues that I spotted at a quick glance:
@Mark_S
I had used a lightbox macro by Telumire in the past.
So some of the images in my tiddlers have this format <<lightbox 'url'>>
And some of them are within details widget.
Is it possible to extract such images using regexp?
This is a sample tiddler
Edit:
Also images like in this tiddler are not getting extracted.
Possible … probably. Easy … not so much. But I think that’s the approach Mohammad uses in refnotes to extract references. But in that case, we ended up using a JS macro I wrote. Sadly, TW still lacks the tools you need to easily extract patterns. It has bits and pieces that kind of approach one end or the other end of the problem, but doesn’t give you a one-stop solution. So you end up with long, complicated filter runs.
The current extractor only extracts images with the jpg extension. It would need some more work for other file extensions.
If you’re serious about extracting images, and don’t mind using 3rd party tools, then adding the regexps tool from this sad little PR might simplify things:
I have custom filters and macros that would probably handle this use case quite well. You are looking at a 2-3 week period before I can get them published though.
As you mentioned in this post, I tried the code to extract the lightbox images and created a button to show it in spotlight. But it doesnt seem to work. Click on the lightbulb button in the subtitle of this tiddler
This version seems to deploy the lightboxes. The alternative would be to do a second stage regexp after the first that extracts everything in the string, and then feed that string to lightbox launched by a $macrocall widget.
This seems to work. How will I incorporate it into this button
More that the lightbox images, these images form a major bulk in my wiki. I am gradually reducing the use of lightbox and trying to shift to spotlight. Is there any way to extract them?
I’m not entirely sure what you want here, and I don’t know anything about spotlight, and there is no info in the plugin readme. But I’m guessing you’re heading toward something like:
But when I tried to use this code to create a button (in the subtitle) for invoking the spotlight - it’s showing only one image - Here is the button and here is the image tiddler.