-
Notifications
You must be signed in to change notification settings - Fork 0
/
02-markdown-behavior.html
262 lines (260 loc) · 8.37 KB
/
02-markdown-behavior.html
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
<!DOCTYPE html>
<html>
<head>
<title>Author Carpentry</title>
<link rel="stylesheet" href="css/site.css">
</head>
<body>
<header>
<a href="http://authorcarpentry.github.io"><img src="img/AClogo.jpg" alt="Author Carpentry logo"></a>
</header>
<nav>
<ul>
<li>
<a href=".">Lesson</a>
</li>
<li>
<a href="00-getting-started.html">Getting Started</a>
</li>
<li>
<a href="01-markdown-display.html">Markdown Display</a>
</li>
<li>
<a href="02-markdown-behavior.html">Advanced Markdown</a>
</li>
<li>
<a href="03-citation.html">Citations</a>
</li>
<li>
<a href="04-multiple-outputs.html">Multiple Outputs</a>
</li>
<li>
<a href="mailto:[email protected]">Contact Us</a>
</li>
</ul>
</nav>
<section>
<h1 id="markdown-syntax">
Markdown Syntax
</h1>
<p>
20 minutes
</p>
<hr />
<p>
In an open publishing workflow formatting elements can also cause behavior changes in how your documents are rendered.
</p>
<h2 id="learning-objectives">
Learning Objectives
</h2>
<ul>
<li>
Understand how markup can drive computer behavior
</li>
<li>
</li>
<li>
</li>
</ul>
<p>
Demonstrate how the system date can be used to auto-date a document. Showcase footnotes, code folding, or TOC.
</p>
<table style="width:74%;">
<colgroup>
<col style="width: 73%" />
</colgroup>
<tbody>
<tr class="odd">
<td style="text-align: left;">
## Creating a Markdown Document
</td>
</tr>
<tr class="even">
<td style="text-align: left;">
So far, you have just written markdown in an online editor. Start by creating a local file. The file extension for markdown is .md. You can just open a text editor and create a file or do this from the commandline. use <code>cd</code> to go to the folder you want to work in. Then use <code>atom myresume.md</code> to create a markdown file.
</td>
</tr>
<tr class="odd">
<td style="text-align: left;">
## Working with Markdown in Atom <em>You can skip this section if you are using a different text editor</em>.
</td>
</tr>
<tr class="even">
<td style="text-align: left;">
Type some text into markdown. Now put some text into italics and bold using * as you learned in the last lesson. What do you notice? One of the benefits of using Atom is that it gives you this <em>syntax highlighting</em> to make it easier for you to spot any problems in your text formatting.
</td>
</tr>
<tr class="odd">
<td style="text-align: left;">
Now press <code>ctrl+shift+m</code> (or select “Toggle Preview” under “Markdown Preview Plus” in the “Packages” menu). You will see your text formatted, just like you did in the online editor during the last lesson.
</td>
</tr>
<tr class="even">
<td style="text-align: left;">
## Markdown syntax You have already learned the two commands for bold and italics. Let’s look at some other basics:
</td>
</tr>
<tr class="odd">
<td style="text-align: left;">
<ul>
<li>To create headings, put one or more # symbols at the beginning of a line, followed by a space. One # is for a level one header, ## for a level two header, etc. - To make bullet lists (such as this one), just start lines with a -; you can get additional levels by starting a line a couple of spaces or a tab in. Numbered lists work the same way using 1. 2. 3.
</td>
</tr>
<tr class="even">
<td style="text-align: left;">
<code>- Topic 1 - Topic 2 - Topic 3 - Topic 3a</code> - To cite code (including markdown syntax as above) use ` on both sides for short bits and ``` in a separate line above and below larger codeblocks. - Quote text using > at the beginning of the line (maybe you remember this from old e-mail programs?)
</td>
</tr>
<tr class="odd">
<td style="text-align: left;">
<code>> This is a Quote</code>
</td>
</tr>
<tr class="even">
<td style="text-align: left;">
<ul>
<li>A link is set putting the text that you want to highlight in square brackets followed by the link in round brackets. Don’t forget to include http:// or https:// at the beginning of the link
</td>
</tr>
<tr class="odd">
<td style="text-align: left;">
<code><a href="http://www.example.com">This is a link</a></code> - You can find more markdown formatting options <a href="https://guides.github.com/features/mastering-markdown/">here</a>. Note that markdown comes in different dialects, referred to as “flavors”. We are mainly going to be using elements that are part of a consensus referred to as <a href="http://commonmark.org/">Common Markdown</a>, though you can use any other components of the github flavored markdown linked above.
</td>
</tr>
<tr class="even">
<td style="text-align: left;">
## Excercise Now let’s try this. Create your Resume using markdown following the template below. Fill in the data relevant to you.
</td>
</tr>
</tbody>
</table>
<h1 id="resume-of-john-doe">
Resume of John Doe
</h1>
<ul>
<li>
ORCID: https://orcid.org/0000-0001-8249-7388<br />
</li>
<li>
<a href="https://www.scienceopen.com/user/fe25273d-b2ef-4843-b3a5-23ea6ae9f5e8">ScienceOpen Profile</a>
</li>
</ul>
<h2 id="objective">
Objective
</h2>
<blockquote>
<p>
To boldly go where no author has gone before
</p>
</blockquote>
<h2 id="experience">
Experience
</h2>
<ul>
<li>
<strong>Job 1</strong>
<ul>
<li>
<em>Dates</em>
</li>
<li>
Description/Accomplishment
</li>
</ul>
</li>
<li>
<strong>Job 2</strong>
<ul>
<li>
<em>Dates</em>
</li>
<li>
Description/Accomplishment<br />
</li>
</ul>
</li>
<li>
<strong>Job 3</strong>
<ul>
<li>
<em>Dates</em>
</li>
<li>
Description/Accomplishment
</li>
</ul>
</li>
</ul>
<h2 id="publications">
Publications
</h2>
<p>
(paste the output from DOI content negotiation here and mark it up with italics as appropriate)
</p>
<p>
Karcher, S., & Steinberg, D. A. (2013). Assessing the Causes of Capital Account Liberalization: How Measurement Matters. <em>International Studies Quarterly, 57(1)</em>, 128–137. https://doi.org/10.1111/isqu.12001
</p>
<p>
Karcher, S., & Schneider, B. R. (2012). Business politics in Latin America: Investigating structure, preferences, and influence. In P. R. Kingstone & D. J. Yashar (Eds.), <em>Routledge Handbook of Latin American Politics</em> (pp. 273–284). New York, NY: Routledge.
</p>
<p>
Schneider, B. R., & Karcher, S. (2010). Complementarities and Continuities in the Political Economy of Labor Markets in Latin America. <em>Socio-Economic Review, 8(4)</em>, 623–651. https://doi.org/10.1093/ser/mwq022
</p>
<h2 id="code-samples">
Code samples
</h2>
<p>
Here is how to use <code>curl</code> to get a bibliographic reference for a DOI in APA style:
</p>
<pre><code>curl -LH "Accept: text/x-bibliography; style=apa" https://doi.org/10.1126/science.169.3946.635</code></pre>
<table style="width:6%;">
<colgroup>
<col style="width: 5%" />
</colgroup>
<tbody>
<tr class="odd">
<td>
<strong>Solution</strong>: If you run into trouble, you can check the syntax for the above <a href="GITHUBLINK">here</a>.
</td>
</tr>
</tbody>
</table>
<h2 id="markdown-and-html">
Markdown and html
</h2>
<p>
Now let’s look at how the markdown you wrote corresponds to html. Right-click on the preview window, select “Save as HTML” and save the file myresume.md.html somewhere on your computer. Now open a browser (Firefox or Chrome) and open that file. Right-click somewhere in the web document that open and select “Inspect Element”.
</p>
<blockquote>
<h2 id="challenge">
Challenge
</h2>
<p>
Can you match markdown and html elements? How are they different? What do you think are the advantages of each format?
</p>
<blockquote>
<h2 id="solution">
Solution
</h2>
<p>
Markdown and html translate neatly: e.g. the headings are the same as h1, h2, h3, italics are the same as <i> tags, etc. But note how hard the html is to right, with the need to get all the tags right, and how hard to read it is for you. On the other hand, note all the additional information the HTML is able to include that isn’t printed. That can be very useful, e.g. to include even more structure in a page or to add metadata.
</p>
</blockquote>
</blockquote>
<p>
Previous: <a href="00-getting-started.html">Getting Started with Markdown</a> Next: <a href="02-gh-pages.html">Github Pages</a>
</p></li>
</ul></li>
</ul>
</section>
<footer>
<span>© Author Carpentry</span>
<span><a rel="license" href="http://creativecommons.org/licenses/by/4.0/"><img
alt="Creative Commons License" style="vertical-align: middle;"
src="https://i.creativecommons.org/l/by/4.0/80x15.png" /></a></span>
<span>This work is licensed under a <a rel="license"
href="http://creativecommons.org/licenses/by/4.0/">Creative Commons Attribution
4.0 International License</a></span>
</footer>
</body>
</html>