You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Every page generated by Scaladoc (for package, class, object etc...) contains menu on the left, which contains link to every other page. As a result, Scaladoc output size grows quadratically with number of input files.
In case of scala 3 api documentation, with menu it weights ~730MB, without menu less than 200MB. Although this 0.5GB overhead may by acceptable in this case, it gets worse:
Recently tested on 10k+ classes (all rather simple): Scaladoc after about 38 minutes consumed over 140GB of disk space and crashed with java.io.IOException: No space left on device. Without menu it generates ~300MB.
I outline 2 proposed solutions below. They both could be hidden behind a flag, so they would be opt-in.
Solution not involving javascript - iframe
The menu could be generated once into a file, eg sidemenu.html. This file could be then included in iframe on every page.
To make the links inside iframe work, we would include <base target="_parent"> in sidemenu.html
Highlighting current item in menu could be done with a little bit of css and target at the end of iframe url.
This would probably look a little worse than 2nd solution.
Solution involving javascript
Serialize menu structure into a file, eg sidemenu.json, load it with JS and render. Links and highlighting work as before.
Since this would be opt-in, I'm leaning towards second solution.
The text was updated successfully, but these errors were encountered:
Closes#18543
This PR adds `-dynamic-side-menu` option to Scaladoc.
With this option Scaladoc doesn't generate side menu (packages etc.
tree) in html files. Instead it is serialized into .json file and
rendered on the client using Javascript.
Every page generated by Scaladoc (for package, class, object etc...) contains menu on the left, which contains link to every other page. As a result, Scaladoc output size grows quadratically with number of input files.
In case of scala 3 api documentation, with menu it weights ~730MB, without menu less than 200MB. Although this 0.5GB overhead may by acceptable in this case, it gets worse:
Recently tested on 10k+ classes (all rather simple): Scaladoc after about 38 minutes consumed over 140GB of disk space and crashed with
java.io.IOException: No space left on device
. Without menu it generates ~300MB.I outline 2 proposed solutions below. They both could be hidden behind a flag, so they would be opt-in.
Solution not involving javascript -
iframe
The menu could be generated once into a file, eg
sidemenu.html
. This file could be then included in iframe on every page.To make the links inside iframe work, we would include
<base target="_parent">
insidemenu.html
Highlighting current item in menu could be done with a little bit of css and target at the end of iframe url.
This would probably look a little worse than 2nd solution.
Solution involving javascript
Serialize menu structure into a file, eg
sidemenu.json
, load it with JS and render. Links and highlighting work as before.Since this would be opt-in, I'm leaning towards second solution.
The text was updated successfully, but these errors were encountered: