Skip to content

tagnote-app/markdown_prettier

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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);
}

About

A markdown prettier library written in Dart.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages