highlight 0.4.0 copy "highlight: ^0.4.0" to clipboard
highlight: ^0.4.0 copied to clipboard

outdated

Syntax highlighting for Dart with lots of languages and themes support.

highlight #

pub

Syntax highlighter for Dart developers.

If you are looking for syntax highlight widget for Flutter, see flutter_highlight.

Usage #

import 'package:highlight/highlight.dart' as highlight;

main() {
  var source = '''main() {
  print("Hello, World!");
}
''';

  // Parse source code and returns a highlight [Result] which contains relevance and tree nodes
  var result = highlight.parse(source, language: 'dart');

  // Output HTML string, which has highlight.js style class name, hljs-
  var html = result.toHtml();
  print(html);
}

References #

License #

MIT

50
likes
0
pub points
95%
popularity

Publisher

unverified uploader

Syntax highlighting for Dart with lots of languages and themes support.

Repository (GitHub)
View/report issues

License

unknown (license)

More

Packages that depend on highlight