OpenrelikWorkerCommon.Reporting.MarkdownTable (openrelik_worker_common v0.1.0)

Copy Markdown View Source

Represents a Markdown table (openrelik_worker_common.reporting.MarkdownTable).

Summary

Functions

Adds a row of data to the table.

Initializes a MarkdownTable struct with the given column names.

Generates a Markdown representation of the table.

Types

t()

@type t() :: %OpenrelikWorkerCommon.Reporting.MarkdownTable{
  columns: [String.t()],
  rows: [[String.t()]]
}

Functions

add_row(table, row_data)

@spec add_row(t(), [String.t()]) :: t()

Adds a row of data to the table.

Raises ArgumentError if the number of elements in row_data does not match table.columns.

new(columns)

@spec new([String.t()]) :: t()

Initializes a MarkdownTable struct with the given column names.

to_markdown(markdown_table)

@spec to_markdown(t()) :: String.t()

Generates a Markdown representation of the table.