Beautiful graphs in notebooks are great, but I want my explanatory text to look good too! Somehow I can't remember all the Markdown tags, so I created this cheatsheet.
Here's how to format Markdown cells in Jupyter notebooks in the IBM Data Science Experience.
Headings: Use #s followed by a blank space for notebook titles and section headings:
## major headings
#### 4th level subheadings
Emphasis: Use this code:
Mathematical symbols: Use this code:
$ mathematical symbols $
Monospace font: surround text with a back single quotation mark. (`) Use monospace for file path and file names and for text users enter or message text users see.
Line breaks: Sometimes markdown doesn’t make line breaks when you want them. Use this code for a manual line break:
Colors: Use this code:
Not all markdown code works within a font tag, so review your colored text carefully!
Indenting: Use a greater than sign (
>) and then a space, then type the text. Everything is indented until the next carriage return.
Bullets: Use the dash sign (
- ) with two spaces after it or a space, a dash, and a space (
- ), to create a circular bullet. To create a sub bullet, use a tab followed a dash and two spaces. You can also use an asterisk instead of a dash, and it works the same.
Numbered lists: Start with
1. followed by a space, then it starts numbering for you. Start each line with some number and a period, then a space. Tab to indent to get subnumbering.
Colored note boxes: Use one of these
div tags. Not all markdown code works within a
div tag, so review your colored boxes carefully!
<div class="alert alert-block alert-info">Tip: Use blue boxes for Tips and notes. If it’s a note, you don’t have to include the word “Note”.
<div class="alert alert-block alert-warning">Example: Use yellow boxes for examples that are not inside code cells, or use for mathematical formulas if needed.
<div class="alert alert-block alert-success">Up to you: Use green boxes sparingly, and only for some specific purpose that the other boxes can't cover. For example, if you have a lot of related content to link to, maybe you decide to use green boxes for related links from each section of a notebook.
<div class="alert alert-block alert-danger">Just don't: In general, just avoid the red boxes.
Graphics: You can use only graphics that are hosted on the web. You can't add captions for graphics at this time. Use this code:
<img src="url.gif" alt="Alt text that describes the graphic" title="Title text" />
Geometric shapes: Use this code with a decimal or hex reference number from here: UTF-8 Geometric shapes
Horizontal lines: Use three asterisks:
Internal links: To link to a section, you need to add an ID for it right above the section title. Use this code:
Make sure that the section_ID is unique within the notebook.
Use this code for the link and make sure to test all the links!
External links: Use this code and test all links!