As a follow-up to #1805 / #1821, we could use a collapsed drop-down and literal include in Sphinx to show the examples verbatim with syntax highlighting in the docs (e.g., "Script Details" here).
Even better would be a small README file per example, similar to here.