highlights_plugin 0.2.0 highlights_plugin: ^0.2.0 copied to clipboard
Dart implementation of highlights syntax highlighting engine.
highlights_plugin #
Dart implementation of highlights KMP engine:
https://github.com/SnipMeDev/Highlights
Installation #
flutter pub add highlights_plugin
Usage #
final plugin = HighlightsPlugin(debug: true);
// ['kotlin', 'dart', 'swift', 'php', 'java', ...]
final languages = await plugin.getLanguages();
// ['monokai', 'darcula', 'notepad', ...]
final themes = await plugin.getThemes();
// Bold Hello
final emphasis = PhraseLocation(start: 3, length: 8);
// List with ColorHighlight or BoldHighlight
final result = await plugin.getHighlights(
'// Hello, World!',
languages.first,
themes.first,
[emphasis],
);
Features #
- 17 supported languages (Kotlin, Dart, Swift, PHP, etc)
- Light / dark mode
- 6 built-in themes
- Phrase bolding (emphasis)
- Result caching and support for incremental changes
Support #
- Android β
- iOS β
- macOS π΄ (Not yet)
- Linux π΄ (Not yet)
- Windows π΄ (Not yet)
- Web π΄ (Not yet)
License ποΈ #
Copyright 2024 Tomasz KΔ
dzioΕka.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.