EntropyOrg / p5-Devel-IPerl

:microscope::books: Perl5 language kernel for Jupyter <http://jupyter.org/>
http://p3rl.org/Devel::IPerl
93 stars 15 forks source link

What is the equivalent of %%html and %%javascript when using the perl kernel? #94

Open adamcrussell opened 5 years ago

adamcrussell commented 5 years ago

If you use Jupyter with a Python kernel you can use aliases such as %%html and %%javascript. For example:

%%html
<div id="d3-example"></div>
<style>
.node {stroke: #fff; stroke-width: 1.5px;}
.link {stroke: #999; stroke-opacity: .6;}
</style>

will create a new div which could be populated by some d3.js code

%%javascript
 var svg = d3.select("#d3-example").select("svg")
 if (svg.empty()) {
svg = d3.select("#d3-example").append("svg")
      .attr("width", width)
      .attr("height", height);
}

Is there some equivalent syntax for this when using the Perl kernel?

Edit:

Apparently these are called "magics" https://ipython.readthedocs.io/en/stable/interactive/magics.html perhaps my question should then be, more broadly, is there any support for magics with the Perl kernel?