Another approach I use for what (I think?) you are describing here is to use a Ghost Blog/CMS for creating and hosting individual pages or posts where I want to display custom pages. Ghost is uniquely well suited for this purpose because of its flexibility for including and inserting all three (JS, CSS, and HTML) types of code on a per-page basis, and/or section/tag-specific and/or on a sitewide basis through “header code injections”, “footer code injections” and inline code/scripts inclusions right in the page/post editor.
Then you have multiple options in Discourse for how you want to embed or otherwise seamlessly include those external pages in your Discourse sites. You can then use RSS, embedded comments, Iframes, linked pages, or other methods.
I find this combination/pairing of Discourse and Ghost can provide an ideal platform for this particular use case where you need the flexibility of “on-the-fly” coding and arbitrary JavaScript injections.
Once I understood (both) the very opposite and very complementary natural strengths and limitations of each of these platforms (Ghost and Discourse) and how they can be combined and integrated, I have not found a better solution.
This way you can get the crazy-robust full content organization and community platform features of Discourse, along with the simplicity of Ghost’s on-the-fly approach to inline code editing and flexibility of including JS, CSS and HTML (and even Markdown) on individual pages.
A true bonus is that both platforms, both being open source and GitHub-based, have similarly robust, active, friendly and supportive communities where you can participate and get support and learn quickly and endlessly.