commit | 9db546114f4696fb33b5c1a0a67502a285322c9e | [log] [tgz] |
---|---|---|
author | David Peek <david.peek@massiveinteractive.com> | Sat Feb 23 16:05:47 2013 +1100 |
committer | David Peek <david.peek@massiveinteractive.com> | Sat Feb 23 16:05:47 2013 +1100 |
tree | 0a6eb6ddc3b04f0a913ea65c1c24b2eab520fc27 | |
parent | ae0a6d5c0843f540aa82b54150b7918c5cd64c59 [diff] |
Updates README with demo link.
This is a standalone version of the dartdoc markdown library. It parses markdown and converts it to HTML.
You can see a demo running in the browser here (tested in Chrome and Dartium). The client library currently only supports HTML syntax highlighting do to some dart:io dependencies in libcss and analyzer_experimental.
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>'; }