HtmlToMarkdown (html_to_markdown v3.4.0-rc.20)

Copy Markdown View Source

High-level API for html_to_markdown.

Summary

Functions

Apply a partial update to these conversion options.

Create a new builder with default values.

Create from a partial update, applying to defaults.

Build the final [ConversionOptions].

Set the list of CSS selectors for elements to exclude entirely from output.

Set the list of HTML tag names whose <img> children are kept inline.

Set the pre-processing options applied to the HTML before conversion.

Set the list of HTML tag names that are preserved verbatim in output.

Set the list of HTML tag names whose content is stripped from output.

Convert HTML to Markdown, returning a [ConversionResult] with content, metadata, images,

Convert HTML to Markdown, returning a [ConversionResult] with content, metadata, images,

Convert HTML to Markdown, returning a [ConversionResult] with content, metadata, images,

Validate that the header level is within valid range (1-6).

Classify a link based on href value.

Apply a partial update to these preprocessing options.

Create new preprocessing options from a partial update.

Functions

conversionoptions_apply_update(obj, update)

@spec conversionoptions_apply_update(map(), String.t() | nil) :: nil

Apply a partial update to these conversion options.

conversionoptions_builder()

@spec conversionoptions_builder() :: reference()

Create a new builder with default values.

conversionoptions_default()

@spec conversionoptions_default() :: String.t() | nil

Method

conversionoptions_from(update)

@spec conversionoptions_from(String.t() | nil) :: String.t() | nil

Method

conversionoptions_from_update(update)

@spec conversionoptions_from_update(String.t() | nil) :: String.t() | nil

Create from a partial update, applying to defaults.

conversionoptionsbuilder_build(obj)

@spec conversionoptionsbuilder_build(map()) :: String.t() | nil

Build the final [ConversionOptions].

conversionoptionsbuilder_exclude_selectors(obj, selectors)

@spec conversionoptionsbuilder_exclude_selectors(map(), [String.t()]) :: reference()

Set the list of CSS selectors for elements to exclude entirely from output.

conversionoptionsbuilder_keep_inline_images_in(obj, tags)

@spec conversionoptionsbuilder_keep_inline_images_in(map(), [String.t()]) ::
  reference()

Set the list of HTML tag names whose <img> children are kept inline.

conversionoptionsbuilder_preprocessing(obj, preprocessing)

@spec conversionoptionsbuilder_preprocessing(map(), String.t() | nil) :: reference()

Set the pre-processing options applied to the HTML before conversion.

conversionoptionsbuilder_preserve_tags(obj, tags)

@spec conversionoptionsbuilder_preserve_tags(map(), [String.t()]) :: reference()

Set the list of HTML tag names that are preserved verbatim in output.

conversionoptionsbuilder_strip_tags(obj, tags)

@spec conversionoptionsbuilder_strip_tags(map(), [String.t()]) :: reference()

Set the list of HTML tag names whose content is stripped from output.

convert(html)

@spec convert(String.t()) :: {:ok, String.t() | nil} | {:error, String.t()}

Convert HTML to Markdown, returning a [ConversionResult] with content, metadata, images,

convert(html, options)

@spec convert(String.t(), String.t() | nil) ::
  {:ok, String.t() | nil} | {:error, String.t()}

Convert HTML to Markdown, returning a [ConversionResult] with content, metadata, images,

convert(html, options, visitor)

@spec convert(String.t(), String.t() | nil, String.t() | nil) ::
  {:ok, String.t() | nil} | {:error, String.t()}
@spec convert(String.t(), String.t() | nil, String.t() | nil) ::
  {:ok, String.t() | nil} | {:error, String.t()}

Convert HTML to Markdown, returning a [ConversionResult] with content, metadata, images,

headermetadata_is_valid(obj)

@spec headermetadata_is_valid(map()) :: boolean()

Validate that the header level is within valid range (1-6).

linkmetadata_classify_link(href)

@spec linkmetadata_classify_link(String.t()) :: map()

Classify a link based on href value.

preprocessingoptions_apply_update(obj, update)

@spec preprocessingoptions_apply_update(map(), String.t() | nil) :: nil

Apply a partial update to these preprocessing options.

preprocessingoptions_default()

@spec preprocessingoptions_default() :: String.t() | nil

Method

preprocessingoptions_from(update)

@spec preprocessingoptions_from(String.t() | nil) :: String.t() | nil

Method

preprocessingoptions_from_update(update)

@spec preprocessingoptions_from_update(String.t() | nil) :: String.t() | nil

Create new preprocessing options from a partial update.