Skip to content

Commit 6879110

Browse files
authored
Tutorial content (#15)
* move content * add tutorial content * fix
1 parent 57b5fc7 commit 6879110

File tree

745 files changed

+17452
-10
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

745 files changed

+17452
-10
lines changed

Diff for: apps/svelte.dev/content/tutorial/.gitattributes

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.md text eol=lf
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<h1>Welcome!</h1>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<h1>Hello world!</h1>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<script>
2+
let name = 'Svelte';
3+
</script>
4+
5+
<h1>Hello {name.toUpperCase()}!</h1>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<script>
2+
let src = '/image.gif';
3+
</script>
4+
5+
<img />
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<script>
2+
let src = '/image.gif';
3+
let name = 'Rick Astley';
4+
</script>
5+
6+
<img {src} alt="{name} dances." />
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<p>This is a paragraph.</p>
2+
3+
<style>
4+
/* Write your CSS here */
5+
</style>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<p>This is a paragraph.</p>
2+
3+
<style>
4+
p {
5+
color: goldenrod;
6+
font-family: 'Comic Sans MS', cursive;
7+
font-size: 2em;
8+
}
9+
</style>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<p>This is a paragraph.</p>
2+
3+
<style>
4+
p {
5+
color: goldenrod;
6+
font-family: 'Comic Sans MS', cursive;
7+
font-size: 2em;
8+
}
9+
</style>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<p>This is another paragraph.</p>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<script>
2+
import Nested from './Nested.svelte';
3+
</script>
4+
5+
<p>This is a paragraph.</p>
6+
<Nested />
7+
8+
<style>
9+
p {
10+
color: goldenrod;
11+
font-family: 'Comic Sans MS', cursive;
12+
font-size: 2em;
13+
}
14+
</style>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<script>
2+
let string = `this string contains some <strong>HTML!!!</strong>`;
3+
</script>
4+
5+
<p>{string}</p>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<script>
2+
let string = `this string contains some <strong>HTML!!!</strong>`;
3+
</script>
4+
5+
<p>{@html string}</p>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"title": "Introduction",
3+
"scope": {
4+
"prefix": "/src/lib/",
5+
"name": "src"
6+
},
7+
"focus": "/src/lib/App.svelte"
8+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<script>
2+
let count = 0;
3+
4+
function increment() {
5+
// event handler code goes here
6+
}
7+
</script>
8+
9+
<button>
10+
Clicked {count}
11+
{count === 1 ? 'time' : 'times'}
12+
</button>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<script>
2+
let count = 0;
3+
4+
function increment() {
5+
count += 1;
6+
}
7+
</script>
8+
9+
<button on:click={increment}>
10+
Clicked {count}
11+
{count === 1 ? 'time' : 'times'}
12+
</button>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<script>
2+
let count = 0;
3+
$: doubled = count * 2;
4+
5+
function increment() {
6+
count += 1;
7+
}
8+
</script>
9+
10+
<button on:click={increment}>
11+
Clicked {count}
12+
{count === 1 ? 'time' : 'times'}
13+
</button>
14+
15+
<p>{count} doubled is {doubled}</p>

0 commit comments

Comments
 (0)