1{-# LANGUAGE OverloadedStrings #-}
2{-# LANGUAGE QuasiQuotes #-}
9import qualified Data.ByteString.Builder as B
10import Data.Monoid ((<>))
11import qualified Data.Name as Name
12import Text.RawString.QQ (r)
19sandwich :: Name.Name -> B.Builder -> B.Builder
20sandwich moduleName javascript =
21 let name = Name.toBuilder moduleName in
25 <meta charset="UTF-8">
26 <title>|] <> name <> [r|</title>
30<div id="elm-f0111bc4e658d0f98db96260c16f7e49"></div>
32|] <> javascript <> [r|
34var app = Elm.|] <> name <> [r|.init({ node: document.getElementById("elm-f0111bc4e658d0f98db96260c16f7e49") });
35if (document.getElementById("elm-f0111bc4e658d0f98db96260c16f7e49"))
37 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