highlight 0.1.0

highlight #

Syntax highlighter for Dart developers.

Usage #

import 'package:highlight/highlight.dart';

main() {
  var input = '''main() {
  print("Hello, World!");
}
''';
  var h = Highlight();
  var result = h.parse(input);

  result.toHtml();
}

License #

MIT

0.1.0 #

  • First release

0.0.1 #

  • Initial version, created by Stagehand

example/highlight_example.dart

import 'package:highlight/highlight.dart';

main() {
  var input = '''main() {
  print("Hello, World!");
}  
''';
  var h = Highlight();
  var result = h.parse(input);

  result.toHtml();
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  highlight: ^0.1.0

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter pub get

Alternatively, your editor might support pub get or flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:highlight/highlight.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
0
Health:
Code health derived from static analysis. [more]
91
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
47
Learn more about scoring.

We analyzed this package on Aug 25, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.4.0
  • pana: 0.12.19

Platforms

Detected platforms: Flutter, web, other

No platform restriction found in primary library package:highlight/highlight.dart.

Health issues and suggestions

Document public APIs. (-0.81 points)

470 out of 473 API elements have no dartdoc comment.Providing good documentation for libraries, classes, functions, and other API elements improves code readability and helps developers find and use your API.

Fix lib/languages/accesslog.dart. (-0.50 points)

Analysis of lib/languages/accesslog.dart reported 1 hint:

line 4 col 8: Unused import: '../src/common_modes.dart'.

Fix lib/languages/clojure-repl.dart. (-0.50 points)

Analysis of lib/languages/clojure-repl.dart reported 1 hint:

line 4 col 8: Unused import: '../src/common_modes.dart'.

Fix lib/languages/csp.dart. (-0.50 points)

Analysis of lib/languages/csp.dart reported 1 hint:

line 4 col 8: Unused import: '../src/common_modes.dart'.

Fix additional 14 files with analysis or formatting issues. (-7 points)

Additional issues in the following files:

  • lib/languages/diff.dart (1 hint)
  • lib/languages/fix.dart (1 hint)
  • lib/languages/http.dart (1 hint)
  • lib/languages/inform7.dart (1 hint)
  • lib/languages/julia-repl.dart (1 hint)
  • lib/languages/leaf.dart (1 hint)
  • lib/languages/markdown.dart (1 hint)
  • lib/languages/mojolicious.dart (1 hint)
  • lib/languages/plaintext.dart (1 hint)
  • lib/languages/shell.dart (1 hint)
  • lib/languages/subunit.dart (1 hint)
  • lib/languages/taggerscript.dart (1 hint)
  • lib/languages/vbscript-html.dart (1 hint)
  • lib/languages/xquery.dart (1 hint)

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.3.0 <3.0.0
Dev dependencies
path ^1.6.0
pedantic ^1.7.0
test ^1.6.0