commit | 0e63639ce83cb11e54b8dec5411dfdba638e4a61 | [log] [tgz] |
---|---|---|
author | David Peek <david.peek@me.com> | Sun May 12 11:51:59 2013 +1000 |
committer | David Peek <david.peek@me.com> | Sun May 12 11:51:59 2013 +1000 |
tree | 9c6ff5f3251e7b637aecfec8c38e964e6fb1c7e6 | |
parent | ab1fcbb184488dc2f84d84a10444fe0d275ec7af [diff] |
Bumped to 0.5
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)); }