# `OpenrelikWorkerCommon.Reporting.MarkdownDocument`
[🔗](https://github.com/hacktobeer/openrelik-worker-common-elixir/blob/v0.1.0/lib/openrelik_worker_common/reporting.ex#L317)

Represents a Markdown document (`openrelik_worker_common.reporting.MarkdownDocument`).

# `t`

```elixir
@type t() :: %OpenrelikWorkerCommon.Reporting.MarkdownDocument{
  fmt: OpenrelikWorkerCommon.Reporting.MarkdownFormatter.t(),
  priority: OpenrelikWorkerCommon.Reporting.Priority.t(),
  sections: [OpenrelikWorkerCommon.Reporting.MarkdownDocumentSection.t()],
  summary: String.t(),
  title: String.t() | nil
}
```

# `add_section`

```elixir
@spec add_section(t()) ::
  {t(), OpenrelikWorkerCommon.Reporting.MarkdownDocumentSection.t()}
```

Adds a section to the document.

When called with just `document`, appends an empty `%MarkdownDocumentSection{}` and returns
`{updated_document, new_section}` or, if passed a `%MarkdownDocumentSection{}` or builder
function `(section -> section)`, appends the populated section and returns `updated_document`.

# `add_section`

```elixir
@spec add_section(
  t(),
  OpenrelikWorkerCommon.Reporting.MarkdownDocumentSection.t()
  | (OpenrelikWorkerCommon.Reporting.MarkdownDocumentSection.t() -&gt;
       OpenrelikWorkerCommon.Reporting.MarkdownDocumentSection.t())
) :: t()
```

# `new`

```elixir
@spec new(String.t() | nil) :: t()
```

Initializes a `MarkdownDocument` struct.

# `to_dict`

```elixir
@spec to_dict(t()) :: %{required(String.t()) =&gt; term()}
```

Generates a dictionary (string-keyed map) representation of the document.

# `to_json`

```elixir
@spec to_json(t()) :: String.t()
```

Generates a JSON representation of the document.

# `to_markdown`

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

Generates a Markdown representation of the document.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
