commit 3a3586aff602cf49a8545ffb4ce760e78c3718db
parent 65d6e0e7a8121d3e378f44d56de7fb55224e47b4
Author: Shimmy Xu <shimmy.xu@shimmy1996.com>
Date: Tue, 26 Feb 2019 16:53:59 -0500
Add kernelspec for plain python src blocks.
Diffstat:
M | README.org | | | 47 | +++++++++++++++++++++++++++++++++++++++++++++++ |
1 file changed, 47 insertions(+), 0 deletions(-)
diff --git a/README.org b/README.org
@@ -981,6 +981,53 @@ Export backend for =.ipynb=. Package is not in MELPA yet, so using local copy. R
:load-path "local/ox-ipynb/")
#+END_SRC
+Quick and easy hack to get python source blocks to work.
+#+BEGIN_SRC emacs-lisp
+ (setq ox-ipynb-kernelspecs
+ '((ipython . (kernelspec . ((display_name . "Python 3")
+ (language . "python")
+ (name . "python3"))))
+ (python . (kernelspec . ((display_name . "Python 3")
+ (language . "python")
+ (name . "python3"))))
+ (R . (kernelspec . ((display_name . "R")
+ (language . "R")
+ (name . "ir"))))
+ (julia . (kernelspec . ((display_name . "Julia 0.6.0")
+ (language . "julia")
+ (name . "julia-0.6"))))))
+
+ (setq ox-ipynb-language-infos
+ '((ipython . (language_info . ((codemirror_mode . ((name . ipython)
+ (version . 3)))
+ (file_extension . ".py")
+ (mimetype . "text/x-python")
+ (name . "python")
+ (nbconvert_exporter . "python")
+ (pygments_lexer . "ipython3")
+ (version . "3.5.2"))))
+ (python . (language_info . ((codemirror_mode . ((name . ipython)
+ (version . 3)))
+ (file_extension . ".py")
+ (mimetype . "text/x-python")
+ (name . "python")
+ (nbconvert_exporter . "python")
+ (pygments_lexer . "ipython3")
+ (version . "3.5.2"))))
+ (R . (language_info . ((codemirror_mode . "r")
+ (file_extension . ".r")
+ (mimetype . "text/x-r-source")
+ (name . "R")
+ (pygments_lexer . "r")
+ (version . "3.3.2"))))
+ (julia . (language_info . ((codemirror_mode . "julia")
+ (file_extension . ".jl")
+ (mimetype . "text/x-julia")
+ (name . "julia")
+ (pygments_lexer . "julia")
+ (version . "0.6.0"))))))
+#+END_SRC
+
*** LaTeX Macros
Support LaTeX macros in both LaTeX and HTML/MathJax export. We do this by adding
a dummy language to Babel. Idea comes form [[https://www.reddit.com/r/orgmode/comments/7u2n0h/tip_for_defining_latex_macros_for_use_in_both/][here]].