|
| 1 | +{ |
| 2 | + "cells": [ |
| 3 | + { |
| 4 | + "cell_type": "markdown", |
| 5 | + "metadata": {}, |
| 6 | + "source": [ |
| 7 | + "# PyPRECIS Notebook Style Guide\n", |
| 8 | + "\n", |
| 9 | + "Thanks for showing the enthusiasm to help develop the PyPRECIS notebooks. Please use this style guide as a reference when creating or modifying content...\n", |
| 10 | + "\n", |
| 11 | + "## Worksheet Title\n", |
| 12 | + "\n", |
| 13 | + "All worksheets should start with a title formatted as a level 1 heading:\n", |
| 14 | + "\n", |
| 15 | + "```md\n", |
| 16 | + "# Worksheet ?: All Worksheets Should Have a Clear Title\n", |
| 17 | + "```\n", |
| 18 | + "\n", |
| 19 | + "Worksheet titles should be followed with a short description of the worksheet.\n", |
| 20 | + "\n", |
| 21 | + "## Learning Aims\n", |
| 22 | + "\n", |
| 23 | + "This followed by a list of 3 to 4 learning aims for the worksheet. We use the HTML `div class=\"alert alert-block alert-warning\"` to colour this is a nice way:\n", |
| 24 | + "\n", |
| 25 | + "```md\n", |
| 26 | + "<div class=\"alert alert-block alert-warning\">\n", |
| 27 | + "<b>By the end of this worksheet you should be able to:</b><br> \n", |
| 28 | + "- Identify and list the names of PRECIS output data in PP format using standard Linux commands.<br>\n", |
| 29 | + "- Use basic Iris commands to load data files, and view Iris cubes. <br>\n", |
| 30 | + "- Use Iris commands to remove the model rim, select data variables and save the output as NetCDF files.\n", |
| 31 | + "</div>\n", |
| 32 | + "```\n", |
| 33 | + "\n", |
| 34 | + "When rendered, it looks like this:\n", |
| 35 | + "\n", |
| 36 | + "<div class=\"alert alert-block alert-warning\">\n", |
| 37 | + "<b>By the end of this worksheet you should be able to:</b><br> \n", |
| 38 | + "- Identify and list the names of PRECIS output data in PP format using standard Linux commands.<br>\n", |
| 39 | + "- Use basic Iris commands to load data files, and view Iris cubes. <br>\n", |
| 40 | + "- Use Iris commands to remove the model rim, select data variables and save the output as NetCDF files.\n", |
| 41 | + "</div>\n", |
| 42 | + "\n", |
| 43 | + "Remember to start each learning aim with a verb. Keep them short and to the point. If you have more than 3 to 4 learning aims, consider whether there is too much content in the workbook.\n", |
| 44 | + "\n", |
| 45 | + "## Notes\n", |
| 46 | + "\n", |
| 47 | + "You may wish to use a Note box to draw the learners attention to particular actions or points to note. Note boxes are created using `div class=\"alert alert-block alert-info\"`\n", |
| 48 | + "\n", |
| 49 | + "```md\n", |
| 50 | + "<div class=\"alert alert-block alert-info\">\n", |
| 51 | + "<b>Note:</b> In the boxes where there is code or where you are asked to type code, click in the box, then press <kbd>Ctrl</kbd> + <kbd>Enter</kbd> to run the code. <br>\n", |
| 52 | + "<b>Note:</b> An percentage sign <code>%</code> is needed to run some commands on the shell. It is noted where this is needed.<br>\n", |
| 53 | + "<b>Note:</b> A hash <code>#</code> denotes a comment; anything written after this character does not affect the command being run. <br>\n", |
| 54 | + "</div>\n", |
| 55 | + "```\n", |
| 56 | + "\n", |
| 57 | + "Which looks like:\n", |
| 58 | + "\n", |
| 59 | + "<div class=\"alert alert-block alert-info\">\n", |
| 60 | + "<b>Note:</b> In the boxes where there is code or where you are asked to type code, click in the box, then press <kbd>Ctrl</kbd> + <kbd>Enter</kbd> to run the code. <br>\n", |
| 61 | + "<b>Note:</b> An percentage sign <code>%</code> is needed to run some commands on the shell. It is noted where this is needed.<br>\n", |
| 62 | + "<b>Note:</b> A hash <code>#</code> denotes a comment; anything written after this character does not affect the command being run. <br>\n", |
| 63 | + "</div>\n", |
| 64 | + "\n", |
| 65 | + "## Contents\n", |
| 66 | + "\n", |
| 67 | + "Immediately following the Learning Aims (or Note box if used) add a list of contents.\n", |
| 68 | + "\n", |
| 69 | + "```md\n", |
| 70 | + "## Contents\n", |
| 71 | + "### [1.1: Data locations and file names](#1.1) \n", |
| 72 | + "### ...additional headings\n", |
| 73 | + "```\n", |
| 74 | + "\n", |
| 75 | + "Items in the contents list are formatted as level 3 headings. Note the `[Link Name](Link location)` syntax. Each subsequent heading in the notebook needs to have a `id` tag associated with it for the links to work. These are formatted like this:\n", |
| 76 | + "\n", |
| 77 | + "```md\n", |
| 78 | + "<a id='1.1'></a>\n", |
| 79 | + "## 1.1 Data locations and file names\n", |
| 80 | + "```\n", |
| 81 | + "\n", |
| 82 | + "Remember that the `id` string must match the link location otherwise the link won't work. Remember to update both the link title numbering and the link id numbering if you are reordering content.\n", |
| 83 | + "\n", |
| 84 | + "## Section Headings\n", |
| 85 | + "\n", |
| 86 | + "To help users navigate round the document use section headings to break the content into sections. As detailed above, each section heading needs to have an `id` tag associated with it to build the Contents links.\n", |
| 87 | + "\n", |
| 88 | + "If you want to further subdivide each section, use bold letters with a parentheses:\n", |
| 89 | + "\n", |
| 90 | + "```md\n", |
| 91 | + "**a)** Ordinary section text continues...\n", |
| 92 | + "```\n", |
| 93 | + "\n", |
| 94 | + "## General Formatting\n", |
| 95 | + "\n", |
| 96 | + "Use links to point learners to additional learning resources. These follow the standard markdown style: `[Link text](Link location)`, eg.\n", |
| 97 | + "\n", |
| 98 | + "```md\n", |
| 99 | + "[Iris](http://scitools.org.uk/iris/docs/latest/index.html)\n", |
| 100 | + "```\n", |
| 101 | + "\n", |
| 102 | + "gives\n", |
| 103 | + "\n", |
| 104 | + "[Iris](http://scitools.org.uk/iris/docs/latest/index.html)\n", |
| 105 | + "\n", |
| 106 | + "Format key commands using bold back-ticks: \n", |
| 107 | + "\n", |
| 108 | + "```md\n", |
| 109 | + "**`cd`**\n", |
| 110 | + "```\n", |
| 111 | + "\n", |
| 112 | + "Where certain keyboard combinations are necessary to execute commands, use the `<kbd>` html formatting.\n", |
| 113 | + "\n", |
| 114 | + "\n", |
| 115 | + "```md\n", |
| 116 | + "<kbd>Ctrl</kbd> + <kbd>Enter</kbd>\n", |
| 117 | + "```\n", |
| 118 | + "\n", |
| 119 | + "which gives:\n", |
| 120 | + "\n", |
| 121 | + "<kbd>Ctrl</kbd> + <kbd>Enter</kbd>\n", |
| 122 | + "\n", |
| 123 | + "Code blocks are entered in new notebook cells, with the `Code` style. Remember, all python should be **Python 3**." |
| 124 | + ] |
| 125 | + }, |
| 126 | + { |
| 127 | + "cell_type": "code", |
| 128 | + "execution_count": 1, |
| 129 | + "metadata": {}, |
| 130 | + "outputs": [], |
| 131 | + "source": [ |
| 132 | + "# This is a code block\n", |
| 133 | + "# Make sure you include comments with your code to help explain what you are doing\n", |
| 134 | + "\n", |
| 135 | + "# Leave space if you want learners to complete portions of code\n", |
| 136 | + "\n" |
| 137 | + ] |
| 138 | + }, |
| 139 | + { |
| 140 | + "cell_type": "markdown", |
| 141 | + "metadata": {}, |
| 142 | + "source": [ |
| 143 | + "<div class=\"alert alert-block alert-info\">\n", |
| 144 | + "<b>Note:</b> Remember you can use additional Note blocks at any time to highlight important points!\n", |
| 145 | + "</div>\n", |
| 146 | + "\n", |
| 147 | + "If you want to add pictures, place image files in the `/notebooks/img` folder. Use html image formatting tags to control the position of the image in the rendered notebook cell:\n", |
| 148 | + "\n", |
| 149 | + "```md\n", |
| 150 | + "<p><img src=\"notebooks/img/python_and_iris.png\" alt=\"python + iris logo\" style=\"float: center; height: 100px;\"/></p>\n", |
| 151 | + "```\n", |
| 152 | + "\n", |
| 153 | + "gives\n", |
| 154 | + "\n", |
| 155 | + "<p><img src=\"notebooks/img/python_and_iris.png\" alt=\"python + iris logo\" style=\"float: center; height: 100px;\"/></p>\n", |
| 156 | + "\n", |
| 157 | + "Images can also be places in Note and Question blocks in the same manner. See Worksheet 1 for an example.\n", |
| 158 | + "\n", |
| 159 | + "## Questions\n", |
| 160 | + "\n", |
| 161 | + "Asking questions is a key part of the learning process. Questions blocks use the `div class=\"alert alert-block alert-success\"` style, and should be visually separated from the main text using horizontal rules above and below the question section:\n", |
| 162 | + "\n", |
| 163 | + "```md\n", |
| 164 | + "---\n", |
| 165 | + "<div class=\"alert alert-block alert-success\">\n", |
| 166 | + "<b>Question:</b> How many pp files are in this directory, in total?\n", |
| 167 | + "<br>How many of these pp files contain the string 'sep'; relating to September? What command do you need to use to find this out?\n", |
| 168 | + "</div>\n", |
| 169 | + "\n", |
| 170 | + "<b>Answer</b>: \n", |
| 171 | + "<br>*Total number of pp files: \n", |
| 172 | + "<br>Number of September pp files:\n", |
| 173 | + "<br>Command used to find number of september pp files:*\n", |
| 174 | + "\n", |
| 175 | + "---\n", |
| 176 | + "```\n", |
| 177 | + "\n", |
| 178 | + "This renders as:\n", |
| 179 | + "\n", |
| 180 | + "---\n", |
| 181 | + "<div class=\"alert alert-block alert-success\">\n", |
| 182 | + "<b>Question:</b> How many pp files are in this directory, in total?\n", |
| 183 | + "<br>How many of these pp files contain the string 'sep'; relating to September? What command do you need to use to find this out?\n", |
| 184 | + "</div>\n", |
| 185 | + "\n", |
| 186 | + "<b>Answer</b>: \n", |
| 187 | + "<br>*Total number of pp files: \n", |
| 188 | + "<br>Number of September pp files:\n", |
| 189 | + "<br>Command used to find number of september pp files:*\n", |
| 190 | + "\n", |
| 191 | + "---\n", |
| 192 | + "\n", |
| 193 | + "Make sure to put your _answer_ section in a different notebook cell from the _question_ section to avoid learners accidently editing the question blocks. Questions may also include code blocks. Remember to use a horizonal rule `---` to show where the question section starts and stops.\n", |
| 194 | + "\n", |
| 195 | + "## Worksheet footer\n", |
| 196 | + "\n", |
| 197 | + "At the end of the worksheet, summarise the content using a `div class=\"alert alert-block alert-warning\"`\n", |
| 198 | + "\n", |
| 199 | + "```md\n", |
| 200 | + "<center>\n", |
| 201 | + "<div class=\"alert alert-block alert-warning\">\n", |
| 202 | + "<b>This completes worksheet 1.</b> <br>You have created pre-processed files (rim removed, individual variables, concenated over time, in NetCDF format). <br>\n", |
| 203 | + "In worksheet 2, you will begin to analyse these files.\n", |
| 204 | + "</div>\n", |
| 205 | + "</center>\n", |
| 206 | + "```\n", |
| 207 | + "\n", |
| 208 | + "<center>\n", |
| 209 | + "<div class=\"alert alert-block alert-warning\">\n", |
| 210 | + "<b>This completes worksheet 1.</b> <br>You have created pre-processed files (rim removed, individual variables, concenated over time, in NetCDF format). <br>\n", |
| 211 | + "In worksheet 2, you will begin to analyse these files.\n", |
| 212 | + "</div>\n", |
| 213 | + "</center>\n", |
| 214 | + "\n", |
| 215 | + "Finally, a copyright statement and the Met Office logo should be added to all notebooks:\n", |
| 216 | + "\n", |
| 217 | + "```md\n", |
| 218 | + "<p><img src=\"img/MO_MASTER_black_mono_for_light_backg_RBG.png\" alt=\"python + iris logo\" style=\"float: center; height: 100px;\"/></p>\n", |
| 219 | + "<center>© Crown Copyright 2019, Met Office</center>\n", |
| 220 | + "```" |
| 221 | + ] |
| 222 | + }, |
| 223 | + { |
| 224 | + "cell_type": "markdown", |
| 225 | + "metadata": {}, |
| 226 | + "source": [ |
| 227 | + "<p><img src=\"notebooks/img/MO_MASTER_black_mono_for_light_backg_RBG.png\" alt=\"Met Office logo\" style=\"float: center; height: 100px;\"/></p>\n", |
| 228 | + "<center>© Crown Copyright 2019, Met Office</center>" |
| 229 | + ] |
| 230 | + } |
| 231 | + ], |
| 232 | + "metadata": { |
| 233 | + "kernelspec": { |
| 234 | + "display_name": "Python 3", |
| 235 | + "language": "python", |
| 236 | + "name": "python3" |
| 237 | + }, |
| 238 | + "language_info": { |
| 239 | + "codemirror_mode": { |
| 240 | + "name": "ipython", |
| 241 | + "version": 3 |
| 242 | + }, |
| 243 | + "file_extension": ".py", |
| 244 | + "mimetype": "text/x-python", |
| 245 | + "name": "python", |
| 246 | + "nbconvert_exporter": "python", |
| 247 | + "pygments_lexer": "ipython3", |
| 248 | + "version": "3.6.8" |
| 249 | + } |
| 250 | + }, |
| 251 | + "nbformat": 4, |
| 252 | + "nbformat_minor": 2 |
| 253 | +} |
0 commit comments