# `MDExNative.Comrak.Document`
[🔗](https://github.com/leandrocp/mdex_native/blob/v0.3.0/lib/mdex_native/comrak/document.ex#L34)

Root of a parsed Comrak Markdown document.

A document contains the block and inline nodes produced by
`MDExNative.Comrak.parse_document/2`. Nodes containing child nodes expose
them through their `:nodes` field, while every parsed node includes its
original `MDExNative.Comrak.Sourcepos`.

## Example

    MDExNative.Comrak.parse_document!("# Hello")
    %MDExNative.Comrak.Document{
      nodes: [
        %MDExNative.Comrak.Heading{
          nodes: [%MDExNative.Comrak.Text{literal: "Hello"}],
          level: 1
        }
      ]
    }

Documents may be built or changed using the node structs in the
`MDExNative.Comrak` namespace, then rendered with
`MDExNative.Comrak.document_to_html/2`,
`MDExNative.Comrak.document_to_commonmark/2`, or
`MDExNative.Comrak.document_to_xml/2`.

# `t`

```elixir
@type t() :: %MDExNative.Comrak.Document{
  nodes: [MDExNative.Comrak.ast_node()],
  sourcepos: MDExNative.Comrak.Sourcepos.t()
}
```

---

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