Skip to main content

html_to_markdown_ffi 1.2.4 copy "html_to_markdown_ffi: ^1.2.4" to clipboard
html_to_markdown_ffi: ^1.2.4 copied to clipboard

Typed HTML to Markdown conversion for the Zuraffa ecosystem: a Rust FFI core behind a pure-Dart converter port with federated native adapters.

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 #

You do not have to declare an adapter yourself: this package declares default_package for android, ios and macos, so depending on html_to_markdown_ffi alone is enough — Flutter resolves the adapter for the platform you build for, and the adapter bundles the prebuilt native binary and registers the port.

The adapters are also re-exported here, so their registration helpers are reachable from this one import:

import 'package:html_to_markdown_ffi/html_to_markdown_ffi.dart';

registerMacosHtmlToMarkdownFfiDependencies(
  getIt,
  channel: MacosHtmlToMarkdownFfiChannel.native(),
);

The shared envelope machinery lives in html_to_markdown_ffi_platform.