Embedding a folder of files then scripting a change around each embed?

Hey,
Whats the best way to obtain the following outcome:

  1. with a number of *md files in a folder, for each file, create a embedded link for each one in a contents note. eg
    [[file1]]
    [[file2]]
    [[file3]]

    [[file…nth]]

then…

  1. wrap each embedded link with:

'```dynamic-embed
[[file1]]

'```dynamic-embed
[[file2]]

'```dynamic-embed
[[file3]]

(NB: the dyanmic-embed code block does have closing ‘```’ but I couldn’t figure out how to render it in this post).

Options

  • something in obsidian thats scriptable / hotkeyable (ideally!)
  • python something externally - unsure how well the [[ ]] links will work unless I use relative addresses.
  • link each file manually, then use find and replace on each [[ and ]] - will need to use regex to put in the linebreaks.

Keen for ideas!
Thanks for your help.

We don’t know your workflow. So I can’t say anything.
Is dynamic-embed for some plugin? I wouldn’t use it. Obsidian has its own embedding functionality which can be used for Publish, Digital Gardens, etc.

The rational was to export a md file to a docx, with all of its embedded files showing without including the individual embedded file’s yaml.

I fail to see how that would work out in an exported docx file, especially with the overhead of the dynamic-embed plugin (I saw this a few months ago, I uninstalled instantly).
But it’s possible some exporters may be able to do what you want without this plugin in the mix.