markdown_prettier 0.1.0-alpha copy "markdown_prettier: ^0.1.0-alpha" to clipboard
markdown_prettier: ^0.1.0-alpha copied to clipboard

A Markdown prettier library written in Dart.

Markdown prettier #

A markdown prettier library written in Dart.

Usage #

Parse a string input #

import 'package:markdown_prettier/markdown_prettier.dart';

void main() {
  const text = '''
| abc | defghi |
:-: | -----------:
bar | baz
''';

  final result = MarkdownPrettier().parse(text);

  print(result);
}

output:

| abc | defghi |
| :-: | -----: |
| bar |    baz |

Parse a Markdown AST input #

import 'package:dart_markdown/dart_markdown.dart';
import 'package:markdown_prettier/markdown_prettier.dart';

void main() {
  const text = '''
| abc | defghi |
:-: | -----------:
bar | baz
''';

final nodes = Markdown().parse(text);
final result = MarkdownPrettier().parseNodes(nodes);

print(result);
}

Ues as a Markdown extension #

import 'package:dart_markdown/dart_markdown.dart';
import 'package:markdown_prettier/markdown_prettier.dart';

void main() {
  const text = '''
| abc | defghi |
:-: | -----------:
bar | baz
''';

  final nodes = Markdown().parse(text);
  final result = nodes.pretty();

  print(result);
}
2
likes
150
points
64
downloads

Publisher

verified publishertagnote.app

Weekly Downloads

A Markdown prettier library written in Dart.

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

dart_markdown, source_span

More

Packages that depend on markdown_prettier