One thing I want to add regarding imports–
Although I've posted an example page with "all of the snippets" for Swift Markdown, which includes code only about Swift Markdown, I want to seed a consideration out there that it could be possible for a library's snippets to appear in places other than in your own documentation, whether it's all on one page or not. Just to give some examples: search results across many packages, embeds in Q&A sites, or cases where snippets show a possible combination of APIs across multiple modules. What seems repetitive and redundant here might not be in other contexts. It might be helpful to think of each snippet having an imaginary "start a new project with this code" button.
With that, it's important to separate presentation concerns with the important underlying data. If this is purely a presentation issue for the snippets around one module, I would actually recommend keeping those import statements and not use the hide function–that effectively removes the lines from the resulting JSON output. If someone comes to a page of docs via some circuitous path, then the snippet might not be all that usable without more context.
Perhaps what is needed here is a DocC rendering affordance to automatically fold import statement lines. Along with an automatically generated "here are all of the snippets" index page and copy/paste functionality, I think that would really round out snippets on the presentation side and still allow them to appear whole in other contexts too.
To add to Joe's tip, I should also mention the named slice functionality just in case others aren't already aware. These don't remove lines from the data but allow one to reference potentially many named, non-overlapping regions in the same snippet. Hiding should be reserved for things like license footers, test code, or unique demo setup code when running snippets inside a package–things that authors wouldn't want the user to take with them as a starting point.
// snippet.someid
// snippet.end
// snippet.someotherid
// snippet.end
That allows a reference to the slice with: @Snippet(path: "my-package/Snippets/Path/To/Snippet", slice: "someid")
Hopefully this doesn't make snippets grow too large!
Finally, I just want to thank you Joe and Gwendal for your thoughts. And I totally acknowledge that more complete documentation for the feature is needed. We'll get there!