I am working on a library of mathematical functions. As part of the Scaladoc
, I would like to include the formula of each function. E.g.
/**
* Sum squared function:
* \(f(x) = \sum_i^n x_i^2\)
*/
def sumSquared[T](x: Seq[T]) = x.map(xi => xi * xi).sum
I am using MathJax to display the formula. It works if I manually edit the generated html to include the required MathJax javascript, but I want to automate this.
So far the only solutions I've found are:
- Is there a way to include math formulae in Scaladoc?
- How to run bash script after generating scaladoc using doc task?
If these are the only options then okay, however I'd like do this using only sbt (no external scripts). Is there a way to do this by maybe setting scalacOptions
as in How to ScalaDoc?