How to embed external content into a topic?

I have now updated our “Formatting and structuring your content” documentation topic now with my answer from above, plus some more details. (And meanwhile, moved this discussion out to its own topic.)