-
Notifications
You must be signed in to change notification settings - Fork 237
Proposal for Mathjax #397
Proposal for Mathjax #397
Conversation
The one concern I have is how the rendering will look when the viewer doesn't have in working Internet or if the cdn url changes. But maybe those are none issues |
I have the following concerns:
|
@cartazio it will look like this so not too disastrous. |
@bkaes very interesting - I am clearly a TeX dinosaur ;-) No more |
@idontgetoutmuch one could make the matjhax js url (optionally) configurable via a CLI option, that way ppl who need it could build local haddock docs which don't require internet access... |
I do think that is pretty disastrous if you don't have a working internet connection, but I like the idea of being able to bundle in a local Mathjax source. |
Ok so my proposal is this: we use (...) for inline, [...] for display and allow the mathjax url to be configured via a CLI option. I will try and finish this off next weekend. For info I am adding a link to the reddit comments: http://www.reddit.com/r/haskell/comments/366fgo/proposal_for_mathjax_pr_haskellhaddock397/ But please don't let me stop anyone else finishing this off :-) |
@idontgetoutmuch Do you mean |
@bkaes yes I didn't realise that github wanted me to escape \ |
Do we need two different syntax constructs for this? Can't it work like EDIT: I don't have time to look at anything in any detail for ~week, FTR. |
I think using latex / mathjax syntax makes it easier for authors. I think most people would write the mathematics in another document e.g. a tex file and would want to cut and paste without having to re-format. Here's an example of what I mean. I can take this out of an existing document and put it straight into the proposed haddock (with each line being prefixed by "-- "). Ok I'd have to reformat the bold font but apart from that my job as an author is pretty straightforward. I think there is also a benefit to sticking to an existing convention rather than inventing our own.
|
You can now say
I can add a section to the haddock documentation itself if everyone is happy with this PR. |
Left a few comments. You should aim to squash some of the spurious commits you have as they serve no purpose on their own and save git tree clutter. |
Thanks.
|
Been looking at this so it may potentially go into 2.16.1. You don't seem to have updated the Branch also needs cleaning a bit (don't really need 5 fixup commits) and rebasing on master (1 new test added since that needs updating). I did these things to a basic degree at https://github.com/Fuuzetsu/haddock/tree/mathjax-merge if you want a reference. |
I have some time today so I will try my best. |
Ok I have squashed the commits but the required instances in The only DrIFT directive I can find is
so it's not clear to me what I should do to generate Binary instances for Weirdly I can see a Binary instance for DocOption but it doesn't appear to have been generated by DrIFT. Presumably we should get rid of any mention of DrIFT as I don't think it is actually used. I can add the instances by hand or we could use |
Change notation and add support for inline math. Allow newlines in display math. Add a command line option for the mathjax url (you might want to use a locally installed version). Rebase tests because of extra url and version change. Respond to (some of the) comments. Fix warnings in InterfaceFile.hs
Just pointing out that this PR has not been forgotten nor is being rejected. I am delaying it due to interface file changes required are an ugly update. But it only adds to the end of the structure (rather than changing existing types) so maybe it won't be too bad. I may include it in the next release which I hope comes fairly soon, including changes from GSOC. You can ignore the DrIFT comment as you did, I think it's just a very old mechanism that generated instances for you. Should just remove the comment. |
Thanks for keeping me updated. I removed the reference to DrIFT already I think. |
That's great. We're keeping this PR on hold due to interface change, I want to see if I can't bundle some other similar changes with it instead of breaking things twice. So it may be a bit still before I merge and release it. |
@Fuuzetsu any news on this? Will you make a release coincide with gcc 8? That would be in January I think? |
@idontgetoutmuch I don't mind merging this for GHC 8.0. Perhaps you could rebase on my ghc-head branch? |
Ok I'll try my best - my git skills are not great. @bgamari: Done. The build fails because it seems to be looking for haddock-api-2.16.2 but I am guessing this only exists for ghc 8 which the build system does not use? |
Very excited, will begin using the feature as soon as it is released! |
This has been merged in #465! |
Consider this a proposal for how we support math in haddock. I've only done inline math so far but display math shouldn't be much harder. See #382 for more discussion.