inhumantsar / slurp

Slurps webpages and saves them as clean, uncluttered Markdown. Think Pocket, but better.
https://inhumantsar.github.io/slurp/
MIT License
127 stars 2 forks source link

Add the ability to apply regex in property templates #19

Open chrisgrieser opened 2 months ago

chrisgrieser commented 2 months ago

Continuing indirectly from #18:

How about something like cleanup tasks for specific properties? Right now, we have s|...{s} to simple replacements, but for instance, I'd like to add a rule that replaces every instance of post with article in a given property.

Another case I sometimes stumbled upon is how certain websites add the website name to the title, for instance, with this article, | Techcrunch gets added to the title property, even though I already have that information in the site key. https://techcrunch.com/2024/05/06/boeing-starliners-first-crewed-mission-scrubbed/

Being able to define a regex that cleans up the value of a property might solve those issues

inhumantsar commented 2 months ago

seems like that shouldn't be too hard to add to the existing template feature. i'm not crazy about the current template formatter functions anyway, so this would be a good excuse to refactor them.