u/EricLowry

I made a plugin that helps do batch search/replace in the form of preset commands!

I made a plugin that helps do batch search/replace in the form of preset commands!

I often need to do a whole bunch of small replace actions across a ton of content; so I went and made an Obsidian plugin that lets you set up series of replace actions using plain text or regex that you can use in the right-click menu!

It's meant to be as intuitive as possible, with live previews in the editor (especially useful when using regex), and either affects the whole page, or currently selected text to avoid messy mistakes. You can even Ctrl+Z undo things if you made a mistake.

Features

  • Custom Actions:
  • Create named actions (e.g., "Clean OCR", "Format Tables") that contain one or more search/replace rules.
  • Live Preview Test Bench:
  • Instantly test your rules in settings using a real-time preview. Each rule shows its step-by-step intermediate output before giving the final result.
  • Sequential Processing & Reordering:
  • Chain multiple rules perfectly and easily rearrange their execution order directly in the UI.
  • Smart Targeting:
  • If you highlight text, the action only applies to your selection. If nothing is selected, it applies to the entire document.
  • Single-Step Undo:
  • No matter how many rules are in your action, they are applied as a single atomic transaction. One press of Ctrl+Z undoes the entire operation.
  • Regex & Capture Groups:
  • Full support for JavaScript Regular Expressions. Use capture groups (e.g., $1, $2) in your replacement strings.
  • Custom Regex Flags:
  • Easily add flags like i (case-insensitive) or m (multiline) to your regex rules.
  • Plaintext Escapes:
  • If you turn regex off, you can still search for \n (newlines) and \t (tabs) in plaintext mode.
  • Easy Access:
  • Run your actions directly from the Obsidian Command Palette (Ctrl/Cmd + P), or add them to the right-click Editor Context Menu.

Just look for Replace Commands in the Communi Plugins settings menu; or check out the Obsidian Community listing.

community.obsidian.md
u/EricLowry — 22 hours ago

Responsive Images HTML from Markdown (using Marked.js)

Hi all, a few months ago I was playing around with using Marked.js to turn Markdown into HTML and wanted to find a way to generate modern responsive images (<picture> tags with an srcset).
My main concern was that the actual Markdown code should be fully functional without needing to include HTML.
So I came up with a trick where I include all the information about the various versions of each image in the file name.

After a few months and quite a bit of testing, it's now fully functional, configurable, and ready to use.

If anyone is interested, I've made it available via NPM; and it's all open source, hosted over on GitHub.


Recently, I added a few configuration options to let you add a class to the <picture> element and better support for lazy loading. I doubt I'll be making any changes beyond this point unless anyone comes up with a good feature I could include.
I also wrote a little PowerShell script for myself that automatically generates image variants and the corresponding file name, which makes the process quite a bit easier.

github.com
u/EricLowry — 3 days ago