##// END OF EJS Templates
Add %%js alias for %%javascript
Jonathan Frederic -
Show More
@@ -25,24 +25,29 b' from IPython.core.magic import ('
25 @magics_class
25 @magics_class
26 class DisplayMagics(Magics):
26 class DisplayMagics(Magics):
27 """Magics for displaying various output types with literals
27 """Magics for displaying various output types with literals
28
28
29 Defines javascript/latex/svg/html cell magics for writing
29 Defines javascript/latex/svg/html cell magics for writing
30 blocks in those languages, to be rendered in the frontend.
30 blocks in those languages, to be rendered in the frontend.
31 """
31 """
32
32
33 @cell_magic
34 def js(self, line, cell):
35 """Run the cell block of Javascript code"""
36 self.javascript(line, cell)
37
33 @cell_magic
38 @cell_magic
34 def javascript(self, line, cell):
39 def javascript(self, line, cell):
35 """Run the cell block of Javascript code"""
40 """Run the cell block of Javascript code"""
36 display(Javascript(cell))
41 display(Javascript(cell))
37
42
38
43
39 @cell_magic
44 @cell_magic
40 def latex(self, line, cell):
45 def latex(self, line, cell):
41 """Render the cell as a block of latex
46 """Render the cell as a block of latex
42
47
43 The subset of latex which is support depends on the implementation in
48 The subset of latex which is support depends on the implementation in
44 the client. In the Jupyter Notebook, this magic only renders the subset
49 the client. In the Jupyter Notebook, this magic only renders the subset
45 of latex defined by MathJax
50 of latex defined by MathJax
46 [here](https://docs.mathjax.org/en/v2.5-latest/tex.html)."""
51 [here](https://docs.mathjax.org/en/v2.5-latest/tex.html)."""
47 display(Latex(cell))
52 display(Latex(cell))
48
53
General Comments 0
You need to be logged in to leave comments. Login now