-
Notifications
You must be signed in to change notification settings - Fork 0
/
cs302-week-three.tex
460 lines (434 loc) · 11.8 KB
/
cs302-week-three.tex
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
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
\documentclass[14pt,aspectratio=169]{beamer}
\usepackage{pgfpages}
\usepackage{fancyvrb}
\usepackage{tikz}
\usepackage{pgfplots}
\usepackage{minted}
\usemintedstyle{tango}
\usetheme{auriga}
\usecolortheme{auriga}
\setbeamercolor{background canvas}{bg=lightgray}
% define some colors for a consistent theme across slides
\definecolor{red}{RGB}{181, 23, 0}
\definecolor{blue}{RGB}{0, 118, 186}
\definecolor{gray}{RGB}{146, 146, 146}
\title{Web Development: \\ Programming in HTML}
\author{{\bf Gregory M. Kapfhammer}}
\institute[shortinst]{{\bf Department of Computer Science, Allegheny College}}
\begin{document}
{
\setbeamercolor{page number in head/foot}{fg=background canvas.bg}
\begin{frame}
\titlepage
\end{frame}
}
%% Slide
%
\begin{frame}{Technical Question}
%
\hspace*{.25in}
%
\vspace*{.2in}
%
\begin{center}
%
{\large How can I follow industry best practices for implementing
syntactically valid hypertext markup language (HTML) files that correctly
use content and tags to display text-based and image content?}
%
\end{center}
%
\vspace{1ex}
%
\begin{center}
%
\small Let's learn more about how to use HTML to write syntactically valid markup!
%
\end{center}
%
\end{frame}
% Slide
%
\begin{frame}{The Web with HTML and Associated Languages}
%
\begin{itemize}
%
\item HTML standards for the hypertext markup language
%
\item HTML is one of the many components in the modern web
\begin{itemize}
\item Markdown, HTML, CSS, JavaScript
\item Design, implementation, and testing
\item Deployment, maintenance, monitoring
\item Linting and testing tools for all languages
\end{itemize}
%
\item HTML source code must have correct {\em syntax} and {\em semantics}
%
\end{itemize}
%
\end{frame}
% Slide
%
\begin{frame}{Markup Languages and the Origin of HTML}
%
\begin{itemize}
%
\item Distinction between {\em data} and {\em meta-data}
%
\item XML and HTML as markup languages
\begin{itemize}
\item XML is ``extensible''
\item Both use tags to represent the markup
\item Tags can be added to or removed from XML
\item HTML has a largely fixed set of tags
\end{itemize}
%
\vspace*{-.2in}
%
\item Check sites like \url{https://caniuse.com/} to learn more about the
current features of HTML and its browser support. Different browsers have
different support!
%
\end{itemize}
%
\end{frame}
%% Slide
%
\begin{frame}{Fragmented Browser Support for HTML}
%
\hspace*{.25in}
%
\vspace*{-.2in}
%
\begin{center}
%
{\large ``The Web Hypertext Applications Technology working group therefore
intends to address the need for one coherent development environment for Web
applications, through the creation of technical specifications that are
intended to be implemented in mass-market web browsers.''}
%
\end{center}
%
\vspace{1ex}
%
\begin{center}
%
\small Has this working group been able to deliver on its promise?
%
\end{center}
%
\end{frame}
% Slide
%
\begin{frame}{XHTML and HTML5}
%
\begin{itemize}
%
\item XHTML aimed for a ``stricter'' HTML, ultimately not delivering and
eventually being superseded by HTML5
%
\vspace*{-.1in}
%
\item Characteristics of HTML5
\begin{itemize}
\item Specify how a browsers should handle invalid markup
\item Support JavaScript as a non-proprietary language
\item Be backwards compatible with existing HTML
\item See widespread adopting in all modern browsers
\end{itemize}
%
\vspace*{-.1in}
%
\item Wait, what does a web browser have to do to render a web page? Why is
it so difficult to get HTML and the web right?
%
\end{itemize}
%
\end{frame}
% Slide
%
\begin{frame}{Syntax and Semantics of HTML}
%
\begin{itemize}
%
\item HTML contains tags that designate specific elements
%
\vspace*{-.1in}
%
\item HTML contains attributes that are key value pairs for tags
%
\vspace*{-.1in}
%
\item Additional characteristics of HTML
\begin{itemize}
\item Tags provide meaning and formatting for content
\item Tags can be nested in their application
\item Content is divided into the {\tt <head>} and{\tt <body>}
\item Parsing and interpretation of tags varies among browsers
\end{itemize}
%
\vspace*{-.2in}
%
\item How can you tell if your HTML is going to work? Linting and
testing can help to ensure page correctness!
%
\end{itemize}
%
\end{frame}
% Slide
%
\begin{frame}[fragile]
\frametitle{Programming HTML: Using the {\tt <head>} Tag}
\normalsize
\hspace*{-.25in}
\begin{minipage}{6in}
\vspace*{.25in}
\begin{minted}[mathescape, numbersep=5pt, fontsize=\small]{html}
<head>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width"/>
<link href="css/github.css" rel="stylesheet">
<link href="css/emoji.css" rel="stylesheet">
<title>Share Your Travels</title>
</head>
\end{minted}
\end{minipage}
\vspace*{.05in}
\begin{center}
%
\normalsize \noindent HTML tags are nested inside of the {\tt <head>} tag\\
\normalsize \noindent Some HTML tags can define the meta-data about the web page \\
\normalsize \noindent Other HTML tags define content displayed by the
browser \\
%
\end{center}
%
\end{frame}
% Slide
%
\begin{frame}[fragile]
\frametitle{Programming HTML: Using the {\tt <body>} Tag}
\normalsize
\hspace*{-.25in}
\begin{minipage}{6in}
\vspace*{.25in}
\begin{minted}[mathescape, numbersep=5pt, fontsize=\small]{html}
<body>
<h1>Share Your Travels</h1>
<h2>A Delta 757 lands at LAX on January 29th.</h2>
<img src="img/plane.jpg"/></a>
</body>
\end{minted}
\end{minipage}
\vspace*{.05in}
\begin{center}
%
\normalsize \noindent The {\tt <body>} tag defines the region for a page's
content\\
\normalsize \noindent Many different tags can be nested inside of the {\tt
<body>} \\
\normalsize \noindent These tags define multi-level headers and include an
image\\
%
\end{center}
%
\end{frame}
% Slide
%
\begin{frame}[fragile]
\frametitle{Programming HTML: Adding Extra Content}
\normalsize
\hspace*{-.25in}
\begin{minipage}{6in}
\vspace*{.25in}
\begin{minted}[mathescape, numbersep=5pt, fontsize=\small]{html}
<blockquote>
<p><b>By Ricardo on <time>Feb 8, 2018</time></b></p>
<p>Great photograph! How did you take it?</p>
<p>This photo rates as <i class="em em---1"></i></p>
</blockquote>
\end{minted}
\end{minipage}
\vspace*{.05in}
\begin{center}
%
\normalsize \noindent HTML supports multiple levels of nesting content \\
\normalsize \noindent Let's explain the purpose of each tag in this example! \\
\normalsize \noindent Sometimes the use of an HTML tag is overloaded \\
%
\end{center}
%
\end{frame}
% Slide
%
\begin{frame}[fragile]
\frametitle{Relative Referencing of External Files}
\normalsize
\hspace*{-.25in}
\begin{minipage}{6in}
\vspace*{.25in}
\begin{minted}[mathescape, numbersep=5pt, fontsize=\small]{html}
<head>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width"/>
<link href="css/github.css" rel="stylesheet">
<link href="css/emoji.css" rel="stylesheet">
<title>Share Your Travels</title>
</head>
\end{minted}
\end{minipage}
\vspace*{.05in}
\begin{center}
%
\normalsize \noindent The inclusion of additional files is relative to web
server's root\\
\normalsize \noindent This example assumes that the {\tt css/} directory
exists in the root\\
\normalsize \noindent What are the benefits to a hierarchical layout of
files and directories? What are the challenges of this approach?\\
%
\end{center}
%
\end{frame}
% Slide
%
\begin{frame}{Key Terms in Relative File Referencing}
%
\begin{itemize}
%
\item HTML files will commonly refer to other CSS or image files
%
\vspace*{-.2in}
%
\item If the reference to the file is incorrect, no resource will load
%
\vspace*{-.15in}
%
\item Types of relative links in an HTML file
\begin{itemize}
\item Same directory
\item Child directory
\item Grandchild directory
\item Parent directory
\item Sibling directory
\item Root of web server
\item Default document
\end{itemize}
%
\end{itemize}
%
\end{frame}
% Slide
%
\begin{frame}[fragile]
\frametitle{Programming HTML: Creating Nested Lists}
\normalsize
\hspace*{-.55in}
\begin{minipage}{6in}
\vspace*{.25in}
\begin{minted}[mathescape, numbersep=5pt, fontsize=\small]{html}
<ol>
<li><a href="https://www.lonelyplanet.com/"
target="_blank">Visit the Lonely Planet Site</a></li>
<li><a href="https://www.lonelyplanet.com/blog/"
target="_blank">Read the Lonely Planet Blog</a></li>
</ol>
\end{minted}
\end{minipage}
\vspace*{.05in}
\begin{center}
%
\normalsize \noindent Each tag has an opening and a closing location \\
\normalsize \noindent This ordered list features hypertext references \\
\normalsize \noindent References to external pages have a name and a URL \\
%
\end{center}
%
\end{frame}
% Slide
%
\begin{frame}[fragile]
\frametitle{Programming HTML: Semantic Markup}
\normalsize
\hspace*{-.45in}
\begin{minipage}{6in}
\vspace*{-.15in}
\begin{minted}[mathescape, numbersep=5pt, fontsize=\small]{html}
<footer>
Created with <i class="em em-heart"></i>
and <i class="em em-coffee"></i> by Greg Kapfhammer
</footer>
\end{minted}
\end{minipage}
\vspace*{.05in}
\begin{center}
%
\normalsize \noindent Semantic markup influences display and has meaning \\
\normalsize \noindent Examples of this markup type include {\tt <nav>} and {\tt <main>} \\
\normalsize \noindent This source code segment defines the page's {\tt <footer>} \\
\normalsize \noindent The segment contains both {\tt <footer>} and {\tt </footer>} \\
\normalsize \noindent What are the trade-offs associated with semantic markup? \\
%
\end{center}
%
\end{frame}
% Slide
%
\begin{frame}[fragile]
\frametitle{Programming HTML: Using External Resources}
\normalsize
\hspace*{-.15in}
\begin{minipage}{6in}
\vspace*{.15in}
\begin{minted}[mathescape, numbersep=5pt, fontsize=\small]{html}
<head>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width"/>
<link href="css/site.css" rel="stylesheet">
<link href="css/emoji.css" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?
family=Montserrat"
rel="stylesheet" type="text/css">
</head>
\end{minted}
\end{minipage}
\vspace*{-.05in}
\begin{center}
%
\normalsize \noindent Which of these resources are ``internal''? \\
\normalsize \noindent Which of these resources are ``external''? \\
\normalsize \noindent What are the trade-offs of using external resources? \\
%
\end{center}
%
\end{frame}
% Slide
%
\begin{frame}{Tools for Web Development}
%
\begin{itemize}
%
\item Many different tools can support your web development!
%
\vspace*{-.2in}
%
\item Installing some of the tools can be very challenging
%
\vspace*{-.15in}
%
\item Tools to support your web development tasks
\begin{itemize}
\item Text editor
\item Web browser ``dev tools''
\item Terminal window
\item Linters
\item Test frameworks
\item Visual debuggers
\item Automated fault localizers
\end{itemize}
%
\end{itemize}
%
\end{frame}
\end{document}