1{-# OPTIONS_GHC -Wall #-}
2{-# LANGUAGE OverloadedStrings #-}
3module Develop.Generate.Help
10import Text.Blaze.Html5 ((!))
11import qualified Text.Blaze.Html5 as H
12import qualified Text.Blaze.Html5.Attributes as A
14import qualified Develop.StaticFiles as StaticFiles
21makeHtml :: String -> String -> String -> H.Html
22makeHtml title jsFile initCode =
25 H.meta ! A.charset "UTF-8"
26 H.title $ H.toHtml title
30 ! A.href (H.toValue ("/" ++ StaticFiles.cssPath))
31 H.script ! A.src (H.toValue jsFile) $ ""
34 H.script $ H.preEscapedToMarkup initCode
41makeCodeHtml :: String -> String -> H.Html
42makeCodeHtml title code =
45 H.meta ! A.charset "UTF-8"
46 H.title $ H.toHtml title
47 H.style ! A.type_ "text/css" $ codeStyle
49 H.link ! A.rel "stylesheet" ! A.href "//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.3.0/styles/default.min.css"
50 H.script ! A.src "//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.3.0/highlight.min.js" $ ""
51 H.script $ "if (hljs) { hljs.initHighlightingOnLoad(); }"
53 H.body ! A.style "background-color: #F0F0F0;" $ do
54 H.pre $ H.code $ H.toHtml code
60 [ "html, head, body, pre {"
65 , " font-family: 'Source Code Pro', monospace;"
74makeElmHtml :: FilePath -> H.Html
78 H.meta ! A.charset "UTF-8"
79 H.title $ H.toHtml ("~/" ++ filePath)
80 H.style ! A.type_ "text/css" $ elmStyle
83 H.div ! A.style waitingStyle $ do
84 H.div ! A.style "font-size: 3em;" $ "Building your project!"
85 H.img ! A.src (H.toValue StaticFiles.waitingPath)
86 H.div ! A.style "font-size: 1em" $ "With new projects, I need a bunch of extra time to download packages."
88 H.script ! A.src (H.toValue ("/_compile/" ++ filePath)) ! A.charset "utf-8" $ ""
89 H.script $ H.preEscapedToMarkup $ unlines $
90 [ "while (document.body.firstChild) {"
91 , " document.body.removeChild(document.body.firstChild);"
100 [ "@import url(http://fonts.googleapis.com/css?family=Source+Sans+Pro);"
101 , "html, head, body {"
108waitingStyle :: H.AttributeValue
111 "width: 100%; height: 100%; display: flex; flex-direction: column;"
112 ++ " justify-content: center; align-items: center; color: #9A9A9A;"
113 ++ " font-family: 'Source Sans Pro';"
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