UNPKG

7.38 kBMarkdownView Raw
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
10document should be publishable as-is, as plain text, without looking like it's
11been marked up with tags or formatting instructions. While Markdown's syntax
12has 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
15Markdown's syntax is the format of plain text email.
16>
17>To this end, Markdown's syntax is comprised entirely of punctuation
18characters, which punctuation characters have been carefully chosen so
19as to look like what they mean. E.g., asterisks around a word actually
20look like \*emphasis\*. Markdown lists look like, well, lists. Even
21blockquotes look like quoted passages of text, assuming you've ever
22used 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
33Although 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
35Some 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
45Smartdown *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
49In 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
1111. Item 1
1121. Item 2
1131. 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
1281. Item 1
1291. Item 2
1301. Item 3
131 1. Item 3a
132 1. Item 3b
133
134
135### Syntax Highlighting
136
137````markdown
138Inline: `const a = b + "foo"; // comment`
139Block:
140```python
141print("Python is sort of a programming language")
142print("LOL, just kidding.")
143```
144````
145
146Inline: `const a = b + "foo"; // comment`
147Block:
148```python
149print("Python is sort of a programming language")
150print("LOL, just kidding.")
151```
152
153### Blockquotes
154
155```markdown
156> **The Road Not Taken**
157
158> Two roads diverged in a yellow wood,
159And sorry I could not travel both
160And be one traveler, long I stood
161And looked down one as far as I could
162To where it bent in the undergrowth;
163
164> Then took the other, as just as fair,
165And having perhaps the better claim,
166Because it was grassy and wanted wear;
167Though as for that the passing there
168Had worn them really about the same,
169
170> And both that morning equally lay
171In leaves no step had trodden black.
172Oh, I kept the first for another day!
173Yet knowing how way leads on to way,
174I doubted if I should ever come back.
175
176> I shall be telling this with a sigh
177Somewhere ages and ages hence:
178Two roads diverged in a wood, and I—
179I took the one less traveled by,
180And 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,
189And sorry I could not travel both
190And be one traveler, long I stood
191And looked down one as far as I could
192To where it bent in the undergrowth;
193
194> Then took the other, as just as fair,
195And having perhaps the better claim,
196Because it was grassy and wanted wear;
197Though as for that the passing there
198Had worn them really about the same,
199
200> And both that morning equally lay
201In leaves no step had trodden black.
202Oh, I kept the first for another day!
203Yet knowing how way leads on to way,
204I doubted if I should ever come back.
205
206> I shall be telling this with a sigh
207Somewhere ages and ages hence:
208Two roads diverged in a wood, and I—
209I took the one less traveled by,
210And 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
231Type 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
237Examples 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