-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #120 from theam/mathjax-support
(25) Fixes #25
- Loading branch information
Showing
4 changed files
with
26 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
module Foreign.MathJax where | ||
|
||
typeset :: String -> IO () | ||
typeset _ = return () | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
module Foreign.MathJax where | ||
|
||
import GHCJS.Types | ||
import Data.JSString | ||
|
||
foreign import javascript unsafe "MathJax.Hub.Queue(['Typeset', MathJax.Hub, $1]);" | ||
js_typeset :: JSString -> IO () | ||
|
||
typeset :: String -> IO () | ||
typeset = js_typeset . pack | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a8e807f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just noticed that this functionality could have been added via
inliterate
, following this example:https://github.com/diffusionkinetics/open/blob/4838f1327678434e2e6c8732764b85bc17984251/plotlyhs/src/Graphics/Plotly/Blaze.hs