commit | 4ffbef6f7b709bd44a884e2f22737f661dde06fa | [log] [tgz] |
---|---|---|
author | David Peek <ninjascript@gmail.com> | Fri Mar 28 12:23:14 2014 +1100 |
committer | David Peek <ninjascript@gmail.com> | Fri Mar 28 12:23:14 2014 +1100 |
tree | 48c2190cbba3b4553895e64e033638dd056b6bd5 | |
parent | b8e319add581e5500ecde505705ae3ef52650840 [diff] | |
parent | 73acf83059ffc152aca2f5497f45a9dd44449464 [diff] |
Merge pull request #10 from caffinatedmonkey/images Images Support
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)); }