/usr/share/doc/libghc-hakyll-doc/html/Hakyll-Web-Template-Internal.html is in libghc-hakyll-doc 4.9.8.0-1build4.
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 | <!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>Hakyll.Web.Template.Internal</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_Hakyll-Web-Template-Internal.html");};
//]]>
</script></head><body><div id="package-header"><ul class="links" id="page-menu"><li><a href="src/Hakyll-Web-Template-Internal.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">hakyll-4.9.8.0: A static website compiler library</p></div><div id="content"><div id="module-header"><table class="info"><tr><th>Safe Haskell</th><td>None</td></tr><tr><th>Language</th><td>Haskell98</td></tr></table><p class="caption">Hakyll.Web.Template.Internal</p></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"><span class="keyword">newtype</span> <a href="#t:Template">Template</a> = <a href="#v:Template">Template</a> {<ul class="subs"><li><a href="#v:unTemplate">unTemplate</a> :: [<a href="Hakyll-Web-Template-Internal-Element.html#t:TemplateElement">TemplateElement</a>]</li></ul>}</li><li class="src short"><a href="#v:template">template</a> :: [<a href="Hakyll-Web-Template-Internal-Element.html#t:TemplateElement">TemplateElement</a>] -> <a href="Hakyll-Web-Template-Internal.html#t:Template">Template</a></li><li class="src short"><a href="#v:templateBodyCompiler">templateBodyCompiler</a> :: <a href="Hakyll-Core-Compiler-Internal.html#t:Compiler">Compiler</a> (<a href="Hakyll-Core-Item.html#t:Item">Item</a> <a href="Hakyll-Web-Template-Internal.html#t:Template">Template</a>)</li><li class="src short"><a href="#v:templateCompiler">templateCompiler</a> :: <a href="Hakyll-Core-Compiler-Internal.html#t:Compiler">Compiler</a> (<a href="Hakyll-Core-Item.html#t:Item">Item</a> <a href="Hakyll-Web-Template-Internal.html#t:Template">Template</a>)</li><li class="src short"><a href="#v:applyTemplate">applyTemplate</a> :: <a href="Hakyll-Web-Template-Internal.html#t:Template">Template</a> -> <a href="Hakyll-Web-Template-Context.html#t:Context">Context</a> a -> <a href="Hakyll-Core-Item.html#t:Item">Item</a> a -> <a href="Hakyll-Core-Compiler-Internal.html#t:Compiler">Compiler</a> (<a href="Hakyll-Core-Item.html#t:Item">Item</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a>)</li><li class="src short"><a href="#v:applyTemplate-39-">applyTemplate'</a> :: <span class="keyword">forall</span> a. [<a href="Hakyll-Web-Template-Internal-Element.html#t:TemplateElement">TemplateElement</a>] -> <a href="Hakyll-Web-Template-Context.html#t:Context">Context</a> a -> <a href="Hakyll-Core-Item.html#t:Item">Item</a> a -> <a href="Hakyll-Core-Compiler-Internal.html#t:Compiler">Compiler</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a></li><li class="src short"><a href="#v:loadAndApplyTemplate">loadAndApplyTemplate</a> :: <a href="Hakyll-Core-Identifier.html#t:Identifier">Identifier</a> -> <a href="Hakyll-Web-Template-Context.html#t:Context">Context</a> a -> <a href="Hakyll-Core-Item.html#t:Item">Item</a> a -> <a href="Hakyll-Core-Compiler-Internal.html#t:Compiler">Compiler</a> (<a href="Hakyll-Core-Item.html#t:Item">Item</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a>)</li><li class="src short"><a href="#v:applyAsTemplate">applyAsTemplate</a> :: <a href="Hakyll-Web-Template-Context.html#t:Context">Context</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a> -> <a href="Hakyll-Core-Item.html#t:Item">Item</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a> -> <a href="Hakyll-Core-Compiler-Internal.html#t:Compiler">Compiler</a> (<a href="Hakyll-Core-Item.html#t:Item">Item</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a>)</li><li class="src short"><a href="#v:readTemplate">readTemplate</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a> -> <a href="Hakyll-Web-Template-Internal.html#t:Template">Template</a></li><li class="src short"><a href="#v:unsafeReadTemplateFile">unsafeReadTemplateFile</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:FilePath">FilePath</a> -> <a href="Hakyll-Core-Compiler-Internal.html#t:Compiler">Compiler</a> <a href="Hakyll-Web-Template-Internal.html#t:Template">Template</a></li><li class="src short">module <a href="Hakyll-Web-Template-Internal-Element.html">Hakyll.Web.Template.Internal.Element</a></li><li class="src short">module <a href="Hakyll-Web-Template-Internal-Trim.html">Hakyll.Web.Template.Internal.Trim</a></li></ul></div><div id="interface"><h1>Documentation</h1><div class="top"><p class="src"><span class="keyword">newtype</span> <a id="t:Template" class="def">Template</a> <a href="src/Hakyll-Web-Template-Internal.html#Template" class="link">Source</a> <a href="#t:Template" class="selflink">#</a></p><div class="doc"><p>Datatype used for template substitutions.</p></div><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a id="v:Template" class="def">Template</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div class="subs fields"><p class="caption">Fields</p><ul><li><dfn class="src"><a id="v:unTemplate" class="def">unTemplate</a> :: [<a href="Hakyll-Web-Template-Internal-Element.html#t:TemplateElement">TemplateElement</a>]</dfn><div class="doc empty"> </div></li></ul></div></td></tr></table></div><div class="subs instances"><p id="control.i:Template" class="caption collapser" onclick="toggleSection('i:Template')">Instances</p><div id="section.i:Template" class="show"><table><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:Template:Eq:1" class="instance expander" onclick="toggleSection('i:id:Template:Eq:1')"></span> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Eq.html#t:Eq">Eq</a> <a href="Hakyll-Web-Template-Internal.html#t:Template">Template</a></span> <a href="src/Hakyll-Web-Template-Internal.html#line-43" class="link">Source</a> <a href="#t:Template" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:id:Template:Eq:1" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:-61--61-">(==)</a> :: <a href="Hakyll-Web-Template-Internal.html#t:Template">Template</a> -> <a href="Hakyll-Web-Template-Internal.html#t:Template">Template</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Bool.html#t:Bool">Bool</a> <a href="#v:-61--61-" class="selflink">#</a></p><p class="src"><a href="#v:-47--61-">(/=)</a> :: <a href="Hakyll-Web-Template-Internal.html#t:Template">Template</a> -> <a href="Hakyll-Web-Template-Internal.html#t:Template">Template</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Bool.html#t:Bool">Bool</a> <a href="#v:-47--61-" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:Template:Show:2" class="instance expander" onclick="toggleSection('i:id:Template:Show:2')"></span> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Text-Show.html#t:Show">Show</a> <a href="Hakyll-Web-Template-Internal.html#t:Template">Template</a></span> <a href="src/Hakyll-Web-Template-Internal.html#line-43" class="link">Source</a> <a href="#t:Template" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:id:Template:Show:2" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:showsPrec">showsPrec</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int">Int</a> -> <a href="Hakyll-Web-Template-Internal.html#t:Template">Template</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Text-Show.html#t:ShowS">ShowS</a> <a href="#v:showsPrec" class="selflink">#</a></p><p class="src"><a href="#v:show">show</a> :: <a href="Hakyll-Web-Template-Internal.html#t:Template">Template</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a> <a href="#v:show" class="selflink">#</a></p><p class="src"><a href="#v:showList">showList</a> :: [<a href="Hakyll-Web-Template-Internal.html#t:Template">Template</a>] -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Text-Show.html#t:ShowS">ShowS</a> <a href="#v:showList" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:Template:IsString:3" class="instance expander" onclick="toggleSection('i:id:Template:IsString:3')"></span> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:IsString">IsString</a> <a href="Hakyll-Web-Template-Internal.html#t:Template">Template</a></span> <a href="src/Hakyll-Web-Template-Internal.html#line-53" class="link">Source</a> <a href="#t:Template" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:id:Template:IsString:3" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:fromString">fromString</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a> -> <a href="Hakyll-Web-Template-Internal.html#t:Template">Template</a> <a href="#v:fromString" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:Template:Binary:4" class="instance expander" onclick="toggleSection('i:id:Template:Binary:4')"></span> <a href="file:///usr/share/doc/ghc-doc/html/libraries/binary-0.8.3.0/Data-Binary.html#t:Binary">Binary</a> <a href="Hakyll-Web-Template-Internal.html#t:Template">Template</a></span> <a href="src/Hakyll-Web-Template-Internal.html#line-43" class="link">Source</a> <a href="#t:Template" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:id:Template:Binary:4" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:put">put</a> :: <a href="Hakyll-Web-Template-Internal.html#t:Template">Template</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/binary-0.8.3.0/Data-Binary-Put.html#t:Put">Put</a> <a href="#v:put" class="selflink">#</a></p><p class="src"><a href="#v:get">get</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/binary-0.8.3.0/Data-Binary-Get-Internal.html#t:Get">Get</a> <a href="Hakyll-Web-Template-Internal.html#t:Template">Template</a> <a href="#v:get" class="selflink">#</a></p><p class="src"><a href="#v:putList">putList</a> :: [<a href="Hakyll-Web-Template-Internal.html#t:Template">Template</a>] -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/binary-0.8.3.0/Data-Binary-Put.html#t:Put">Put</a> <a href="#v:putList" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:Template:Writable:5" class="instance expander" onclick="toggleSection('i:id:Template:Writable:5')"></span> <a href="Hakyll-Core-Writable.html#t:Writable">Writable</a> <a href="Hakyll-Web-Template-Internal.html#t:Template">Template</a></span> <a href="src/Hakyll-Web-Template-Internal.html#line-47" class="link">Source</a> <a href="#t:Template" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:id:Template:Writable:5" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:write">write</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:FilePath">FilePath</a> -> <a href="Hakyll-Core-Item.html#t:Item">Item</a> <a href="Hakyll-Web-Template-Internal.html#t:Template">Template</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:IO">IO</a> () <a href="src/Hakyll-Core-Writable.html#write" class="link">Source</a> <a href="#v:write" class="selflink">#</a></p></div></div></td></tr></table></div></div></div><div class="top"><p class="src"><a id="v:template" class="def">template</a> :: [<a href="Hakyll-Web-Template-Internal-Element.html#t:TemplateElement">TemplateElement</a>] -> <a href="Hakyll-Web-Template-Internal.html#t:Template">Template</a> <a href="src/Hakyll-Web-Template-Internal.html#template" class="link">Source</a> <a href="#v:template" class="selflink">#</a></p><div class="doc"><p>Wrap the constructor to ensure trim is called.</p></div></div><div class="top"><p class="src"><a id="v:templateBodyCompiler" class="def">templateBodyCompiler</a> :: <a href="Hakyll-Core-Compiler-Internal.html#t:Compiler">Compiler</a> (<a href="Hakyll-Core-Item.html#t:Item">Item</a> <a href="Hakyll-Web-Template-Internal.html#t:Template">Template</a>) <a href="src/Hakyll-Web-Template-Internal.html#templateBodyCompiler" class="link">Source</a> <a href="#v:templateBodyCompiler" class="selflink">#</a></p><div class="doc"><p>Read a template, without metadata header</p></div></div><div class="top"><p class="src"><a id="v:templateCompiler" class="def">templateCompiler</a> :: <a href="Hakyll-Core-Compiler-Internal.html#t:Compiler">Compiler</a> (<a href="Hakyll-Core-Item.html#t:Item">Item</a> <a href="Hakyll-Web-Template-Internal.html#t:Template">Template</a>) <a href="src/Hakyll-Web-Template-Internal.html#templateCompiler" class="link">Source</a> <a href="#v:templateCompiler" class="selflink">#</a></p><div class="doc"><p>Read complete file contents as a template</p></div></div><div class="top"><p class="src"><a id="v:applyTemplate" class="def">applyTemplate</a> <a href="src/Hakyll-Web-Template-Internal.html#applyTemplate" class="link">Source</a> <a href="#v:applyTemplate" class="selflink">#</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: <a href="Hakyll-Web-Template-Internal.html#t:Template">Template</a></td><td class="doc"><p>Template</p></td></tr><tr><td class="src">-> <a href="Hakyll-Web-Template-Context.html#t:Context">Context</a> a</td><td class="doc"><p>Context</p></td></tr><tr><td class="src">-> <a href="Hakyll-Core-Item.html#t:Item">Item</a> a</td><td class="doc"><p>Page</p></td></tr><tr><td class="src">-> <a href="Hakyll-Core-Compiler-Internal.html#t:Compiler">Compiler</a> (<a href="Hakyll-Core-Item.html#t:Item">Item</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a>)</td><td class="doc"><p>Resulting item</p></td></tr></table></div></div><div class="top"><p class="src"><a id="v:applyTemplate-39-" class="def">applyTemplate'</a> <a href="src/Hakyll-Web-Template-Internal.html#applyTemplate%27" class="link">Source</a> <a href="#v:applyTemplate-39-" class="selflink">#</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: [<a href="Hakyll-Web-Template-Internal-Element.html#t:TemplateElement">TemplateElement</a>]</td><td class="doc"><p>Unwrapped Template</p></td></tr><tr><td class="src">-> <a href="Hakyll-Web-Template-Context.html#t:Context">Context</a> a</td><td class="doc"><p>Context</p></td></tr><tr><td class="src">-> <a href="Hakyll-Core-Item.html#t:Item">Item</a> a</td><td class="doc"><p>Page</p></td></tr><tr><td class="src">-> <a href="Hakyll-Core-Compiler-Internal.html#t:Compiler">Compiler</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a></td><td class="doc"><p>Resulting item</p></td></tr></table></div></div><div class="top"><p class="src"><a id="v:loadAndApplyTemplate" class="def">loadAndApplyTemplate</a> <a href="src/Hakyll-Web-Template-Internal.html#loadAndApplyTemplate" class="link">Source</a> <a href="#v:loadAndApplyTemplate" class="selflink">#</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: <a href="Hakyll-Core-Identifier.html#t:Identifier">Identifier</a></td><td class="doc"><p>Template identifier</p></td></tr><tr><td class="src">-> <a href="Hakyll-Web-Template-Context.html#t:Context">Context</a> a</td><td class="doc"><p>Context</p></td></tr><tr><td class="src">-> <a href="Hakyll-Core-Item.html#t:Item">Item</a> a</td><td class="doc"><p>Page</p></td></tr><tr><td class="src">-> <a href="Hakyll-Core-Compiler-Internal.html#t:Compiler">Compiler</a> (<a href="Hakyll-Core-Item.html#t:Item">Item</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a>)</td><td class="doc"><p>Resulting item</p></td></tr></table></div><div class="doc"><p>The following pattern is so common:</p><pre>tpl <- loadBody "templates/foo.html"
someCompiler
>>= applyTemplate tpl context</pre><p>That we have a single function which does this:</p><pre>someCompiler
>>= loadAndApplyTemplate "templates/foo.html" context</pre></div></div><div class="top"><p class="src"><a id="v:applyAsTemplate" class="def">applyAsTemplate</a> <a href="src/Hakyll-Web-Template-Internal.html#applyAsTemplate" class="link">Source</a> <a href="#v:applyAsTemplate" class="selflink">#</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: <a href="Hakyll-Web-Template-Context.html#t:Context">Context</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a></td><td class="doc"><p>Context</p></td></tr><tr><td class="src">-> <a href="Hakyll-Core-Item.html#t:Item">Item</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a></td><td class="doc"><p>Item and template</p></td></tr><tr><td class="src">-> <a href="Hakyll-Core-Compiler-Internal.html#t:Compiler">Compiler</a> (<a href="Hakyll-Core-Item.html#t:Item">Item</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a>)</td><td class="doc"><p>Resulting item</p></td></tr></table></div><div class="doc"><p>It is also possible that you want to substitute <code>$key$</code>s within the body of
an item. This function does that by interpreting the item body as a template,
and then applying it to itself.</p></div></div><div class="top"><p class="src"><a id="v:readTemplate" class="def">readTemplate</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a> -> <a href="Hakyll-Web-Template-Internal.html#t:Template">Template</a> <a href="src/Hakyll-Web-Template-Internal.html#readTemplate" class="link">Source</a> <a href="#v:readTemplate" class="selflink">#</a></p></div><div class="top"><p class="src"><a id="v:unsafeReadTemplateFile" class="def">unsafeReadTemplateFile</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:FilePath">FilePath</a> -> <a href="Hakyll-Core-Compiler-Internal.html#t:Compiler">Compiler</a> <a href="Hakyll-Web-Template-Internal.html#t:Template">Template</a> <a href="src/Hakyll-Web-Template-Internal.html#unsafeReadTemplateFile" class="link">Source</a> <a href="#v:unsafeReadTemplateFile" class="selflink">#</a></p></div><div class="top"><p class="src">module <a href="Hakyll-Web-Template-Internal-Element.html">Hakyll.Web.Template.Internal.Element</a></p></div><div class="top"><p class="src">module <a href="Hakyll-Web-Template-Internal-Trim.html">Hakyll.Web.Template.Internal.Trim</a></p></div></div></div><div id="footer"><p>Produced by <a href="http://www.haskell.org/haddock/">Haddock</a> version 2.17.3</p></div></body></html>
|