Recover embed examples

fixes #1458 

This recover the embed examples: 2 scripts and the reveal-based flask-based embed-based application :wink:

I just opened this as an standalone PR because it is a group of related examples and I am reintroducing them as a whole, not just tiny fixes like we will push to the pre-release example PR.
To be honest I don't really like this function, I appreciate the intent, but the fact that there are three cases that each use this function to do one of the cases, once each, makes me feel it just overcomplicates things. I think for users it would be better to see all the steps needed for a given plot in one place than have to trace through code to see everything that needs to be done.