Skip to content
This repository was archived by the owner on Jun 3, 2020. It is now read-only.

Commit 22ae12c

Browse files
committed
Updated script to generate dartlang content for i/o samples
1 parent ab4ed51 commit 22ae12c

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

dart_io_mini_samples/generate_md_for_dartlang.dart

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
import 'dart:io';
22
import 'package:path/path.dart' as PATH;
33

4-
// text.gsub /\[([^\]]+)\]\(([^)]+)\)/, '<a href="\2">\1</a>'
5-
64
printExample(List<String> lines) {
7-
var i = 0;
8-
for (; i < lines.length; i++) {
5+
var i;
6+
for (i = 0; i < lines.length; i++) {
97
var line = lines[i].trim();
108
// Get the first non-empty, non-comment line.
119
if (line.startsWith('//') || (line.isEmpty)) {
@@ -18,7 +16,7 @@ printExample(List<String> lines) {
1816
}
1917
print('');
2018
print('{% prettify dart %}');
21-
print(lines.getRange(i, lines.length - 1).join('\n'));
19+
print(lines.getRange(i, lines.length).join('\n'));
2220
print('{% endprettify %}');
2321
print('');
2422
}

0 commit comments

Comments
 (0)