dart_prism 0.2.1 copy "dart_prism: ^0.2.1" to clipboard
dart_prism: ^0.2.1 copied to clipboard

A syntax highlighting library written in Dart, ported from PrismJS.

A syntax highlighting library written in Dart, ported from PrismJS.

Usage #

import 'package:dart_prism/dart_prism.dart';

void main() {
  final prism = Prism();

  // Parse text to AST nodes.
  final nodes = prism.parse('const name = "dart"', 'dart');

  // Render to an HTML string.
  final html = nodes.toHtml();

  print(html);
}
copied to clipboard

Development Tips #

Update language proto files #

./tool/update_languages.sh
copied to clipboard

Test coverage and update the per-test results #

Updating test cases and stats when changing the implementation:

dart tool/update_test_files.dart
copied to clipboard

It will update the test case files and output the test summary to test_cases_stats.txt.

2
likes
160
points
97
downloads

Publisher

verified publishertagnote.app

Weekly Downloads

2024.07.08 - 2025.01.20

A syntax highlighting library written in Dart, ported from PrismJS.

Repository (GitHub)

Documentation

API reference

License

MIT (license)

More

Packages that depend on dart_prism