commit | ee1dc51f5cfb4d143c232aa99336180bdaa5c428 | [log] [tgz] |
---|---|---|
author | Daniel Schubert <daniel.schubert+bitbucket.org@gmail.com> | Sun May 12 00:08:46 2013 +0200 |
committer | Daniel Schubert <daniel.schubert+bitbucket.org@gmail.com> | Sun May 12 00:08:46 2013 +0200 |
tree | 1805883427f6522703babe4d3de9f5255af4c6ce | |
parent | 158aa40e1a3fa191a0a29f6c89a3f1bfcd8b3992 [diff] |
Add fenced code block tests
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)); }