/usr/share/doc/libghc-hsp-doc/html/HSP-HTML4.html is in libghc-hsp-doc 0.10.0-5.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>HSP.HTML4</title><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" /><script src="haddock-util.js" type="text/javascript"></script><script src="file:///usr/share/javascript/mathjax/MathJax.js" type="text/javascript"></script><script type="text/javascript">//<![CDATA[
window.onload = function () {pageLoad();setSynopsis("mini_HSP-HTML4.html");};
//]]>
</script></head><body><div id="package-header"><ul class="links" id="page-menu"><li><a href="src/HSP-HTML4.html">Source</a></li><li><a href="index.html">Contents</a></li><li><a href="doc-index.html">Index</a></li></ul><p class="caption">hsp-0.10.0: Haskell Server Pages is a library for writing dynamic server-side web pages.</p></div><div id="content"><div id="module-header"><table class="info"><tr><th>Copyright</th><td>(c) Niklas Broberg, Jeremy Shaw 2008-2012</td></tr><tr><th>License</th><td>BSD-style (see the file LICENSE.txt)</td></tr><tr><th>Maintainer</th><td>Niklas Broberg, niklas.broberg@gmail.com</td></tr><tr><th>Stability</th><td>experimental</td></tr><tr><th>Portability</th><td>Haskell 98</td></tr><tr><th>Safe Haskell</th><td>Safe</td></tr><tr><th>Language</th><td>Haskell98</td></tr></table><p class="caption">HSP.HTML4</p></div><div id="table-of-contents"><p class="caption">Contents</p><ul><li><a href="#g:1">Functions</a></li><li><a href="#g:2">Predefined XMLMetaData</a></li></ul></div><div id="description"><p class="caption">Description</p><div class="doc"><p>Attempt to render XHTML as well-formed HTML 4.01:</p><ol><li>no short tags are used, e.g., <script></script> instead of <script /></li><li>the end tag is forbidden for some elements, for these we:</li></ol><ul><li>render only the open tag, e.g., <br></li><li>throw an error if the tag contains children</li></ul><ol><li>optional end tags are always rendered</li></ol><p>Currently no validation is performed.</p></div></div><div id="synopsis"><p id="control.syn" class="caption expander" onclick="toggleSection('syn')">Synopsis</p><ul id="section.syn" class="hide" onclick="toggleSection('syn')"><li class="src short"><a href="#v:renderAsHTML">renderAsHTML</a> :: <a href="HSP-XML.html#t:XML">XML</a> -> <a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text-Lazy.html#t:Text">Text</a></li><li class="src short"><a href="#v:htmlEscapeChars">htmlEscapeChars</a> :: [(<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Char.html#t:Char">Char</a>, <a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text-Lazy-Builder.html#t:Builder">Builder</a>)]</li><li class="src short"><a href="#v:html4Strict">html4Strict</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="HSP-XML.html#t:XMLMetaData">XMLMetaData</a></li><li class="src short"><a href="#v:html4StrictFrag">html4StrictFrag</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="HSP-XML.html#t:XMLMetaData">XMLMetaData</a></li></ul></div><div id="interface"><h1 id="g:1">Functions</h1><div class="top"><p class="src"><a id="v:renderAsHTML" class="def">renderAsHTML</a> :: <a href="HSP-XML.html#t:XML">XML</a> -> <a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text-Lazy.html#t:Text">Text</a> <a href="src/HSP-HTML4.html#renderAsHTML" class="link">Source</a> <a href="#v:renderAsHTML" class="selflink">#</a></p><div class="doc"><p>Pretty-prints HTML values.</p><p>Error Handling:</p><p>Some tags (such as img) can not contain children in HTML. However,
there is nothing to stop the caller from passing in XML which
contains an img tag with children. There are three basic ways to
handle this:</p><ol><li>drop the bogus children silently</li><li>call <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Prelude.html#v:error">error</a></code> / raise an exception</li><li>render the img tag with children -- even though it is invalid</li></ol><p>Currently we are taking approach #3, since no other attempts to
validate the data are made in this function. Instead, you can run
the output through a full HTML validator to detect the errors.</p><p>#1 seems like a poor choice, since it makes is easy to overlook the
fact that data went missing.</p><p>We could raising errors, but you have to be in the IO monad to
catch them. Also, you have to use evaluate if you want to check for
errors. This means you can not start sending the page until the
whole page has been rendered. And you have to store the whole page
in RAM at once. Similar problems occur if we return Either
instead. We mostly care about catching errors and showing them in
the browser during testing, so perhaps this can be configurable.</p><p>Another solution would be a compile time error if an empty-only
tag contained children.</p><p>FIXME: also verify that the domain is correct</p><p>FIXME: what to do if a namespace is encountered</p></div></div><div class="top"><p class="src"><a id="v:htmlEscapeChars" class="def">htmlEscapeChars</a> :: [(<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Char.html#t:Char">Char</a>, <a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text-Lazy-Builder.html#t:Builder">Builder</a>)] <a href="src/HSP-HTML4.html#htmlEscapeChars" class="link">Source</a> <a href="#v:htmlEscapeChars" class="selflink">#</a></p></div><h1 id="g:2">Predefined XMLMetaData</h1><div class="top"><p class="src"><a id="v:html4Strict" class="def">html4Strict</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="HSP-XML.html#t:XMLMetaData">XMLMetaData</a> <a href="src/HSP-HTML4.html#html4Strict" class="link">Source</a> <a href="#v:html4Strict" class="selflink">#</a></p></div><div class="top"><p class="src"><a id="v:html4StrictFrag" class="def">html4StrictFrag</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="HSP-XML.html#t:XMLMetaData">XMLMetaData</a> <a href="src/HSP-HTML4.html#html4StrictFrag" class="link">Source</a> <a href="#v:html4StrictFrag" class="selflink">#</a></p></div></div></div><div id="footer"><p>Produced by <a href="http://www.haskell.org/haddock/">Haddock</a> version 2.17.2</p></div></body></html>
|