Skip to content

Commit b68fd27

Browse files
authored
Get started codelab: use code excerpter to sync code (#2027)
1 parent 95f9624 commit b68fd27

File tree

7 files changed

+217
-109
lines changed

7 files changed

+217
-109
lines changed

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,6 @@
66
path = flutter
77
url = https://github.com/flutter/flutter
88
branch = beta
9+
[submodule "examples/codelabs"]
10+
path = examples/codelabs
11+
url = https://github.com/flutter/codelabs

build.excerpt.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
targets:
2+
$default:
3+
sources:
4+
include:
5+
- examples/**
6+
exclude:
7+
- '**/.*/**'
8+
- '**/android/**'
9+
- '**/build/**'
10+
- '**/ios/**'
11+
- '**/node_modules/**'
12+
- '**/*.jar'
13+
builders:
14+
code_excerpter|code_excerpter:
15+
enabled: true

examples/codelabs

Submodule codelabs added at 7aa16b3

pubspec.lock

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ packages:
77
name: analyzer
88
url: "https://pub.dartlang.org"
99
source: hosted
10-
version: "0.32.6"
10+
version: "0.34.0"
1111
args:
1212
dependency: transitive
1313
description:
@@ -28,7 +28,7 @@ packages:
2828
name: build
2929
url: "https://pub.dartlang.org"
3030
source: hosted
31-
version: "0.12.8"
31+
version: "1.0.2"
3232
build_config:
3333
dependency: transitive
3434
description:
@@ -49,14 +49,14 @@ packages:
4949
name: build_runner
5050
url: "https://pub.dartlang.org"
5151
source: hosted
52-
version: "0.10.3"
52+
version: "1.1.2"
5353
build_runner_core:
5454
dependency: transitive
5555
description:
5656
name: build_runner_core
5757
url: "https://pub.dartlang.org"
5858
source: hosted
59-
version: "1.0.0"
59+
version: "1.1.2"
6060
built_collection:
6161
dependency: transitive
6262
description:
@@ -70,7 +70,7 @@ packages:
7070
name: built_value
7171
url: "https://pub.dartlang.org"
7272
source: hosted
73-
version: "6.1.6"
73+
version: "6.2.0"
7474
charcode:
7575
dependency: transitive
7676
description:
@@ -99,10 +99,10 @@ packages:
9999
description:
100100
path: "."
101101
ref: HEAD
102-
resolved-ref: "271e692bb0fd7886be65c441ee2849ccadf61b2f"
102+
resolved-ref: d81e903a36bd36532fcbf85ba38c679ce264e6e3
103103
url: "https://github.com/chalin/code_excerpter.git"
104104
source: git
105-
version: "0.4.1"
105+
version: "0.6.0"
106106
collection:
107107
dependency: transitive
108108
description:
@@ -144,7 +144,7 @@ packages:
144144
name: dart_style
145145
url: "https://pub.dartlang.org"
146146
source: hosted
147-
version: "1.1.3"
147+
version: "1.2.2"
148148
fixnum:
149149
dependency: transitive
150150
description:
@@ -158,7 +158,7 @@ packages:
158158
name: front_end
159159
url: "https://pub.dartlang.org"
160160
source: hosted
161-
version: "0.1.4+2"
161+
version: "0.1.7"
162162
glob:
163163
dependency: transitive
164164
description:
@@ -214,14 +214,14 @@ packages:
214214
name: json_annotation
215215
url: "https://pub.dartlang.org"
216216
source: hosted
217-
version: "1.2.0"
217+
version: "2.0.0"
218218
kernel:
219219
dependency: transitive
220220
description:
221221
name: kernel
222222
url: "https://pub.dartlang.org"
223223
source: hosted
224-
version: "0.3.4+2"
224+
version: "0.3.7"
225225
linkcheck:
226226
dependency: "direct dev"
227227
description:
@@ -277,7 +277,7 @@ packages:
277277
name: pedantic
278278
url: "https://pub.dartlang.org"
279279
source: hosted
280-
version: "1.3.0"
280+
version: "1.4.0"
281281
plugin:
282282
dependency: transitive
283283
description:
@@ -412,4 +412,4 @@ packages:
412412
source: hosted
413413
version: "2.1.15"
414414
sdks:
415-
dart: ">=2.0.0 <3.0.0"
415+
dart: ">=2.1.0-dev.5.0 <3.0.0"

src/_assets/css/main.scss

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,24 @@
3030
@import '_404';
3131

3232
@import 'site_overrides';
33+
34+
35+
.numbered-code-notes {
36+
list-style-type: none;
37+
padding-left: 0;
38+
display: table;
39+
li {
40+
counter-increment: code-note-counter;
41+
display: table-row;
42+
padding-left: 8px;
43+
&:before {
44+
font-family: $font-family-monospace;
45+
content: '/*' counter(code-note-counter) '*/' ;
46+
display: table-cell;
47+
text-align: right;
48+
color: $teal;
49+
padding-right: $font-size-base / 2;
50+
// background-color: lightyellow;
51+
}
52+
}
53+
}

0 commit comments

Comments
 (0)