html_to_markdown_ffi library
html_to_markdown_ffi — typed HTML to Markdown conversion for the Zuraffa ecosystem (spec 064 migration of the standalone FFI package).
The zuraffa stack: a pure-Dart port (HtmlToMarkdownFfiPort), a facade
(HtmlToMarkdownFfiService), typed failures, and DI registration.
Platform adapters implement the port over an injected transport — the
shared envelope machinery lives in html_to_markdown_ffi_platform.
The preserved pre-migration public API remains import-compatible via
package:html_to_markdown_ffi/html_to_markdown.dart.
Classes
- $HtmConversion
- HtmConversion entity — one conversion request/result pair, identified by id (assigned per call by the service, mirroring the family's module-registry pattern).
- ConversionOptions
- ConversionResult
- GetHtmConversionUseCase
- HtmConversion
- HtmConversionFields
- Field descriptors for HtmConversion query construction
- HtmConversionPatch
- HtmConversionRepository
- HtmlMetadata
- Extracted HTML metadata from document head and body.
- HtmlToMarkdownFfiPort
- HtmlToMarkdownFfiService
- ImageMetadata
- LinkMetadata
- NativeHtmConversionDataSource
- Converts HTML to Markdown through the native bridge.
- NodeContext
- Context information passed to each visitor callback.
- PreprocessingOptions
- Preprocessing configuration for HTML cleanup before conversion.
- ProcessingWarning
- UnwiredHtmlToMarkdownFfiPort
-
A port placeholder registered when no platform adapter was wired:
every operation surfaces the typed
port_not_wiredfailure instead of a null dereference at resolve time. - Visitor
- Abstract visitor for intercepting HTML element processing.
Enums
- CodeBlockStyle
- Code block rendering style.
- HeadingStyle
- Supported heading styles.
- HighlightStyle
- Code highlighting style.
- HtmConversion$
- LinkStyle
- Link rendering style.
- ListIndentType
- List indentation type.
- NewlineStyle
- Line ending style.
- NodeType
- HTML node type for visitor context.
- OutputFormat
- Output format for the converted Markdown.
- PreprocessingPreset
- Preprocessing preset for input normalization.
- VisitResult
-
Result of a visitor callback.
continue_has underscore suffix becausecontinueis a reserved keyword in Dart. - WarningKind
- Processing warning category.
- WhitespaceMode
- Whitespace handling mode.
Extensions
Functions
-
buildConversionRequest(
String html, {required String id, ConversionOptions? options}) → HtmConversion - Builds the internal request entity for one conversion call.
-
conversionResultFromJson(
String resultJson) → ConversionResult - Wire-format helper: rebuilds the preserved public result from the bridge's result json payload.
-
optionsJsonOf(
ConversionOptions? options) → String - Wire-format helper: the options json payload for a convert call.
-
registerHtmlToMarkdownFfiDependencies(
GetIt getIt, {HtmlToMarkdownFfiPort? port}) → void -
Registers the html_to_markdown_ffi stack onto
getIt: the HtmlToMarkdownFfiPort is normally supplied by the platform adapter package for the running platform (e.g.registerMacosHtmlToMarkdownFfiDependencies), so the service falls back to the GetIt-registered port when no explicit one is passed. Without any registered port the service resolves over the datasource path (the preserved in-process bridge). -
toConversionResult(
HtmConversion done) → ConversionResult - Decodes the bridge's result json (stored on the entity by the datasource) back into the preserved public ConversionResult.
Exceptions / Errors
- HtmlToMarkdownFfiException
- The typed failure surfaced by the html_to_markdown_ffi port and service.