{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Prerequisite" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "the tsumiki cell magic extension can be loaded via:" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "%load_ext tsumiki" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Usage with notebook." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Write with markdown." ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", " \n", "

Title1

\n", "

Title2

\n", "

Title3

\n", "\n", "
" ], "text/plain": [ "" ] }, "execution_count": 2, "metadata": {}, "output_type": "execute_result" } ], "source": [ "%%tsumiki\n", "\n", ":Markdown:\n", "\n", "# Title1\n", "## Title2\n", "### Title3\n", "\n", "- list1 \n", "- list2\n", "- [ ] foo\n", "- [x] bar" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Write with HTML" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", " \n", "Red\n", "
\n", "Green\n", "
" ], "text/plain": [ "" ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "%%tsumiki\n", "\n", ":HTML:\n", "Red\n", "
\n", "Green" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Multiple columns\n", "\n", "Specify `:` as the number of columns." ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", " \n", "
\n", " \n", "
\n", "
    \n", "
  • left1
  • \n", "
  • left2
  • \n", "
\n", "
\n", " \n", "
\n", "
    \n", "
  • right1
  • \n", "
  • right2
  • \n", "
\n", "
\n", " \n", "
\n", "
" ], "text/plain": [ "" ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "%%tsumiki\n", "\n", ":Markdown::\n", "* left1\n", "* left2\n", "\n", ":Markdown::\n", "* right1\n", "* right2" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Write with mixed markup langueges." ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", " \n", "

Title

\n", "\n", "
\n", " \n", "
\n", "

col0

\n", "Red\n", "
\n", "Green\n", "
\n", " \n", "
\n", "

col1
\n", " list1
\n", "
list2

\n", "
\n", " \n", "
\n", "

col2
\n", " list1
\n", "
list2

\n", "
\n", " \n", "
\n", "
" ], "text/plain": [ "" ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "%%tsumiki\n", "\n", ":Markdown:\n", "# Title\n", "\n", ":HTML:::\n", "

col0

\n", "Red\n", "
\n", "Green\n", "\n", ":Markdown:::\n", "col1\n", "* list1\n", "* list2\n", "\n", ":Markdown:::\n", "col2\n", "* list1\n", "* list2" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Usage with Python." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "import module" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [], "source": [ "import tsumiki" ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [], "source": [ "text = \"\"\"\n", ":Markdown:\n", "# Title\n", "* list1\n", "* list2\n", "\"\"\"" ] }, { "cell_type": "code", "execution_count": 8, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "
\n", " \n", "

Title

\n", "
    \n", "
  • list1
  • \n", "
  • list2
  • \n", "
\n", "
\n" ] } ], "source": [ "print(tsumiki.Tsumiki(text).html)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "hide_input": false, "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "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.6.6" } }, "nbformat": 4, "nbformat_minor": 2 }