commit | 24377e1e418a7ecc7f81f3feb10cefddd1516f7c | [log] [tgz] |
---|---|---|
author | David Peek <ninjascript@gmail.com> | Sun Mar 30 22:25:48 2014 |
committer | David Peek <ninjascript@gmail.com> | Sun Mar 30 22:25:48 2014 |
tree | f91e31708027360438a5304cb87e9ad1480cc38a | |
parent | b34168ec8ca4233206a1c4f9d2e1f1bb24ecaf73 [diff] | |
parent | 03369bc570ff798713fac434c2f1136b96925676 [diff] |
Merge pull request #13 from caffinatedmonkey/type_fix Fixed issue which makes a dartanalyzer warning
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)); }