Include View and Effect modules in elm-application.json, and include @docs comments to make them valid.

This commit is contained in:
Dillon Kearns 2022-09-09 10:53:19 -07:00
parent 23cc852ecb
commit 67af0e53d0
4 changed files with 31 additions and 5 deletions

View File

@ -1,4 +1,10 @@
module Effect exposing (Effect(..), batch, fromCmd, map, none, perform)
module Effect exposing (Effect(..), none, batch, fromCmd, map, perform)
{-|
@docs Effect, none, batch, fromCmd, map, perform
-}
import Browser.Navigation
import Form.FormData exposing (FormData)
@ -8,6 +14,7 @@ import Pages.Fetcher
import Url exposing (Url)
{-| -}
type Effect msg
= None
| Cmd (Cmd msg)
@ -31,21 +38,25 @@ type alias RequestInfo =
}
{-| -}
none : Effect msg
none =
None
{-| -}
batch : List (Effect msg) -> Effect msg
batch =
Batch
{-| -}
fromCmd : Cmd msg -> Effect msg
fromCmd =
Cmd
{-| -}
map : (a -> b) -> Effect a -> Effect b
map fn effect =
case effect of
@ -82,6 +93,7 @@ map fn effect =
|> SubmitFetcher
{-| -}
perform :
{ fetchRouteData :
{ data : Maybe FormData

View File

@ -1,14 +1,22 @@
module View exposing (View, map, placeholder)
{-|
@docs View, map, placeholder
-}
import Html exposing (Html)
{-| -}
type alias View msg =
{ title : String
, body : List (Html msg)
}
{-| -}
map : (msg1 -> msg2) -> View msg1 -> View msg2
map fn doc =
{ title = doc.title
@ -16,6 +24,7 @@ map fn doc =
}
{-| -}
placeholder : String -> View msg
placeholder moduleName =
{ title = "Placeholder - " ++ moduleName

View File

@ -1,8 +1,11 @@
{
"name": "dmy/elm-doc-preview",
"summary": "Offline documentation previewer",
"version": "5.0.0",
"name": "user/elm-pages-local",
"summary": "elm-pages local generated module documentation",
"version": "1.0.0",
"exposed-modules": [
"Page"
"RouteBuilder",
"View",
"Effect",
"Route"
]
}

View File

@ -4,6 +4,8 @@
"version": "1.0.0",
"exposed-modules": [
"RouteBuilder",
"View",
"Effect",
"Route"
]
}