Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(149)

Side by Side Diff: samples/markdown/markdown.dart

Issue 9254026: Split dart:builtin into dart:builtin and dart:io. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comment and add binaries. Created 8 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « samples/chat/http.dart ('k') | samples/total/src/Dartc.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 /// Standalone script for parsing markdown from files and converting to HTML. 5 /// Standalone script for parsing markdown from files and converting to HTML.
6 #library('markdown_app'); 6 #library('markdown_app');
7 7
8 #import('dart:io');
8 #import('lib.dart'); 9 #import('lib.dart');
9 10
10 main() { 11 main() {
11 final args = (new Options()).arguments; 12 final args = (new Options()).arguments;
12 13
13 if (args.length > 2) { 14 if (args.length > 2) {
14 print('Usage:'); 15 print('Usage:');
15 print(' dart markdown.dart <inputfile> [<outputfile>]'); 16 print(' dart markdown.dart <inputfile> [<outputfile>]');
16 print(''); 17 print('');
17 print('Reads a file containing markdown and converts it to HTML.'); 18 print('Reads a file containing markdown and converts it to HTML.');
(...skipping 19 matching lines...) Expand all
37 file.closeSync(); 38 file.closeSync();
38 return new String.fromCharCodes(buffer); 39 return new String.fromCharCodes(buffer);
39 } 40 }
40 41
41 void writeFile(String path, String text) { 42 void writeFile(String path, String text) {
42 final file = new File(path); 43 final file = new File(path);
43 final stream = file.openOutputStream(); 44 final stream = file.openOutputStream();
44 stream.write(text.charCodes()); 45 stream.write(text.charCodes());
45 stream.close(); 46 stream.close();
46 } 47 }
OLDNEW
« no previous file with comments | « samples/chat/http.dart ('k') | samples/total/src/Dartc.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698