commit | ae0a6d5c0843f540aa82b54150b7918c5cd64c59 | [log] [tgz] |
---|---|---|
author | David Peek <david.peek@massiveinteractive.com> | Thu Feb 21 13:43:56 2013 +1100 |
committer | David Peek <david.peek@massiveinteractive.com> | Thu Feb 21 13:43:56 2013 +1100 |
tree | 05f722f8945f337995168a30f89a007b7a60070e | |
parent | 85dbf44709abdbbc7f093aa2f320414939131f45 [diff] |
Updated README and bumped to 0.4.0
This is a standalone version of the dartdoc markdown library. It parses markdown and converts it to HTML.
Add this to your pubspec.yaml
(or create it):
dependencies: markdown: any
Then run the Pub Package Manager (comes with the Dart SDK):
pub install
import 'package:markdown/markdown.dart' show markdownToHtml; main() { print(markdownToHtml('Hello *Markdown*')); }
Version 0.4 adds support for GitHub style triple backtick code blocks, with built in Dart syntax coloring. Custom classifiers can be added using a callback:
import 'package:markdown/markdown.dart' show markdownToHtml; main() { print(markdownToHtml("Hello *Markdown*"), (syntax, source) { if (syntax == 'mysyntax') return classifySyntax(source); return source; }); } String classifySyntax(String source) { return '<span class="mysyntax">$source</span>'; }