{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# MIME Outputs\n", "\n", "You can put math and HTML into notebooks directly with markdown cells. BeakerX also has an API for generation and display of multimedia content." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "Latex('$\\\\alpha^2 + \\\\eta$')" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "HTML('

Hello, world!

')" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "new MIMEContainer('text/html', '

Hello World!

')" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "new MIMEContainer(MIMEContainer.MIME.TEXT_HTML, '

Hello World!

')" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "new MIMEContainer('text/latex', '$\\\\alpha^2 + \\\\eta$')" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "FileLinks(\"../groovy\")" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "FileLink(\"PlotFeatures.ipynb\")" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "Markdown(\"It's **very** easy to do **bold** and *italics*:\")" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "Math('F(k) = \\\\int_{-\\\\infty}^{\\\\infty} f(x) e^{2\\\\pi i k} dx')" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "IFrame('http://jupyter.org/', '100%', 400)" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "ScribdDocument(\"71048089\", '100%', 400)" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "\n", "VimeoVideo(\"139304565\",400,300)" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "YoutubeVideo(\"gSVvxOchT8Y\")" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "Video('https://archive.org/download/Sita_Sings_the_Blues/Sita_Sings_the_Blues_small.mp4')" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "SVG(\"https://dev.w3.org/SVG/tools/svgweb/samples/svg-files/car.svg\")" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "SVG(\"../resources/img/atom.svg\")" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "Image(\"https://doggydollars.com/wp-content/uploads/2016/02/DoggyDollars-Retriever-300x300.jpg\")" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "Image(\"../resources/img/widgetArch.png\")" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "import java.io.File;\n", "import com.google.common.io.ByteStreams;\n", "import com.google.common.io.Files;\n", "\n", "def imgFile = new File(\"../resources/img/widgetArch.png\");\n", "def bytes = Files.toByteArray(imgFile);\n", "Image(bytes)" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [] } ], "metadata": { "beakerx_kernel_parameters": {}, "kernelspec": { "display_name": "Groovy", "language": "groovy", "name": "groovy" }, "language_info": { "codemirror_mode": "groovy", "file_extension": ".groovy", "mimetype": "", "name": "Groovy", "nbconverter_exporter": "", "version": "2.4.3" } }, "nbformat": 4, "nbformat_minor": 2 }