|
Basic HTML inclusionHappstack is completely agnostic as to the source of the HTML served. There is no required templating system. We'll be looking at a few simple ways to include HTML in your application:
HtmlStringWe've already seen the use of HtmlString, from the happstack-helpers package, in the ControllerBasic.hs file. You can include your HTML as String literals wrapped with a HtmlString constructor and the ToMessage instance for HtmlString will take care of the rest. Text.HtmlI won't be providing a tutorial on using Text.Html, but I want to point out that there is a ToMessage instance for Html. This means that anything built from the combinators included in Text.Html will display correctly. HStringTemplateLets move on to the next couple of chapters, which will cover the use HStringTemplate in some depth. |