JoshKarpel/spiel

First-class mechanism for executable examples

JoshKarpel opened this issue · 0 comments

For https://github.com/JoshKarpel/pytest-its-whats-for-testing I needed to have editable and executable code examples (stored as separate files) in the presentation.

To get that talk out the door, I did this "outside the library".

It would be nice for there to be some kind of first-class mechanism for this inside spiel so that people don't need to reinvent the wheel. The problem is that this mechanism needs to be highly customizable:

  • Code examples may or may not need to be editable, and there might be multiple files involved in a given example.
  • Code examples might not be Python code, so the executable needs to be customizable (but sys.executable is probably a reasonable default). There might even be multiple things to execute!
  • The slide contents need to be totally customizable. I'm not even sure I feel comfortable providing a default...

... but it might also be worth making a "drop dead simple" version that is not very customizable, and then letting users build more complex versions if they want one - the primitives are all there, of course. Being too proscriptive is not the goal, and building something that can please everyone isn't possible either.