module Html (span, html, p, hr, div_, iframe, img, main_, ul, li, table, td, th, tr, a) where import Data.List (unwords) import Intro type Attr = (String, String) html :: [String] -> String html xs = concat [ "" , "" , script [ "function resizeIframe(x) { \ \ x.style.height = x.contentWindow.document.documentElement.scrollHeight + 'px'; \ \}" ] , "" , "" , style [ ":root { font-size: 16px; }" , "* { padding: 0; margin: 0; }" , "body { display: flex; flex-direction: column; gap: 1rem; padding: 1rem; }" , "hr { height: 0; border: 0; border-top: 1px solid #000; }" , "table { border-collapse: collapse; width: 100%; }" , "td, th { border: 1px solid #000; padding: 0.4rem; }" , "iframe { width: 100%; min-height: 80vh; border: none; }" , "main { display: flex; flex-direction: column; gap: 1rem; }" , ".part { background-color: #eee; }" , ".part-body { padding: 1rem; }" ] , concat xs , "" ] hr :: String hr = "
" style :: [String] -> String style xs = concat [""] script :: [String] -> String script xs = concat [""] iframe :: [Attr] -> [String] -> String iframe xs ys = concat [""] div_ :: [Attr] -> [String] -> String div_ xs ys = concat ["
", concat ys, "
"] main_ :: [String] -> String main_ xs = concat ["
", concat xs, "
"] p :: [String] -> String p xs = concat ["

", concat xs, "

"] span :: [String] -> String span xs = concat ["", concat xs, ""] a :: [Attr] -> [String] -> String a xs ys = concat ["", concat ys, ""] table :: [String] -> String table xs = concat ["", concat xs, "
"] td :: [String] -> String td xs = concat ["", concat xs, ""] th :: [String] -> String th xs = concat ["", concat xs, ""] tr :: [String] -> String tr xs = concat ["", concat xs, ""] ul :: [String] -> String ul xs = concat [""] li :: [String] -> String li xs = concat ["
  • ", concat xs, "
  • "] img :: [Attr] -> String img xs = concat [""] attr :: Attr -> String attr (k, v) = concat [k, "='", v, "'"] attrs :: [Attr] -> String attrs xs = unwords (attr <$> xs)