Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add solution for lesson 1 #29

Open
wants to merge 1 commit into
base: gh-pages
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ <h1 class="title">Visualizing your data on the web using D3</h1>
</ul>
<div id="prerequisites" class="prereq panel panel-warning">
<div class="panel-heading">
<h2><span class="glyphicon glyphicon-education"></span>Prerequisites</h2>
<h2 id="prerequisites" class="prereq panel panel-warning"><span class="glyphicon glyphicon-education"></span>Prerequisites</h2>
</div>
<div class="panel-body">
<ul>
Expand All @@ -68,6 +68,7 @@ <h2 id="topics">Topics</h2>
<li><a href="08-d3enter.html">D3 Into the data</a></li>
<li><a href="09-d3exit.html">D3 Add and remove</a></li>
<li><a href="10-d3update.html">D3 Transitions</a></li>
<li><a href="solutions.html">Solutions</a></li>
</ol>
<ol start="20" style="list-style-type: lower-roman">
<li><a href="xx-d3future.html">What now?</a></li>
Expand Down
1 change: 1 addition & 0 deletions index.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ Along the way, we will learn:
8. [D3 Into the data](08-d3enter.html)
9. [D3 Add and remove](09-d3exit.html)
10. [D3 Transitions](10-d3update.html)
11. [Solutions](solutions.html)
xx. [What now?](xx-d3future.html)

We are using [gapminder data](http://gapminder.orf) and the later lessons are based on an example by [Mike Bostock](http://bost.ocks.org/mike/nations/).
Expand Down
70 changes: 70 additions & 0 deletions solutions.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="generator" content="pandoc">
<title>Software Carpentry: Visualizing your data on the web using D3</title>
<link rel="shortcut icon" type="image/x-icon" href="/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" type="text/css" href="css/bootstrap/bootstrap.css" />
<link rel="stylesheet" type="text/css" href="css/bootstrap/bootstrap-theme.css" />
<link rel="stylesheet" type="text/css" href="css/swc.css" />
<link rel="alternate" type="application/rss+xml" title="Software Carpentry Blog" href="http://software-carpentry.org/feed.xml"/>
<meta charset="UTF-8" />
<!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
</head>
<body class="lesson">
<div class="container card">
<div class="banner">
<a href="http://software-carpentry.org" title="Software Carpentry">
<img alt="Software Carpentry banner" src="img/software-carpentry-banner.png" />
</a>
</div>
<div class="row">
<div class="col-md-10 col-md-offset-1">
<h1 class="title">Visualizing your data on the web using D3</h1>
<h2 class="subtitle">Solutions</h2>
<h2 id="lesson-01-html">Lesson 01-HTML</h2>
<div id="other-elements" class="challenge panel panel-success">
<div class="panel-heading">
<h2 id="other-elements" class="challenge panel panel-success"><span class="glyphicon glyphicon-pencil"></span>Other elements</h2>
</div>
<div class="panel-body">
<p>Create a folder that contains the file index.html (or download it). What seems to be the difference between &lt;div&gt;, &lt;h1&gt;, and &lt;em&gt;? Create a heading that is in italics.</p>
</div>
</div>
<hr />
<p><code>&lt;div&gt;</code> is a generic container which inherently does not represent anything.</p>
<p><code>&lt;h1&gt;</code> is used to create a large heading on the page. There are different heading levels, from the largest(<code>&lt;h1&gt;</code>), to the smallest(<code>&lt;h6&gt;</code>).</p>
<p><code>&lt;em&gt;</code> is used to <em>Emphasize</em> a portion of text.</p>
<p>So, what is the difference between <code>&lt;em&gt;</code> and <code>&lt;i&gt;</code>?</p>
<p>The <code>&lt;em&gt;</code> tag stresses emphasis of its contents, while the <code>&lt;i&gt;</code> tag represents text that is set off from the normal prose, such as the name of a movie or book, a foreign word, or when the text refers to the definition of a word instead of representing its semantic meaning.</p>
<p>Solution:</p>
<div class="sourceCode"><pre class="sourceCode html"><code class="sourceCode html"><span class="dt">&lt;!DOCTYPE </span>html<span class="dt">&gt;</span>
<span class="kw">&lt;html&gt;</span>
<span class="kw">&lt;head&gt;</span>
<span class="kw">&lt;meta</span><span class="ot"> charset=</span><span class="st">&quot;UTF-8&quot;</span><span class="kw">&gt;</span>
<span class="kw">&lt;title&gt;</span>Lesson 1<span class="kw">&lt;/title&gt;</span>
<span class="kw">&lt;/head&gt;</span>
<span class="kw">&lt;body&gt;</span>
<span class="kw">&lt;h1&gt;&lt;i&gt;</span>Heading in Italics!<span class="kw">&lt;/i&gt;&lt;/h1&gt;</span>
<span class="kw">&lt;/body&gt;</span>
<span class="kw">&lt;/html&gt;</span></code></pre></div>
<hr />
</div>
</div>
<div class="footer">
<a class="label swc-blue-bg" href="http://software-carpentry.org">Software Carpentry</a>
<a class="label swc-blue-bg" href="https://github.com/swcarpentry/lesson-template">Source</a>
<a class="label swc-blue-bg" href="mailto:[email protected]">Contact</a>
<a class="label swc-blue-bg" href="LICENSE.html">License</a>
</div>
</div>
<!-- Javascript placed at the end of the document so the pages load faster -->
<script src="http://software-carpentry.org/v5/js/jquery-1.9.1.min.js"></script>
<script src="css/bootstrap/bootstrap-js/bootstrap.js"></script>
</body>
</html>
46 changes: 46 additions & 0 deletions solutions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
layout: page
title: Visualizing your data on the web using D3
subtitle: Solutions
minutes: 0
---

## Lesson 01-HTML

> ## Other elements {.challenge}
> Create a folder that contains the file index.html (or download it).
> What seems to be the difference between &lt;div&gt;, &lt;h1&gt;, and &lt;em&gt;?
> Create a heading that is in italics.

****
`<div>` is a generic container which inherently does not represent anything.

`<h1>` is used to create a large heading on the page. There are different heading levels,
from the largest(`<h1>`), to the smallest(`<h6>`).

`<em>` is used to <em>Emphasize</em> a portion of text.

So, what is the difference between `<em>` and `<i>`?

The `<em>` tag stresses emphasis of its contents, while the `<i>` tag represents
text that is set off from the normal prose, such as the name of a movie or book,
a foreign word, or when the text refers to the definition of a word instead of
representing its semantic meaning.

Solution:

~~~ {.html}
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Lesson 1</title>
</head>
<body>
<h1><i>Heading in Italics!</i></h1>
</body>
</html>
~~~

***