OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 import 'package:barback/barback.dart'; | 5 import 'package:barback/barback.dart'; |
6 import 'package:markdown/markdown.dart'; | 6 import 'package:markdown/markdown.dart'; |
7 | 7 |
8 import 'dart:async'; | 8 import 'dart:async'; |
9 | 9 |
10 class ConvertMarkdown extends Transformer { | 10 class ConvertMarkdown extends Transformer { |
(...skipping 13 matching lines...) Expand all Loading... |
24 // The extension of the output is changed to ".html". | 24 // The extension of the output is changed to ".html". |
25 var id = transform.primaryInput.id.changeExtension(".html"); | 25 var id = transform.primaryInput.id.changeExtension(".html"); |
26 | 26 |
27 String newContent = "<html><body>" | 27 String newContent = "<html><body>" |
28 + markdownToHtml(content) | 28 + markdownToHtml(content) |
29 + "</body></html>"; | 29 + "</body></html>"; |
30 transform.addOutput(new Asset.fromString(id, newContent)); | 30 transform.addOutput(new Asset.fromString(id, newContent)); |
31 }); | 31 }); |
32 } | 32 } |
33 } | 33 } |
OLD | NEW |