Updated README and bumped to 0.4.0
2 files changed
tree: 05f722f8945f337995168a30f89a007b7a60070e
  1. lib/
  2. test/
  3. .gitignore
  4. AUTHORS
  5. LICENSE
  6. pubspec.yaml
  7. README.md
README.md

dartdoc markdown library

This is a standalone version of the dartdoc markdown library. It parses markdown and converts it to HTML.

Installation

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

Usage

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 callback:

import 'package:markdown/markdown.dart' show markdownToHtml;

main() {
  print(markdownToHtml("Hello *Markdown*"), (syntax, source) {
    if (syntax == 'mysyntax') return classifySyntax(source);
    return source;
  });
}

String classifySyntax(String source) {
	return '<span class="mysyntax">$source</span>';
}