HtmlToMarkdown.NodeContent (html_to_markdown v3.5.2)

Copy Markdown

The semantic content type of a document node.

Uses internally tagged representation ("node_type": "heading") for JSON serialization.

Summary

Types

A code block or inline code.

A definition list entry with term and description.

A definition list container.

A section grouping container (auto-generated from heading hierarchy).

A heading element (h1-h6).

An image element.

A single list item.

A list container (ordered or unordered). Children are ListItem nodes.

A block of key-value metadata pairs (from <head> meta tags).

A paragraph of text.

A block quote container.

A raw block preserved as-is (e.g. <script>, <style> content).

t()

The semantic content type of a document node.

A table with structured cell data.

Types

code()

@type code() :: %{type: :code, text: String.t(), language: String.t()}

A code block or inline code.

definition_item()

@type definition_item() :: %{
  type: :definition_item,
  term: String.t(),
  definition: String.t()
}

A definition list entry with term and description.

definition_list()

@type definition_list() :: :definition_list

A definition list container.

group()

@type group() :: %{
  type: :group,
  label: String.t(),
  heading_level: non_neg_integer(),
  heading_text: String.t()
}

A section grouping container (auto-generated from heading hierarchy).

heading()

@type heading() :: %{type: :heading, level: non_neg_integer(), text: String.t()}

A heading element (h1-h6).

image()

@type image() :: %{
  type: :image,
  description: String.t(),
  src: String.t(),
  image_index: non_neg_integer()
}

An image element.

list_item()

@type list_item() :: %{type: :list_item, text: String.t()}

A single list item.

list_variant()

@type list_variant() :: %{type: :list, ordered: boolean()}

A list container (ordered or unordered). Children are ListItem nodes.

metadata_block()

@type metadata_block() :: %{type: :metadata_block, entries: [[String.t()]]}

A block of key-value metadata pairs (from <head> meta tags).

paragraph()

@type paragraph() :: %{type: :paragraph, text: String.t()}

A paragraph of text.

quote()

@type quote() :: :quote

A block quote container.

raw_block()

@type raw_block() :: %{type: :raw_block, format: String.t(), content: String.t()}

A raw block preserved as-is (e.g. <script>, <style> content).

t()

@type t() :: term()

The semantic content type of a document node.

table()

@type table() :: %{type: :table, grid: HtmlToMarkdown.TableGrid.t()}

A table with structured cell data.