commit | ee2b469c1686cb060b9d320f78a7c32cf3c9da3c | [log] [tgz] |
---|---|---|
author | David Peek <ninjascript@gmail.com> | Fri Mar 07 09:27:46 2014 +1100 |
committer | David Peek <ninjascript@gmail.com> | Fri Mar 07 09:27:46 2014 +1100 |
tree | 70b17cc185bf3437e892de8bfd11b8967c0aaefd | |
parent | 521ae077c1bba44be9da4ad80aee2e50d681d601 [diff] | |
parent | 99301fd601f65cd7da1e61f966cc22903966c76a [diff] |
Merge pull request #8 from kevmoo/master A bunch of cleanup
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 syntax list:
import 'package:markdown/markdown.dart'; main() { List<InlineSyntax> nyanSyntax = [new TextSyntax('nyan', sub: '~=[,,_,,]:3')]; print(markdownToHtml('nyan', inlineSyntaxes: nyanSyntax)); }