1{-# LANGUAGE OverloadedStrings #-}
2module Generate.Html (generate, JSSource(..)) where
4import Text.Blaze (preEscapedToMarkup)
5import qualified Text.Blaze.Html5 as H
6import Text.Blaze.Html5 ((!))
7import qualified Text.Blaze.Html5.Attributes as A
8import qualified Data.ByteString.Lazy.Char8 as BS
10data JSSource = Link String | Source BS.ByteString
12makeScript :: JSSource -> H.Html
15 Link src -> H.script ! A.type_ "text/javascript" ! A.src (H.toValue src) $ ""
17 H.script ! A.type_ "text/javascript" $
18 preEscapedToMarkup $ BS.unpack src
20generate :: JSSource -> String -> [JSSource] -> String -> String -> H.Html
21generate runtime title scripts moduleName noscript =
24 H.meta ! A.charset "UTF-8"
25 H.title . H.toHtml $ title
27 mapM_ makeScript scripts
29 H.script ! A.type_ "text/javascript" $
30 preEscapedToMarkup ("Elm.fullscreen(Elm." ++ moduleName ++ ")")
31 H.noscript $ preEscapedToMarkup noscript
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