|
| 1 | +{ |
| 2 | + "cells": [ |
| 3 | + { |
| 4 | + "cell_type": "markdown", |
| 5 | + "metadata": { |
| 6 | + "id": "view-in-github" |
| 7 | + }, |
| 8 | + "source": [ |
| 9 | + "<a href=\"https://colab.research.google.com/github/davidcavazos/md2ipynb/blob/master/examples/notebooks/hello.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open in Colab\"/></a>" |
| 10 | + ] |
| 11 | + }, |
| 12 | + { |
| 13 | + "cell_type": "markdown", |
| 14 | + "metadata": { |
| 15 | + "id": "view-the-docs-top" |
| 16 | + }, |
| 17 | + "source": [ |
| 18 | + "<table align=\"left\"><td><a target=\"_blank\" href=\"https://github.com/davidcavazos/md2ipynb\"><img src=\"https://www.tensorflow.org/images/GitHub-Mark-32px.png\" width=\"32\" height=\"32\" />View the Docs</a></td></table>" |
| 19 | + ] |
| 20 | + }, |
| 21 | + { |
| 22 | + "cell_type": "code", |
| 23 | + "execution_count": null, |
| 24 | + "metadata": { |
| 25 | + "cellView": "form", |
| 26 | + "id": "_-code" |
| 27 | + }, |
| 28 | + "outputs": [], |
| 29 | + "source": [ |
| 30 | + "#@title Licensed under the Apache License, Version 2.0 (the \"License\")\n", |
| 31 | + "# Licensed under the Apache License, Version 2.0 (the \"License\");\n", |
| 32 | + "# you may not use this file except in compliance with the License.\n", |
| 33 | + "# You may obtain a copy of the License at\n", |
| 34 | + "#\n", |
| 35 | + "# http://www.apache.org/licenses/LICENSE-2.0\n", |
| 36 | + "#\n", |
| 37 | + "# Unless required by applicable law or agreed to in writing, software\n", |
| 38 | + "# distributed under the License is distributed on an \"AS IS\" BASIS,\n", |
| 39 | + "# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n", |
| 40 | + "# See the License for the specific language governing permissions and\n", |
| 41 | + "# limitations under the License." |
| 42 | + ] |
| 43 | + }, |
| 44 | + { |
| 45 | + "cell_type": "markdown", |
| 46 | + "metadata": { |
| 47 | + "id": "hello-world" |
| 48 | + }, |
| 49 | + "source": [ |
| 50 | + "# Hello World!\n", |
| 51 | + "\n", |
| 52 | + "This is a simple markdown page with GitHub code snippets.\n", |
| 53 | + "All this will be translated into a Jupyter notebook using the desired language." |
| 54 | + ] |
| 55 | + }, |
| 56 | + { |
| 57 | + "cell_type": "markdown", |
| 58 | + "metadata": { |
| 59 | + "id": "setup" |
| 60 | + }, |
| 61 | + "source": [ |
| 62 | + "## Setup\n", |
| 63 | + "\n", |
| 64 | + "Create a virtual environment.\n", |
| 65 | + "\n", |
| 66 | + "Install the `md2ipynb` package." |
| 67 | + ] |
| 68 | + }, |
| 69 | + { |
| 70 | + "cell_type": "markdown", |
| 71 | + "metadata": { |
| 72 | + "id": "example" |
| 73 | + }, |
| 74 | + "source": [ |
| 75 | + "## Example\n", |
| 76 | + "\n", |
| 77 | + "Here is a code sample:" |
| 78 | + ] |
| 79 | + }, |
| 80 | + { |
| 81 | + "cell_type": "code", |
| 82 | + "execution_count": null, |
| 83 | + "metadata": { |
| 84 | + "id": "example-code" |
| 85 | + }, |
| 86 | + "outputs": [], |
| 87 | + "source": [ |
| 88 | + "# Hello world in Python.\n", |
| 89 | + "print('Hello from Python!')" |
| 90 | + ] |
| 91 | + }, |
| 92 | + { |
| 93 | + "cell_type": "markdown", |
| 94 | + "metadata": { |
| 95 | + "id": "example-2" |
| 96 | + }, |
| 97 | + "source": [ |
| 98 | + "</p><table>\n", |
| 99 | + " <td>\n", |
| 100 | + " <a target=\"_blank\" class=\"button\" href=\"https://colab.research.google.com/github//davidcavazos/md2ipynb/blob/master/examples/notebooks/example.ipynb\">\n", |
| 101 | + " <img src=\"https://www.tensorflow.org/images/colab_logo_32px.png\" width=\"20px\" height=\"20px\"/>\n", |
| 102 | + " Run in Colab\n", |
| 103 | + " </a>\n", |
| 104 | + " </td>\n", |
| 105 | + " <td style=\"padding-left:1em\">\n", |
| 106 | + " <a target=\"_blank\" class=\"button\" href=\"https://github.com//davidcavazos/md2ipynb/blob/master/examples/code/hello-world.py\">\n", |
| 107 | + " <img src=\"https://www.tensorflow.org/images/GitHub-Mark-32px.png\" width=\"20px\" height=\"20px\"/>\n", |
| 108 | + " View on GitHub\n", |
| 109 | + " </a>\n", |
| 110 | + " </td>\n", |
| 111 | + "</table>\n", |
| 112 | + "<br/>\n", |
| 113 | + "\n", |
| 114 | + "You are all done!" |
| 115 | + ] |
| 116 | + }, |
| 117 | + { |
| 118 | + "cell_type": "markdown", |
| 119 | + "metadata": { |
| 120 | + "id": "html-section" |
| 121 | + }, |
| 122 | + "source": [ |
| 123 | + "## HTML Section\n", |
| 124 | + "\n", |
| 125 | + "<p>HTML is also supported since Markdown is a superset of HTML</p>" |
| 126 | + ] |
| 127 | + }, |
| 128 | + { |
| 129 | + "cell_type": "markdown", |
| 130 | + "metadata": { |
| 131 | + "id": "form-view" |
| 132 | + }, |
| 133 | + "source": [ |
| 134 | + "## Form view\n", |
| 135 | + "\n", |
| 136 | + "In \"form view\", a code cell's contents will be hidden by default in\n", |
| 137 | + "[Colab](https://colab.research.google.com).\n", |
| 138 | + "You can open and close the contents by double clicking it." |
| 139 | + ] |
| 140 | + }, |
| 141 | + { |
| 142 | + "cell_type": "code", |
| 143 | + "execution_count": null, |
| 144 | + "metadata": { |
| 145 | + "cellView": "form", |
| 146 | + "id": "form-view-code" |
| 147 | + }, |
| 148 | + "outputs": [], |
| 149 | + "source": [ |
| 150 | + "#@title A code cell containing `#@title`\n", |
| 151 | + "# Contents will be hidden in Colab" |
| 152 | + ] |
| 153 | + }, |
| 154 | + { |
| 155 | + "cell_type": "markdown", |
| 156 | + "metadata": { |
| 157 | + "id": "form-view-2" |
| 158 | + }, |
| 159 | + "source": [ |
| 160 | + "Or, a code cell containing `#@param`." |
| 161 | + ] |
| 162 | + }, |
| 163 | + { |
| 164 | + "cell_type": "code", |
| 165 | + "execution_count": null, |
| 166 | + "metadata": { |
| 167 | + "cellView": "form", |
| 168 | + "id": "form-view-code-2" |
| 169 | + }, |
| 170 | + "outputs": [], |
| 171 | + "source": [ |
| 172 | + "message = \"Hello!\" #@param {type:\"string\"}\n", |
| 173 | + "\n", |
| 174 | + "print(f\"message: {repr(message)}\")" |
| 175 | + ] |
| 176 | + }, |
| 177 | + { |
| 178 | + "cell_type": "markdown", |
| 179 | + "metadata": { |
| 180 | + "id": "clean-up" |
| 181 | + }, |
| 182 | + "source": [ |
| 183 | + "## Clean up\n", |
| 184 | + "\n", |
| 185 | + "You're all done 🎉🎉" |
| 186 | + ] |
| 187 | + }, |
| 188 | + { |
| 189 | + "cell_type": "markdown", |
| 190 | + "metadata": { |
| 191 | + "id": "what-s-next" |
| 192 | + }, |
| 193 | + "source": [ |
| 194 | + "## What's next\n", |
| 195 | + "\n", |
| 196 | + "Check the [README.md](https://github.com/davidcavazos/md2ipynb/blob/master/README.md) for more instructions." |
| 197 | + ] |
| 198 | + }, |
| 199 | + { |
| 200 | + "cell_type": "markdown", |
| 201 | + "metadata": { |
| 202 | + "id": "view-the-docs-bottom" |
| 203 | + }, |
| 204 | + "source": [ |
| 205 | + "<table align=\"left\"><td><a target=\"_blank\" href=\"https://github.com/davidcavazos/md2ipynb\"><img src=\"https://www.tensorflow.org/images/GitHub-Mark-32px.png\" width=\"32\" height=\"32\" />View the Docs</a></td></table>" |
| 206 | + ] |
| 207 | + } |
| 208 | + ], |
| 209 | + "metadata": { |
| 210 | + "colab": { |
| 211 | + "name": "Hello md2ipynb!", |
| 212 | + "toc_visible": true |
| 213 | + }, |
| 214 | + "kernelspec": { |
| 215 | + "display_name": "python3", |
| 216 | + "name": "python3" |
| 217 | + } |
| 218 | + }, |
| 219 | + "nbformat": 4, |
| 220 | + "nbformat_minor": 2 |
| 221 | +} |
0 commit comments