commit | ab1fcbb184488dc2f84d84a10444fe0d275ec7af | [log] [tgz] |
---|---|---|
author | David Peek <david.peek@massiveinteractive.com> | Sat May 11 18:07:47 2013 -0700 |
committer | David Peek <david.peek@massiveinteractive.com> | Sat May 11 18:07:47 2013 -0700 |
tree | 337c1fed8874387fb180abe8fddc026dc613a969 | |
parent | 9db546114f4696fb33b5c1a0a67502a285322c9e [diff] | |
parent | 854aec5725dd0e3e5110b859a24fdc61c0b27681 [diff] |
Merge pull request #3 from danschubert/master Fixed broken markdown package, switches from callback to syntax list for matching classifiers.
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)); }