OpenrelikWorkerCommon.Reporting.MarkdownDocumentSection (openrelik_worker_common v0.1.0)

Copy Markdown View Source

Represents a section of a Markdown document (openrelik_worker_common.reporting.MarkdownDocumentSection).

Summary

Functions

Adds text formatted as a blockquote to the section.

Adds a bullet point to the section.

Adds text formatted as inline code to the section.

Adds text formatted as a code block to the section.

Adds a header to the section.

Adds a horizontal rule to the section.

Adds text formatted as a paragraph to the section.

Adds a MarkdownTable to the section.

Initializes a MarkdownDocumentSection struct.

Generates a Markdown representation of the section.

Types

t()

@type t() :: %OpenrelikWorkerCommon.Reporting.MarkdownDocumentSection{
  content: [String.t()],
  fmt: OpenrelikWorkerCommon.Reporting.MarkdownFormatter.t()
}

Functions

add_blockquote(section, text)

@spec add_blockquote(t(), String.t()) :: t()

Adds text formatted as a blockquote to the section.

add_bullet(section, text, opts_or_level \\ 1)

@spec add_bullet(t(), String.t(), keyword() | integer()) :: t()

Adds a bullet point to the section.

add_code(section, text)

@spec add_code(t(), String.t()) :: t()

Adds text formatted as inline code to the section.

add_code_block(section, text)

@spec add_code_block(t(), String.t()) :: t()

Adds text formatted as a code block to the section.

add_header(section, text, opts_or_level \\ 2)

@spec add_header(t(), String.t(), keyword() | integer()) :: t()

Adds a header to the section.

add_horizontal_rule(section)

@spec add_horizontal_rule(t()) :: t()

Adds a horizontal rule to the section.

add_paragraph(section, text)

@spec add_paragraph(t(), String.t()) :: t()

Adds text formatted as a paragraph to the section.

add_table(section, table)

Adds a MarkdownTable to the section.

new()

@spec new() :: t()

Initializes a MarkdownDocumentSection struct.

to_markdown(markdown_document_section)

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

Generates a Markdown representation of the section.