web-view-0.6.0: Type-safe HTML and CSS with intuitive layouts and composable styles.
Safe HaskellSafe-Inferred
LanguageGHC2021

Web.View.Render

Synopsis

Documentation

renderText :: View () () -> Text Source #

Renders a View as HTML with embedded CSS class definitions

>>> renderText $ el bold "Hello"
<style type='text/css'>.bold { font-weight:bold }</style>
<div class='bold'>Hello</div>

data Line Source #

Constructors

Line 

Fields

Instances

Instances details
Show Line Source # 
Instance details

Defined in Web.View.Render

Methods

showsPrec :: Int -> Line -> ShowS #

show :: Line -> String #

showList :: [Line] -> ShowS #

Eq Line Source # 
Instance details

Defined in Web.View.Render

Methods

(==) :: Line -> Line -> Bool #

(/=) :: Line -> Line -> Bool #

data LineEnd Source #

Constructors

Newline 
Inline 

Instances

Instances details
Show LineEnd Source # 
Instance details

Defined in Web.View.Render

Eq LineEnd Source # 
Instance details

Defined in Web.View.Render

Methods

(==) :: LineEnd -> LineEnd -> Bool #

(/=) :: LineEnd -> LineEnd -> Bool #

renderLines :: [Line] -> Text Source #

Render lines to text

renderText' :: c -> View c () -> Text Source #

Render with the specified view context

renderText' () $ el bold "Hello"

selectorText :: Selector -> Text Source #

The css selector for this style

attributeClassName :: Selector -> ClassName Source #

Unique name for the class, as seen in the element's class attribute

flatAttributes :: Element -> FlatAttributes Source #

The Attributes for an element, inclusive of class.