html_to_markdown_ffi
Typed HTML to Markdown conversion for the Zuraffa ecosystem: a Rust FFI core behind a pure-Dart converter port with federated native adapters.
Use
Preserved public API (pre-migration compatible)
import 'package:html_to_markdown_ffi/html_to_markdown.dart';
final md = convert('<h1>Title</h1>');
// md.content == '# Title'
Zuraffa stack
import 'package:html_to_markdown_ffi/html_to_markdown_ffi.dart';
final service = HtmlToMarkdownFfiService.native(); // in-process bridge
final result = await service.convertAsync('<h1>Title</h1>');
Or register the stack on GetIt and wire a platform adapter's port for the running platform:
final getIt = GetIt.instance;
registerHtmlToMarkdownFfiDependencies(getIt, port: myPlatformPort);
final service = getIt<HtmlToMarkdownFfiService>();
Platform adapters
This package is pure Dart: it asks for no Flutter SDK, so a consumer that is not a Flutter app — a CLI, a server, a background worker — can resolve it with a plain Dart SDK and no project-file change:
dependencies:
html_to_markdown_ffi: ^1.2.7
The native library ships inside the package for macOS
(html_to_markdown_ffi_platform/native/macos-<rid>/), so a plain-Dart
consumer resolves it with no setup at all — no environment variable, no
cache, no download, on a machine that has never run a setup step.
On a platform with no bundled artifact (Linux, Windows),
NativeLibrary.downloadIfNeeded() fetches the matching GitHub release asset
into ~/.html_to_markdown_ffi/:
import 'package:html_to_markdown_ffi/html_to_markdown.dart';
await NativeLibrary.downloadIfNeeded();
final md = convert('<h1>Title</h1>');
A Flutter app depends on
html_to_markdown_ffi_flutter
instead. That package is the plugin: it names the three adapters as their
platform's default_package, so the prebuilt native binary is linked into
the app, and it re-exports this package's API under one name:
import 'package:html_to_markdown_ffi_flutter/html_to_markdown_ffi_flutter.dart';
registerMacosHtmlToMarkdownFfiDependencies(
getIt,
channel: MacosHtmlToMarkdownFfiChannel.native(),
);
html_to_markdown_ffi_flutter— the Flutter pluginhtml_to_markdown_ffi_androidhtml_to_markdown_ffi_ioshtml_to_markdown_ffi_macos
The shared envelope machinery lives in
html_to_markdown_ffi_platform.
Libraries
- convert
- html_to_markdown
- High-performance HTML to Markdown converter for Dart and Flutter.
- html_to_markdown_ffi
- html_to_markdown_ffi — typed HTML to Markdown conversion for the Zuraffa ecosystem (spec 064 migration of the standalone FFI package).
- native_library
- Compatibility library for the pre-migration import path
package:html_to_markdown_ffi/native_library.dart.