| OLD | NEW |
| (Empty) | |
| 1 dartdoc markdown library |
| 2 ======================== |
| 3 |
| 4 This is a standalone version of the [dartdoc][dartdoc] markdown library. It |
| 5 parses markdown and converts it to HTML. |
| 6 |
| 7 You can see a demo running in the browser [here][demo] (tested in Chrome |
| 8 and Dartium). The client library currently only supports HTML syntax |
| 9 highlighting do to some dart:io dependencies in libcss and analyzer_experimental
. |
| 10 |
| 11 Installation |
| 12 ------------ |
| 13 |
| 14 Add this to your `pubspec.yaml` (or create it): |
| 15 ```yaml |
| 16 dependencies: |
| 17 markdown: any |
| 18 ``` |
| 19 Then run the [Pub Package Manager][pub] (comes with the Dart SDK): |
| 20 |
| 21 pub install |
| 22 |
| 23 Usage |
| 24 ----- |
| 25 |
| 26 ```dart |
| 27 import 'package:markdown/markdown.dart' show markdownToHtml; |
| 28 |
| 29 main() { |
| 30 print(markdownToHtml('Hello *Markdown*')); |
| 31 } |
| 32 ``` |
| 33 |
| 34 Version 0.4 adds support for GitHub style triple backtick code blocks, with |
| 35 built in Dart syntax coloring. Custom classifiers can be added using a syntax li
st: |
| 36 |
| 37 ```dart |
| 38 import 'package:markdown/markdown.dart'; |
| 39 |
| 40 main() { |
| 41 List<InlineSyntax> nyanSyntax = |
| 42 [new TextSyntax('nyan', sub: '~=[,,_,,]:3')]; |
| 43 print(markdownToHtml('nyan', inlineSyntaxes: nyanSyntax)); |
| 44 } |
| 45 ``` |
| 46 |
| 47 [dartdoc]: http://code.google.com/p/dart/source/browse/trunk/dart/sdk/lib/_inter
nal/dartdoc |
| 48 [pub]: http://www.dartlang.org/docs/pub-package-manager |
| 49 [demo]: http://dpeek.github.com/dart-markdown |
| OLD | NEW |