1{-# LANGUAGE OverloadedStrings #-}
2{-# LANGUAGE QuasiQuotes #-}
9import qualified Data.ByteString.Builder as B
10import Data.Monoid ((<>))
11import Text.RawString.QQ (r)
13import qualified Elm.Name as N
20sandwich :: N.Name -> B.Builder -> B.Builder
21sandwich moduleName javascript =
22 let name = N.toBuilder moduleName in
26 <meta charset="UTF-8">
27 <title>|] <> name <> [r|</title>
33|] <> javascript <> [r|
35// It is too complicated to figure out which kind of Program you created
36// based on only the code. So here we check for different possibilities.
38// When you embed compiled Elm into HTML yourself, you should not copy/paste
39// from here. Do just the part that makes sense for your application!
42 Elm.|] <> name <> [r|.fullscreen
43 ? Elm.|] <> name <> [r|.fullscreen()
45 Elm.|] <> name <> [r|.embed
46 ? Elm.|] <> name <> [r|.embed(document.getElementById('embed'))
48 Elm.|] <> name <> [r|.worker
49 ? (document.getElementById('embed').innerText = 'This is a headless program, meaning there is nothing to show here. I started the program anyway though, and you can access it as `app` in the developer console.', Elm.|] <> name <> [r|.worker())
50 : (document.getElementById('embed').innerText = 'I cannot figure out what kind of program this is supposed to be. Perhaps someone on Slack can help?', undefined);
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list