LLM docs

Markdown

Markdown

Content values

all : Parser String.Utf8 (List Markdown)

heading : Parser String.Utf8 Markdown

Headings

expect String.parseStr heading "# Foo Bar" == Ok (Heading One "Foo Bar")
expect String.parseStr heading "Foo Bar\n---" == Ok (Heading Two "Foo Bar")

link : Parser String.Utf8 Markdown

Links

expect String.parseStr link "[roc](https://roc-lang.org)" == Ok (Link "roc" "https://roc-lang.org")

image : Parser String.Utf8 Markdown

Images

expect String.parseStr image "![alt text](/images/logo.png)" == Ok (Image "alt text" "/images/logo.png")

code : Parser String.Utf8 Markdown

Parse code blocks using triple backticks supports block extension e.g. ```roc

expect
    text =
        """
        ```roc
        # some code
        foo = bar
        ```
        """

    a = String.parseStr code text
    a == Ok (Code { ext: "roc", pre: "# some code\nfoo = bar\n" })