Skip to content

Instantly share code, notes, and snippets.

@ialexpovad
Last active June 29, 2021 08:55
Show Gist options
  • Save ialexpovad/4935ae679e7f7b265626f450499ddcff to your computer and use it in GitHub Desktop.
Save ialexpovad/4935ae679e7f7b265626f450499ddcff to your computer and use it in GitHub Desktop.
Markdown is a quick way to enter text with formatting, allowing you to write documents smoothly and at one stretch. For example, by typing #space, you can quickly enter a title.

Markdown you should know about:

Heading 1: # [space] or === or <h1>Heading 1</h1>

Heading 2: ## [space] or --- or <h1>Heading 2</h2> 

Heading 3: ### [space] or <h1>Heading 3</h3> 

Heading 4: #### [space] or <h1>Heading 4</h4> 
...

Phrase Emphasis

Italic:
*italic*        
_italic_       
<i> udd </i>   
<em> text </em>

Bold:
**bold** 
__bold__  
<strong> text </strong>
<b> text </b>

Strikethrough:
~~[text]~~
<del> text </del>
<s> test </s>

Underline:
<ins> text </ins>
<u> text </u>

Horizontal rules

--- or *** or - - -

Links

Inline:

An [example](http://url.com/ "Title")

Reference style lables (title are optional):

An [example][id]. Then, anywhere
else in the doc, define the link:
    [id]: http://example.com/ "Title"

Todos

Todo lists are much like normal lists, but will be rendered with checkboxes instead of bullets.

* [ ] This is an unchecked TODO item
* [x] This is a completed TODO item

Images

Inline (title is optional):

![alt text](/path/img.jpg "Title")

Refernce style:

![alt text][id]
    [id]: /url/to/img.jpg "Titke"

List

Ordered, without paragraphs:

1. Foo
2. Bar

Unordered, with paragraphs:

* A list item.
  With miltiple paragraphs.
* Bar

You can nest them:

*   An unordered list item
    * A nested unordered list item
*   Another list item
    1.  The first nested ordered list item
    2.  A second nested ordered list item
        * A nested unordered list
    3. This is the last nested ordered list item
*   The last unordered list item

Blockquotes

> Email-style angle brackets
> are used for blockquotes.
> > And, they can be nested.
> >
> * You can quote a list.
> * Etc.

Code spans

`<code>` spans are delimited
by backticks.
You can include literal backticks
like `` `this` ``.

Pre-formatted Code Blocks

Indent every line of a code block by at least 4 spaces or 1 tab, and use a colon at the end of the preceding paragraph.

This is a normal paragraph:

    This is a preformatted
    code block.

Preceded by a space, the colon disappears. :

This is a preformatted
code block.

Wrapping code in three back-ticks will also format code blocks :

```
Code goes here
```

Tables

|Column 1|Column 2|
|--------|--------|
|value 11|value 21|
|value 12|value 22|
|value 13|value 23|

Manual line breaks

End a line with two or more spaces:

Roses are red,••
Violets are blue.

Embed link

If your visualization is hosted on data.world (uploaded to a dataset), you may reference it directly in markdown.

@[vega-lite](https://data.world/example.vl.json)
@[vega](https://data.world/example.vg.json)

Inline code

If you want to embed your visualization direction within a summary or comment, use the following format.

```vega-lite
{
"$schema": "https://vega.github.io/schema/vega-lite/v2.json",
"description": "A simple bar chart with embedded data. An example vega-lite file.",
"width": 360,
"data": {
    "values": [
    {"a": "A","b": 28}, {"a": "B","b": 55}, {"a": "C","b": 43},
    {"a": "D","b": 91}, {"a": "E","b": 81}, {"a": "F","b": 53},
    {"a": "G","b": 19}, {"a": "H","b": 87}, {"a": "I","b": 52}
    ]
},
"mark": "bar",
"encoding": {
    "x": {"field": "a", "type": "ordinal"},
    "y": {"field": "b", "type": "quantitative"}
}
}
```

```swift
{
  /* ... raw vega definition ... */
}
```

Math formulas (MathJax)

When $a \ne 0$, there are two solutions to \\(ax^2 + bx + c = 0\    \) and they are
$$x = {-b \pm \sqrt{b^2-4ac} \over 2a}.$$
H~3~PO~4; Cu^2+^
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment