Hey! There's a
dokkaHtmlCollector task that does exactly what you want
However, we were't actually sure if people needed it and what for, and thought about getting rid of it at some point, but your case is an interesting one and we'll keep it in mind