What you are looking for is a custom Doclet
implementation, which can be used through the -doc-generator
command-line option to scaladoc
. I can't answer whether or not a pre-existing Doclet
implementation will address your needs, but one promising implementation to explore is Extradoc. However, it hasn't been updated in some time.
At a lower level you can implement your own by subclassing Doclet
and associated APIs (e.g. HTMLFactory
, and Template
). There don't seem to be any/many examples out there of how to do this beyond Extradoc1. Unfortunately it looks like ScalaDoc hasn't gotten the same level of attention as JavaDoc in this area. Per these release notes, 2.12 has an improved ScalaDoc interface, but I don't think it changes the dependency on JavaScript.
I also came across Nyandoc, which converts ScalaDoc and JavaDoc to Markdown. Perhaps as an immediate format it could get you closer to your goal.
All that said, is using the JavaFX WebView
component an option? It has a full fledged WebKit browser and JS engine behind it, and it's possible to embed JavaFX components in Swing.