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>
31<div id="elm-f0111bc4e658d0f98db96260c16f7e49"></div>
33|] <> javascript <> [r|
35var app = Elm.|] <> name <> [r|.init({ node: document.getElementById("elm-f0111bc4e658d0f98db96260c16f7e49") });
36if (document.getElementById("elm-f0111bc4e658d0f98db96260c16f7e49"))
38 document.getElementById("elm-f0111bc4e658d0f98db96260c16f7e49").innerText = 'This is a headless program, meaning there is nothing to show here.\n\nI started the program anyway though, and you can access it as `app` in the developer console.';
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