Is there a method to search across multiple notebooks for each in a given list of function or symbol name?

The input should be a list of function or defined symbols, and the output would be an Association with these function names as keys, and all the notebooks in which they appear as Values

I'm writing a computational book project that consists of ~30 notebooks, one chapter per notebook, plus additional (appendix) notebooks that contain functions referenced through the book.

I need to sort the function definitions, for example by the chapter in which they first appear. I could manually extract the desired function names to populate the input list.

Not necessary but nice would be an option to return the type of cell (Input vs Text) in which each function appears.

Since the notebooks are text files, I think one could do this in python or similar unix utility but would be nice to do in WL directly.


1 Answer 1


I don't think there's anything to do exactly what you want, but you should definitely look at CreateSearchIndex / TextSearch functions. You can just index the notebooks as files, but in your case it seems more useful to contruct a list of ContentObject expressions (which are just associtions with the fields you need).

  • $\begingroup$ Yes thanks, I did find a method to index the functions. $\endgroup$ Commented Jan 5, 2021 at 21:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.