highlighting 0.9.0+11.8.0 highlighting: ^0.9.0+11.8.0 copied to clipboard
Syntax highlighting for Dart with lots of languages and themes support.
import 'package:highlighting/highlighting.dart';
import 'package:highlighting/languages/dart.dart';
void main() {
final source = '''main() {
print('Highlighting by Akvelon.');
}
''';
highlight.registerLanguage(dart);
final highlighted = highlight.parse(source, languageId: dart.id);
final html = highlighted.toHtml();
print(html); // HTML string
}