Last updated:
0 purchases
markdown prettier
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);
}
copied to clipboard
output:
| abc | defghi |
| :-: | -----: |
| bar | baz |
copied to clipboard
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);
}
copied to clipboard
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);
}
copied to clipboard
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.