-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlearningMarkdown.Rmd
352 lines (206 loc) · 8.1 KB
/
learningMarkdown.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
---
title: "Learning Markdown"
subtitle: "A short tutorial for Class 3EE"
author: ""
date: '`r Sys.Date()`'
output:
xaringan::moon_reader:
lib_dir: libs
css: xaringan-themer.css
nature:
highlightStyle: github
highlightLines: true
countIncrementalSlides: false
---
```{r setup, include=FALSE}
options(htmltools.dir.version = FALSE)
```
```{r xaringan-themer, include=FALSE, warning=FALSE}
library(xaringanthemer)
style_duo_accent(
primary_color = "#1381B0",
secondary_color = "#FF961C",
inverse_header_color = "#FFFFFF"
)
```
# What is Markdown?
* Is a lightweight markup language that you can use to add formatting elements to plain text text documents
* Created by John Gruber in 2004
* Is now one of the world’s most popular markup languages
* It is used to make different types of documents including websites, notes, books, presentations, email, and documentation
* This presentation was created using a type of Markdown
---
.pull-left[
### This is an example of a Markdown of a page in the Class 3EE website
```MD
Dear parents
This week, in Spanish, we will be
looking at the following:
* **Spanish:** synonyms
* **Reading:** We will start reading
the book "para hacer un pastel de
manzana" and Clara's farm story.
* **DoW:** Where food comes from and
farm animals.
* **Maths:** Divisions
* **Art:** Craft "make your farm"
Thanks
Sofia
```
]
.pull-right[
### This is how it looks like on the actual Class 3EE website
![](figures/webSample.png)
]
---
# What do you notice with the Markdown document compared to the final output document?
* Except for very minor differences in some characters such as the asterisk or star used in Markdown, the Markdown document is exactly the same text as is the website output
* This is one of the really cool features of Markdown - its **human-readable format**
* This also gives you an idea of how easy it is to write your newspaper articles using Markdown
---
class: center, middle
## Are you ready to write your newspaper articles in Markdown?
---
class: center, middle
## In this tutorial, we will learn how to convert the newspaper articles that you created for English class into Markdown to prepare it for publication into the online newspaper created for this project
---
# What you will need
* A copy of your newspaper article or articles submitted to Mrs Trevitt
* A computer/device that you use for home school. This device should have access to your Google for Education account from school. Specifically, we will use **Google Docs**
---
# Step 1: Open a blank document in **Google Docs**
* When writing Markdown, you usually use what is called a **text editor** - an application on your computer that you use to write plain text
* **Google Docs** is not considered a plain text editor
* However, because most of you have already been using **Google Docs** for home school, we will use it for creating your Markdown document
* Once you have written the Markdown version of your newspaper article in **Google Docs**, we will output this document from **Google Docs** into a text file. A text file is a file with an extension `.txt`
---
# Step 2: Writing the front matter
* A Markdown document usually has what is called a **front matter** at the start
* The **front matter** provides information regarding the document you are writing
* The **front matter** looks something like this:
```MD
---
title: Missing sausage dog found using bacon
author: Jane Doe
date: "2020-06-08"
---
```
* In this example **front matter**, the `title`, the `author`, and the `date` of the document are included.
* Depending on the document you are writing, other information are included in the **front matter**
---
# Step 2: Writing the front matter
* The **front matter** should always be at the start of the document.
* The **front matter** should always be written sandwiched between three dashes at the start and three dashes at the end:
```MD
---
FRONT MATTER HERE
---
```
* For the newspaper articles we are writing, we need the following information to be included in the front matter:
```MD
---
title: TITLE OF YOUR NEWSPAPER ARTICLE
author: YOUR NAME (OR A PSEUDONYM INSTEAD OF YOUR REAL NAME)
date: DATE WHEN YOU WROTE THE NEWSPAPER ARTICLE
---
```
---
class: center, middle
## You can now start writing the front matter for your newspaper article in the **Google Docs** you opened
---
# Step 3: Write your newspaper article
* This is probably the easiest step in the process
* Most of you have written your newspaper articles using **Google Docs** already, If you have, then you just need to do a simple copy and paste of your article
* Your Markdown document should look something like this by now:
```MD
---
title: Title of this article
author: My Name
date: "2020-06-09"
---
This is my article about a topic that was assigned to me by the
teacher. It is a very interesting topic. I like writing about this
topic. I hope many of my classmates will read my article.
```
---
# Step 4: Style your Markdown document
* You can now start adding some styling or formatting to your document
* This is done using standard Markdown styling or formatting rules. These rules are also called **syntax**.
* The next slides show commonly used Markdown syntax for styling or formatting documents
---
.pull-left[
### Markdown syntax
* ```*italics*``` or ```_italics_```
* ```**bold**``` or ```__bold__```
* ```> block quote```
* ```# Header 1```
* ```## Header 2```
* ```### Header 3```
* ```#### Header 4```
]
.pull-right[
### Resulting output
* *italics*
* **bold**
* > block quote
* # Header 1
* ## Header 2
* ### Header 3
* #### Header 4
]
---
.pull-left[
### Markdown syntax
* ```[link to 3EE website](https://www.europa-ee.org.uk)```
* adding an image: ```![](path/to/light-bulb.png)```
]
.pull-right[
### Resulting output
* [link to 3EE website](https://www.europa-ee.org.uk)
* adding an image: ![](figures/light-bulb.png)
]
---
class: center, middle
# We now try to apply these rules to the sample newspaper article in Markdown document we saw earlier
---
# This syntax ...
```MD
---
title: Title of this article
author: My Name
date: "2020-06-09"
---
This is **my** article about a _topic_ that was assigned to me by the
teacher. It is a very interesting topic.
> I like writing about this topic.
# I hope many of my classmates will read my article.
```
---
# Will look like this ...
### Title of this article
#### My Name
##### 2020-06-09
This is **my** article about a _topic_ that was assigned to me by the
teacher. It is a very interesting topic.
> I like writing about this topic.
# I hope many of my classmates will read my article.
---
# Step 5: Naming your Markdown document
* Do this by tapping the upper left hand corner of the **Google Docs** that contains the placeholder name for the file (usually says *Untitled Document*)
![](figures/renaming_google_docs1.png)
* The filename of the Markdown document should always start with the ***date*** you wrote the document. It should be in this format: `YYYY-MM-DD`
* After the ***date***, you can now add any name you would like to give your document as its filename. The easiest is to use the title of your article like this: `2020-06-09-title-of-this-article`
![](figures/renaming_google_docs2.png)
---
# Step 6: Output as a text file
* As mentioned earlier, we are just using **Google Docs** as it is the most convenient and accessible tool for you to write Markdown
* But we need to save the Markdown document you created into a plain text file (something that ends in `.txt`)
---
# Step 6: Output as a text file
* **Google Docs** allows this kind of output. First, click on `File`, then select the `Download` option and then select the `Plain text (.txt)` option
![](figures/download_as_text.png)
* You will now have downloaded your Markdown file in plain text. You can find your file in the default download directory or folder of the device you are using
---
class: center, middle
## Congratulations! You have just produced your first ever Markdown document!
Make sure you keep the plain text file that you have created so that we can upload that to the online newspaper for publication.