1 | ## Markdown Basics
|
2 |
|
3 | [Markdown](https://en.wikipedia.org/wiki/Markdown) was originally conceived as an easier way to write prose and technical material for online presentation. Smartdown embraces and extends that philosophy, best expressed by the original mind behind Markdown, [John Gruber](https://daringfireball.net/projects/markdown/syntax#philosophy):
|
4 |
|
5 | > ### Philosophy
|
6 |
|
7 | > Markdown is intended to be as easy-to-read and easy-to-write as is feasible.
|
8 |
|
9 | > Readability, however, is emphasized above all else. A Markdown-formatted
|
10 | document should be publishable as-is, as plain text, without looking like it's
|
11 | been marked up with tags or formatting instructions. While Markdown's syntax
|
12 | has been influenced by several existing text-to-HTML filters -- including
|
13 | [Setext] [1], [atx] [2], [Textile] [3], [reStructuredText] [4], [Grutatext]
|
14 | [5], and [EtText] [6] -- the single biggest source of inspiration for
|
15 | Markdown's syntax is the format of plain text email.
|
16 | >
|
17 | >To this end, Markdown's syntax is comprised entirely of punctuation
|
18 | characters, which punctuation characters have been carefully chosen so
|
19 | as to look like what they mean. E.g., asterisks around a word actually
|
20 | look like \*emphasis\*. Markdown lists look like, well, lists. Even
|
21 | blockquotes look like quoted passages of text, assuming you've ever
|
22 | used email.
|
23 | [1]: http://docutils.sourceforge.net/mirror/setext.html
|
24 | [2]: http://www.aaronsw.com/2002/atx/
|
25 | [3]: http://textism.com/tools/textile/
|
26 | [4]: http://docutils.sourceforge.net/rst.html
|
27 | [5]: http://www.triptico.com/software/grutatxt.html
|
28 | [6]: http://ettext.taint.org/doc/
|
29 |
|
30 |
|
31 | ### Markdown is worth learning
|
32 |
|
33 | Although there are several variants and extensions of Markdown, the ubiquity of the core Markdown syntax makes it a worthwhile and minimal investment to learn. Smartdown is based primarily upon GitHub-flavored Markdown, which is supported widely on GitHub, and also by many other Markdown tools and sites.
|
34 |
|
35 | Some resources that may help:
|
36 |
|
37 | - [John Gruber's Markdown from 2004](https://daringfireball.net/projects/markdown/)
|
38 | - [GitHub's *Mastering Markdown*](https://guides.github.com/features/mastering-markdown/)
|
39 | - [A Formal Spec for GitHub Markdown](https://githubengineering.com/a-formal-spec-for-github-markdown/)
|
40 | - [GitHub-flavored Markdown Spec](https://github.github.com/gfm/)
|
41 |
|
42 |
|
43 | ### How is Smartdown Different?
|
44 |
|
45 | Smartdown *is* Markdown, and any Markdown document can be viewed within a Smartdown-enabled viewer. A Smartdown-enabled viewer is able to interpret certain valid Markdown constructs in a way that enables the document to be more interactive than as a static Markdown document. Smartdown takes advantage of two features of Markdown, and extends their interpretation to enable Smartdown's interactivity. Specifically, Smartdown uses Markdown's *link* syntax to embed input, output and calculation*cells* into a document, and uses Markdown's *code block* syntax to embed more complex content as *playables*.
|
46 |
|
47 | ## Markdown Examples
|
48 |
|
49 | In each of the examples below, the Markdown source will be shown, followed by its rendered appearance.
|
50 |
|
51 | ### Headers
|
52 |
|
53 | ```markdown
|
54 | # This is a level 1 header
|
55 | ## This is a level 2 header
|
56 | ### This is a level 3 header
|
57 | #### This is a level 4 header
|
58 | ##### This is a level 5 header
|
59 | ###### This is a level 6 header
|
60 | ```
|
61 |
|
62 |
|
63 | # This is a level 1 header
|
64 | ## This is a level 2 header
|
65 | ### This is a level 3 header
|
66 | #### This is a level 4 header
|
67 | ##### This is a level 5 header
|
68 | ###### This is a level 6 header
|
69 |
|
70 |
|
71 |
|
72 | ### Styles
|
73 |
|
74 | ```markdown
|
75 | *This text will be italic*
|
76 | _This will also be italic_
|
77 |
|
78 | **This text will be bold**
|
79 | __This will also be bold__
|
80 |
|
81 | ~~This text will be strikethru~~
|
82 |
|
83 | _You **can** combine styles_
|
84 | ```
|
85 |
|
86 |
|
87 | *This text will be italic*
|
88 | _This will also be italic_
|
89 |
|
90 | **This text will be bold**
|
91 | __This will also be bold__
|
92 |
|
93 | ~~This text will be strikethru~~
|
94 |
|
95 | _You **can** combine styles ~~easily~~_
|
96 |
|
97 |
|
98 | ### Lists
|
99 |
|
100 | ```markdown
|
101 | - Item 1
|
102 | - Item 2
|
103 | - Item 2a
|
104 | - Item 2b
|
105 |
|
106 | * Item 1
|
107 | * Item 2
|
108 | * Item 2a
|
109 | * Item 2b
|
110 |
|
111 | 1. Item 1
|
112 | 1. Item 2
|
113 | 1. Item 3
|
114 | 1. Item 3a
|
115 | 1. Item 3b
|
116 | ```
|
117 |
|
118 | - Item 1
|
119 | - Item 2
|
120 | - Item 2a
|
121 | - Item 2b
|
122 |
|
123 | * Item 1
|
124 | * Item 2
|
125 | * Item 2a
|
126 | * Item 2b
|
127 |
|
128 | 1. Item 1
|
129 | 1. Item 2
|
130 | 1. Item 3
|
131 | 1. Item 3a
|
132 | 1. Item 3b
|
133 |
|
134 |
|
135 | ### Syntax Highlighting
|
136 |
|
137 | ````markdown
|
138 | Inline: `const a = b + "foo"; // comment`
|
139 | Block:
|
140 | ```python
|
141 | print("Python is sort of a programming language")
|
142 | print("LOL, just kidding.")
|
143 | ```
|
144 | ````
|
145 |
|
146 | Inline: `const a = b + "foo"; // comment`
|
147 | Block:
|
148 | ```python
|
149 | print("Python is sort of a programming language")
|
150 | print("LOL, just kidding.")
|
151 | ```
|
152 |
|
153 | ### Blockquotes
|
154 |
|
155 | ```markdown
|
156 | > **The Road Not Taken**
|
157 |
|
158 | > Two roads diverged in a yellow wood,
|
159 | And sorry I could not travel both
|
160 | And be one traveler, long I stood
|
161 | And looked down one as far as I could
|
162 | To where it bent in the undergrowth;
|
163 |
|
164 | > Then took the other, as just as fair,
|
165 | And having perhaps the better claim,
|
166 | Because it was grassy and wanted wear;
|
167 | Though as for that the passing there
|
168 | Had worn them really about the same,
|
169 |
|
170 | > And both that morning equally lay
|
171 | In leaves no step had trodden black.
|
172 | Oh, I kept the first for another day!
|
173 | Yet knowing how way leads on to way,
|
174 | I doubted if I should ever come back.
|
175 |
|
176 | > I shall be telling this with a sigh
|
177 | Somewhere ages and ages hence:
|
178 | Two roads diverged in a wood, and I—
|
179 | I took the one less traveled by,
|
180 | And that has made all the difference.
|
181 |
|
182 | > **Robert Frost**
|
183 | ```
|
184 |
|
185 |
|
186 | > **The Road Not Taken**
|
187 |
|
188 | > Two roads diverged in a yellow wood,
|
189 | And sorry I could not travel both
|
190 | And be one traveler, long I stood
|
191 | And looked down one as far as I could
|
192 | To where it bent in the undergrowth;
|
193 |
|
194 | > Then took the other, as just as fair,
|
195 | And having perhaps the better claim,
|
196 | Because it was grassy and wanted wear;
|
197 | Though as for that the passing there
|
198 | Had worn them really about the same,
|
199 |
|
200 | > And both that morning equally lay
|
201 | In leaves no step had trodden black.
|
202 | Oh, I kept the first for another day!
|
203 | Yet knowing how way leads on to way,
|
204 | I doubted if I should ever come back.
|
205 |
|
206 | > I shall be telling this with a sigh
|
207 | Somewhere ages and ages hence:
|
208 | Two roads diverged in a wood, and I—
|
209 | I took the one less traveled by,
|
210 | And that has made all the difference.
|
211 |
|
212 | > **Robert Frost**
|
213 |
|
214 |
|
215 | ### Links
|
216 |
|
217 | ```markdown
|
218 | - https://en.wikipedia.org/wiki/Raven
|
219 | - [Markdown Philosophy](https://daringfireball.net/projects/markdown/syntax#philosophy)
|
220 | - ![Picture of Raven](https://upload.wikimedia.org/wikipedia/commons/thumb/d/df/Natural_History%2C_Birds_-_Raven.jpg/570px-Natural_History%2C_Birds_-_Raven.jpg)
|
221 | - ![](https://media.poetryfoundation.org/uploads/media/default/0001/08/22208df9f0df9b4e6d3e267b60d17d43f20252f3.mp3)
|
222 | ```
|
223 |
|
224 | - https://en.wikipedia.org/wiki/Raven
|
225 | - [Markdown Philosophy](https://daringfireball.net/projects/markdown/syntax#philosophy)
|
226 | - ![Picture of Raven](https://upload.wikimedia.org/wikipedia/commons/thumb/d/df/Natural_History%2C_Birds_-_Raven.jpg/570px-Natural_History%2C_Birds_-_Raven.jpg)
|
227 | - ![](https://media.poetryfoundation.org/uploads/media/default/0001/08/22208df9f0df9b4e6d3e267b60d17d43f20252f3.mp3)
|
228 |
|
229 | ### Try out some Markdown and Smartdown
|
230 |
|
231 | Type Smartdown into the input cell below and see the result rendered as Smartdown.
|
232 |
|
233 | [Markdown here ...](:?MyMarkdown)
|
234 |
|
235 | [...is rendered below](:!MyMarkdown|markdown)
|
236 |
|
237 | Examples to start with:
|
238 | - `I am **bold**`
|
239 | - `Einstein said: $E=mc^2$`
|
240 | - `I am a [hyperlink](https://en.wikipedia.org/wiki/Hyperlink)`
|
241 | - `[What is your name](:?NAME) [Pleased to meet you, ](:!NAME)`
|
242 |
|
243 |
|
244 |
|
245 | ---
|
246 |
|
247 | [Back to Home](:@Home)
|
248 |
|
249 |
|