Fast way to generate a sample that can be visualized by minerl.viewer?

Or can someone explain the general ideas about how to make it work?