mirror of
https://github.com/NoRedInk/noredink-ui.git
synced 2025-01-03 03:46:37 +03:00
aHA the html is also configurable and so needs to be passed through
This commit is contained in:
parent
84b21dc35a
commit
4bba00573e
@ -80,6 +80,7 @@ generateEllieLink example code =
|
||||
[]
|
||||
[ Url.Builder.string "title" example.name
|
||||
, Url.Builder.string "elmcode" (generateElmExampleModule example code)
|
||||
, Url.Builder.string "htmlcode" ellieHtmlSetup
|
||||
, -- TODO: a system will be required to keep these values in line with the elm json values
|
||||
Url.Builder.string "packages" "elm/core@1.0.5"
|
||||
, Url.Builder.string "packages" "elm/html@1.0.0"
|
||||
@ -99,6 +100,7 @@ generateElmExampleModule exampleData code =
|
||||
, "import Nri.Ui.UiIcon.V1 as UiIcon"
|
||||
, "import " ++ Example.fullName exampleData ++ " as " ++ exampleData.name
|
||||
, ""
|
||||
, "main : RootHtml.Html msg"
|
||||
, "main ="
|
||||
, " " ++ code
|
||||
, " |> toUnstyled"
|
||||
@ -107,6 +109,20 @@ generateElmExampleModule exampleData code =
|
||||
|> String.replace "\t" " "
|
||||
|
||||
|
||||
ellieHtmlSetup : String
|
||||
ellieHtmlSetup =
|
||||
"""
|
||||
<html> <head></head>
|
||||
<body>
|
||||
<main></main>
|
||||
<script>
|
||||
var app = Elm.Main.init({ node: document.querySelector('main') })
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
"""
|
||||
|
||||
|
||||
viewSection : String -> List (Html msg) -> Html msg
|
||||
viewSection name children =
|
||||
section [ css [ flex (int 1) ] ]
|
||||
|
Loading…
Reference in New Issue
Block a user