arowM/elm-markdown-ast/1.0.0

NOTE: the latest version is 1.0.6

Rerouted (regenerated, verified). Same repository and tag, but GitHub now builds the zip with different bytes, so it no longer matches the SHA-1 package.elm-lang.org recorded. The Lamdera package server serves a copy recovered from https://github.com/arowM/elm-markdown-ast.

What we checked: Rebuilt with git archive from commit c3aad78c37a3 of https://github.com/arowM/elm-markdown-ast (zip prefix arowM-elm-markdown-ast-f03a691/, America/Los_Angeles times, the tag object f03a69160148 it had before it was re-made, tagger time 2023-03-19 09:20 UTC): the zip is byte-identical to the one package.elm-lang.org recorded, SHA-1 546187a2cf5d5b7dd7113156d05631ff46a4f1df.

The Lamdera compiler uses this copy and prints a one-line notice saying so. elm itself fails to download this version.

Details · package.elm-lang.org's zip: https://github.com/arowM/elm-markdown-ast/zipball/1.0.0/

MarkdownAst

This module provides abstruct syntax tree for markdown.

-- Structure

type Section
= Section
{ title : String
, body : List BlockElement
, children : List Section
}

Represents markdown section.

# Title for Root Section


Paragraph text in root section body.


Another paragraph text in root section body.


* List item in root section body
* Another list item in root section body


## Title for Child Section


Paragraph text in child section body.


```json
{
  "message": "Code block in child section body."
}
```


## Title for Another Child Section


Paragraph text in another child section body.


1. Ordered list item in another child section body
1. Another ordered list item in another child section body
= ParagraphBlock (List InlineElement)
| ListBlock
{ ordered : Bool
, items : List ListItem
}
| CodeBlock String
| QuoteBlock (List BlockElement)
= PlainText String
| Link
{ href : String
, text : String
, title : Maybe String
}
| Image
{ src : String
, alt : String
, title : Maybe String
}
| InlineCode String
| Emphasis String
| StrongEmphasis String
| Strikethrough String
| LineBreak
type alias ListItem =
{ content : List InlineElement
, children : List BlockElement
}

Represents an item in the ListBlock.

* First `ListItem` content for this unordered `ListBlock`
    Child element for the first `ListItem`.

    1. This `ListItem` is in the child `ListBlock` for the First `ListItem` content.
    1. This `ListItem` is also in the child `ListBlock` for the First `ListItem` content.

* Second `ListItem` content for this unordered `ListBlock`

-- Render

render : Section -> String

Render Section as markdown text.

preview : Section -> Html msg

Preview markdown content as an HTML page.