Skip to content

Instantly share code, notes, and snippets.

@genkuroki
Last active May 29, 2019 10:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save genkuroki/89466deb696fd09889f8d3aad296aef0 to your computer and use it in GitHub Desktop.
Save genkuroki/89466deb696fd09889f8d3aad296aef0 to your computer and use it in GitHub Desktop.
patches for WolframLanguageForJupyter-master/WolframLanguageForJupyter/Resources
--- KernelForWolframLanguageForJupyter-orig.wl 2019-05-25 07:56:45.000000000 +0900
+++ KernelForWolframLanguageForJupyter.wl 2019-05-29 15:03:02.746484500 +0900
@@ -83,7 +83,7 @@
(* provide the information *)
loopState["replyContent"] =
StringJoin[
- "{\"protocol_version\": \"5.3.0\",\"implementation\": \"WolframLanguageForJupyter\",\"implementation_version\": \"0.0.1\",\"language_info\": {\"name\": \"Wolfram Language\",\"version\": \"12.0\",\"mimetype\": \"application/vnd.wolfram.m\",\"file_extension\": \".m\",\"pygments_lexer\": \"python\",\"codemirror_mode\": \"python\"},\"banner\" : \"Wolfram Language/Wolfram Engine Copyright 2019",
+ "{\"protocol_version\": \"5.3.0\",\"implementation\": \"WolframLanguageForJupyter\",\"implementation_version\": \"0.0.1\",\"language_info\": {\"name\": \"Wolfram Language\",\"version\": \"12.0\",\"mimetype\": \"application/vnd.wolfram.m\",\"file_extension\": \".m\",\"pygments_lexer\": \"python\",\"codemirror_mode\": \"mathematica\"},\"banner\" : \"Wolfram Language/Wolfram Engine Copyright 2019",
bannerWarning,
"\"}"
];,
--- OutputHandlingUtilities-orig.wl 2019-05-25 07:56:45.000000000 +0900
+++ OutputHandlingUtilities.wl 2019-05-29 18:42:49.103741100 +0900
@@ -121,6 +121,16 @@
(* generate HTML for the textual form of a result *)
toOutText[result_] :=
+ Switch[JupyterOutTextForm,
+ "Plain",
+ StringJoin[{"&#", ToString[#1], ";"} & /@ ToCharacterCode[ToString[result], "Unicode"]],
+ "TeX",
+ StringJoin[
+ "$$",
+ StringJoin[{"&#", ToString[#1], ";"} & /@ ToCharacterCode[ToString[result], "Unicode"]],
+ "$$"
+ ],
+ _,
StringJoin[
(* preformatted *)
"<pre style=\"",
@@ -133,6 +143,7 @@
StringJoin[{"&#", ToString[#1], ";"} & /@ ToCharacterCode[ToString[result], "Unicode"]],
(* end the element *)
"</pre>"
+ ]
];
(* generate HTML for the rasterized form of a result *)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment