[Haskell-cafe] Haddock - How to write formulas ?
Michael Orlitzky
michael at orlitzky.com
Wed Jan 8 22:28:04 UTC 2014
On 01/08/2014 12:23 PM, Ben Foppa wrote:
> I tend to opt for writing plaintext LaTeX, and if the reader wants it to
> be pretty, they can use TeX the World (although it looks like this is
> now unmaintained and only viable in chrome).
The Sage project[1] has to solve a similar problem with its python
reference documentation for various mathy things. These days MathJax is
used, but in my opinion the previous solution was better. While the HTML
documentation was being generated from RST, various magics were employed
to convert the embedded formulas to PNGs which were then inserted
directly into the markup. Haddock could probably be convinced to do the
same.
The downside to images is that they don't scale, but they do have the
alt attribute as a plain-text fallback. The problem with MathJax is that
it takes forever to load and slows the browser to a crawl -- especially
annoying when you know what you're looking for and can't scroll to it
because the document keeps jumping around as formulas load for 30
seconds. Images load instantly and look good enough.
[1] http://sagemath.org/
More information about the Haskell-Cafe
mailing list