This is an alternative site for discovering Elm packages. You may be looking for the official Elm package site instead.
1.0.0 2.0.0

Lofi

A library for #lofi parsing

Types

type Element = Element { texts : List Text , mentions : List Mention , tags : Tags , items : List Element }

A #lofi element, representing a single line

type alias Text = String

Normal text to be displayed as-is

type alias Mention = KeyPath

A reference to an external resource

type alias KeyPath = List String

A list of keys used in @mentions

type alias Tags = Dict String TagValue

A collection of tags

type TagValue = Flag Bool | Content { texts : List Text, mentions : List Mention }

The value of a tag, either a boolean, or nested content

module Lofi exposing
  ( Element(..)
  , Text, Mention
  , KeyPath, Tags, TagValue(..)
  )

{-| A library for #lofi parsing

# Types
@docs Element, Text, Mention, KeyPath, Tags, TagValue

-}


import Dict exposing (Dict)


{-| Normal text to be displayed as-is -}
type alias Text = String

{-| A list of keys used in @mentions -}
type alias KeyPath = List String
{-| A reference to an external resource -}
type alias Mention = KeyPath

{-| The value of a tag, either a boolean, or nested content -}
type TagValue
  = Flag Bool
  | Content { texts : List Text, mentions : List Mention }
{-| A collection of tags -}
type alias Tags = Dict String TagValue

{-| A #lofi element, representing a single line -}
type Element =
  Element
  { texts : List Text
  , mentions : List Mention
  , tags : Tags
  , items : List Element
  }