I want to create a documentation site for a Kotlin library's (
https://github.com/fabmax/kool) JS platform output. I'm going to be using Docusaurus (a static site generator). I want to have documentation that shows the code running (it will be code that shows WebGL graphics so its appropriate for web output). This code will have an associated code block that shows the code in Kotlin and the code in Javascript (using built Javascript library). I want to have the code implementation actually working in both Kotlin/JS and Javascript. Then I want to have that code embedded in Docusaurus.
By the Kotlin/JS version and Javascript version I mean one version of the demo is written in Kotlin and compiled and the other is written in Javascript using the compiled Javascript library. It's an important distinction.
My question is how to approach this:
I will have to have a single platform (Javascript) Kotlin project that imports this library, and whose output is a series of demo usages of this library. Then I can either:
a) have a completely separate repo that I use with docusaurus. I import the built kotlin js library manually. The advantages of this approach are that I'm keeping the Kotlin and Javascript projects separate and reducing the complexity. Incremental building is difficult because I have to build one project then build the other. However, I could just do the Javascript version of the demos first with docusaurus and then go back in later and do all the Kotlin versions of the code.
b) I include the docusaurus project in the Kotlin project and create a gradle task that builds it when I like. Is this possible? Has anyone done anything like this? The advantages of this are that the build process is simplified and I have a single source of truth. In an ideal world, I could somehow include the output of the Kotlin/JS demos in docusaurus.