Skip to content

Commit

Permalink
Show documentation page v2
Browse files Browse the repository at this point in the history
  • Loading branch information
BramvdnHeuvel committed Apr 10, 2024
1 parent 6541a67 commit ea497ea
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 0 deletions.
39 changes: 39 additions & 0 deletions dev/DocsDisplay.elm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -109,6 +115,9 @@ bfs queue acc =

DocsRiskyMap { content } ->
bfs (content :: tail) acc

DocsSet d ->
bfs (d :: tail) acc

DocsString ->
bfs tail acc
Expand Down Expand Up @@ -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
Expand All @@ -306,6 +321,9 @@ getFunctionBFS docs acc =
getFunctionBFS
content
(List.append acc [ { name = name, description = description } ])

DocsSet d ->
getFunctionBFS d acc

DocsString ->
acc
Expand Down Expand Up @@ -337,6 +355,13 @@ toString =

DocsInt ->
[ Element.text "int" ]

DocsIntDict d ->
List.concat
[ [ Element.text "{int:" ]
, go d
, [ Element.text "}" ]
]

DocsLazy f ->
go (f ())
Expand All @@ -347,6 +372,13 @@ toString =
, go d
, [ Element.text "]" ]
]

DocsListWithOne d ->
List.concat
[ [ Element.text "[" ]
, go d
, [ Element.text "]" ]
]

DocsMap { name, content } ->
List.concat
Expand All @@ -371,6 +403,13 @@ toString =
, go content
, [ Element.text ")" ]
]

DocsSet content ->
List.concat
[ [ Element.text "set(" ]
, go content
, [ Element.text ")" ]
]

DocsString ->
[ Element.text "string" ]
Expand Down
2 changes: 2 additions & 0 deletions dev/Main.elm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 )
]

Expand Down
1 change: 1 addition & 0 deletions elm-dev.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down

0 comments on commit ea497ea

Please sign in to comment.