This is a bit of a strange one, but in case anyone else goes down the rabbit hole of using noweb inside orgmode, this might be interesting.

noweb syntax provides a really nifty way to split up or even autogenerate code blocks in orgmode documents. When writing literate documents noweb syntax also provides one with a way of staying on topic, whenever these files become more complex. If you’ve never used noweb syntax in orgmode you should definitely look it up.

One thing that is missing however was the the ability to include orgfiles containing noweb extensions and then use the snippets in another file like this:

#+setupfile: snippet_collection.org
# or:
#+include: snippet_collection.org

Using the library of babel we can however load snippets from other files like this:

(org-babel-lob-ingest "./path/to/snippet_collection.org")

It is also possible to use a little function like this in order to load multiple files from a directory:

(loop for filename in (file-expand-wildcards "./path/to/snippet_collection/*.org") collect (org-babel-lob-ingest filename))

Now in order to load the snippets upon opening the orgmode file add something like this or set up a .dir-locals.el file:

# Local Variables:
# eval: (loop for filename in (file-expand-wildcards "./dir/*.org") collect (org-babel-lob-ingest filename))
# End:

Of course instead of adding this line to every single file, it is also possible to create a setupfile containing these variables and to load the snippets using something like this:

#+setupfile: snippet_collection.org
# or:
#+include: snippet_collection.org