Show documentation page v2

json-docs
Bram 2024-04-10 08:00:21 +02:00
parent 6541a67882
commit ea497eae20
3 changed files with 42 additions and 0 deletions

View File

@ -86,12 +86,18 @@ bfs queue acc =
DocsInt -> DocsInt ->
bfs tail acc bfs tail acc
DocsIntDict d ->
bfs (d :: tail) acc
DocsLazy f -> DocsLazy f ->
bfs (f () :: tail) acc bfs (f () :: tail) acc
DocsList d -> DocsList d ->
bfs (d :: tail) acc bfs (d :: tail) acc
DocsListWithOne d ->
bfs (d :: tail) acc
DocsMap { content } -> DocsMap { content } ->
bfs (content :: tail) acc bfs (content :: tail) acc
@ -110,6 +116,9 @@ bfs queue acc =
DocsRiskyMap { content } -> DocsRiskyMap { content } ->
bfs (content :: tail) acc bfs (content :: tail) acc
DocsSet d ->
bfs (d :: tail) acc
DocsString -> DocsString ->
bfs tail acc bfs tail acc
@ -285,12 +294,18 @@ getFunctionBFS docs acc =
DocsInt -> DocsInt ->
acc acc
DocsIntDict d ->
getFunctionBFS d acc
DocsLazy f -> DocsLazy f ->
getFunctionBFS (f ()) acc getFunctionBFS (f ()) acc
DocsList d -> DocsList d ->
getFunctionBFS d acc getFunctionBFS d acc
DocsListWithOne d ->
getFunctionBFS d acc
DocsMap { name, description, content } -> DocsMap { name, description, content } ->
getFunctionBFS getFunctionBFS
content content
@ -307,6 +322,9 @@ getFunctionBFS docs acc =
content content
(List.append acc [ { name = name, description = description } ]) (List.append acc [ { name = name, description = description } ])
DocsSet d ->
getFunctionBFS d acc
DocsString -> DocsString ->
acc acc
@ -338,6 +356,13 @@ toString =
DocsInt -> DocsInt ->
[ Element.text "int" ] [ Element.text "int" ]
DocsIntDict d ->
List.concat
[ [ Element.text "{int:" ]
, go d
, [ Element.text "}" ]
]
DocsLazy f -> DocsLazy f ->
go (f ()) go (f ())
@ -348,6 +373,13 @@ toString =
, [ Element.text "]" ] , [ Element.text "]" ]
] ]
DocsListWithOne d ->
List.concat
[ [ Element.text "[" ]
, go d
, [ Element.text "]" ]
]
DocsMap { name, content } -> DocsMap { name, content } ->
List.concat List.concat
[ [ Element.text name, Element.text "(" ] [ [ Element.text name, Element.text "(" ]
@ -372,6 +404,13 @@ toString =
, [ Element.text ")" ] , [ Element.text ")" ]
] ]
DocsSet content ->
List.concat
[ [ Element.text "set(" ]
, go content
, [ Element.text ")" ]
]
DocsString -> DocsString ->
[ Element.text "string" ] [ Element.text "string" ]

View File

@ -22,6 +22,7 @@ import Internal.Values.Envelope
import Internal.Values.Event import Internal.Values.Event
import Internal.Values.Settings import Internal.Values.Settings
import Internal.Values.StateManager import Internal.Values.StateManager
import Internal.Values.Timeline
import Json.Decode as D import Json.Decode as D
import Route exposing (Route(..)) import Route exposing (Route(..))
import Task import Task
@ -52,6 +53,7 @@ coders =
, ( "Mashdict", shapeCoder <| Internal.Tools.Mashdict.coder .stateKey Internal.Values.Event.coder ) , ( "Mashdict", shapeCoder <| Internal.Tools.Mashdict.coder .stateKey Internal.Values.Event.coder )
, ( "Settings", shapeCoder <| Internal.Values.Settings.coder ) , ( "Settings", shapeCoder <| Internal.Values.Settings.coder )
, ( "StateManager", shapeCoder <| Internal.Values.StateManager.coder ) , ( "StateManager", shapeCoder <| Internal.Values.StateManager.coder )
, ( "Timeline", shapeCoder <| Internal.Values.Timeline.coder )
, ( "Timestamp", shapeCoder <| Internal.Tools.Timestamp.coder ) , ( "Timestamp", shapeCoder <| Internal.Tools.Timestamp.coder )
] ]

View File

@ -17,6 +17,7 @@
"elm/time": "1.0.0", "elm/time": "1.0.0",
"elm/url": "1.0.0", "elm/url": "1.0.0",
"mdgriffith/elm-ui": "1.1.8", "mdgriffith/elm-ui": "1.1.8",
"micahhahn/elm-safe-recursion": "2.0.0",
"miniBill/elm-fast-dict": "1.1.0" "miniBill/elm-fast-dict": "1.1.0"
}, },
"indirect": { "indirect": {