From ea497eae200b6aca84fe322fe3ae97d959dd09a6 Mon Sep 17 00:00:00 2001 From: Bram Date: Wed, 10 Apr 2024 08:00:21 +0200 Subject: [PATCH] Show documentation page v2 --- dev/DocsDisplay.elm | 39 +++++++++++++++++++++++++++++++++++++++ dev/Main.elm | 2 ++ elm-dev.json | 1 + 3 files changed, 42 insertions(+) diff --git a/dev/DocsDisplay.elm b/dev/DocsDisplay.elm index 56d0fbb..84b3f5b 100644 --- a/dev/DocsDisplay.elm +++ b/dev/DocsDisplay.elm @@ -85,12 +85,18 @@ bfs queue acc = DocsInt -> bfs tail acc + + DocsIntDict d -> + bfs (d :: tail) acc DocsLazy f -> bfs (f () :: tail) acc DocsList d -> bfs (d :: tail) acc + + DocsListWithOne d -> + bfs (d :: tail) acc DocsMap { content } -> bfs (content :: tail) acc @@ -109,6 +115,9 @@ bfs queue acc = DocsRiskyMap { content } -> bfs (content :: tail) acc + + DocsSet d -> + bfs (d :: tail) acc DocsString -> bfs tail acc @@ -284,12 +293,18 @@ getFunctionBFS docs acc = DocsInt -> acc + + DocsIntDict d -> + getFunctionBFS d acc DocsLazy f -> getFunctionBFS (f ()) acc DocsList d -> getFunctionBFS d acc + + DocsListWithOne d -> + getFunctionBFS d acc DocsMap { name, description, content } -> getFunctionBFS @@ -306,6 +321,9 @@ getFunctionBFS docs acc = getFunctionBFS content (List.append acc [ { name = name, description = description } ]) + + DocsSet d -> + getFunctionBFS d acc DocsString -> acc @@ -337,6 +355,13 @@ toString = DocsInt -> [ Element.text "int" ] + + DocsIntDict d -> + List.concat + [ [ Element.text "{int:" ] + , go d + , [ Element.text "}" ] + ] DocsLazy f -> go (f ()) @@ -347,6 +372,13 @@ toString = , go d , [ Element.text "]" ] ] + + DocsListWithOne d -> + List.concat + [ [ Element.text "[" ] + , go d + , [ Element.text "]" ] + ] DocsMap { name, content } -> List.concat @@ -371,6 +403,13 @@ toString = , go content , [ Element.text ")" ] ] + + DocsSet content -> + List.concat + [ [ Element.text "set(" ] + , go content + , [ Element.text ")" ] + ] DocsString -> [ Element.text "string" ] diff --git a/dev/Main.elm b/dev/Main.elm index 19b049c..5ee6979 100644 --- a/dev/Main.elm +++ b/dev/Main.elm @@ -22,6 +22,7 @@ import Internal.Values.Envelope import Internal.Values.Event import Internal.Values.Settings import Internal.Values.StateManager +import Internal.Values.Timeline import Json.Decode as D import Route exposing (Route(..)) import Task @@ -52,6 +53,7 @@ coders = , ( "Mashdict", shapeCoder <| Internal.Tools.Mashdict.coder .stateKey Internal.Values.Event.coder ) , ( "Settings", shapeCoder <| Internal.Values.Settings.coder ) , ( "StateManager", shapeCoder <| Internal.Values.StateManager.coder ) + , ( "Timeline", shapeCoder <| Internal.Values.Timeline.coder ) , ( "Timestamp", shapeCoder <| Internal.Tools.Timestamp.coder ) ] diff --git a/elm-dev.json b/elm-dev.json index 5a258c9..6ce8972 100644 --- a/elm-dev.json +++ b/elm-dev.json @@ -17,6 +17,7 @@ "elm/time": "1.0.0", "elm/url": "1.0.0", "mdgriffith/elm-ui": "1.1.8", + "micahhahn/elm-safe-recursion": "2.0.0", "miniBill/elm-fast-dict": "1.1.0" }, "indirect": {