hyperbole-0.3.6: Interactive HTML apps using type-safe serverside Haskell
Safe HaskellSafe-Inferred
LanguageGHC2021

Web.Hyperbole.Embed

Synopsis

Documentation

cssResetEmbed :: ByteString #

Default CSS to remove unintuitive default styles. This or cssResetLink is required.

import Data.String.Interpolate (i)

toDocument :: ByteString -> ByteString
toDocument cnt =
  [i|<html>
    <head>
      <style type="text/css">#{cssResetEmbed}</style>
    </head>
    <body>#{cnt}</body>
  </html>|]

cssResetLink :: Text #

Alternatively, the reset is available on a CDN

import Data.String.Interpolate (i)

toDocument :: ByteString -> ByteString
toDocument cnt =
  [i|<html>
    <head>
      <link rel="stylesheet" href="#{cssResetLink}">
    </head>
    <body>#{cnt}</body>
  </html>|]