This file is indexed.

/usr/share/doc/libghc-pandoc-doc/html/Text-Pandoc-Templates.html is in libghc-pandoc-doc 1.16.0.2~dfsg-1.

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
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<!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>Text.Pandoc.Templates</title><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" /><script src="haddock-util.js" type="text/javascript"></script><script type="text/javascript">//<![CDATA[
window.onload = function () {pageLoad();setSynopsis("mini_Text-Pandoc-Templates.html");};
//]]>
</script></head><body><div id="package-header"><ul class="links" id="page-menu"><li><a href="src/Text-Pandoc-Templates.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">pandoc-1.16.0.2: Conversion between markup formats</p></div><div id="content"><div id="module-header"><table class="info"><tr><th>Copyright</th><td>Copyright (C) 2009-2015 John MacFarlane</td></tr><tr><th>License</th><td>GNU GPL, version 2 or above</td></tr><tr><th>Maintainer</th><td>John MacFarlane &lt;jgm@berkeley.edu&gt;</td></tr><tr><th>Stability</th><td>alpha</td></tr><tr><th>Portability</th><td>portable</td></tr><tr><th>Safe Haskell</th><td>None</td></tr><tr><th>Language</th><td>Haskell98</td></tr></table><p class="caption">Text.Pandoc.Templates</p></div><div id="description"><p class="caption">Description</p><div class="doc"><p>A simple templating system with variable substitution and conditionals.
The following program illustrates its use:</p><pre>
import Data.Text
import Data.Aeson
import Text.Pandoc.Templates

data Employee = Employee { firstName :: String
                         , lastName  :: String
                         , salary    :: Maybe Int }
instance ToJSON Employee where
  toJSON e = object [ &quot;name&quot; .= object [ &quot;first&quot; .= firstName e
                                       , &quot;last&quot;  .= lastName e ]
                    , &quot;salary&quot; .= salary e ]

employees :: [Employee]
employees = [ Employee &quot;John&quot; &quot;Doe&quot; Nothing
            , Employee &quot;Omar&quot; &quot;Smith&quot; (Just 30000)
            , Employee &quot;Sara&quot; &quot;Chen&quot; (Just 60000) ]

template :: Template
template = either error id $ compileTemplate
  &quot;$for(employee)$Hi, $employee.name.first$. $if(employee.salary)$You make $employee.salary$.$else$No salary data.$endif$$sep$\n$endfor$&quot;

main = putStrLn $ renderTemplate template $ object [&quot;employee&quot; .= employees ]</pre><p>A slot for an interpolated variable is a variable name surrounded
by dollar signs.  To include a literal <code>$</code> in your template, use
<code>$$</code>.  Variable names must begin with a letter and can contain letters,
numbers, <code>_</code>, <code>-</code>, and <code>.</code>.</p><p>The values of variables are determined by a JSON object that is
passed as a parameter to <code>renderTemplate</code>.  So, for example,
<code>title</code> will return the value of the <code>title</code> field, and
<code>employee.salary</code> will return the value of the <code>salary</code> field
of the object that is the value of the <code>employee</code> field.</p><p>The value of a variable will be indented to the same level as the
variable.</p><p>A conditional begins with <code>$if(variable_name)$</code> and ends with <code>$endif$</code>.
It may optionally contain an <code>$else$</code> section.  The if section is
used if <code>variable_name</code> has a non-null value, otherwise the else section
is used.</p><p>Conditional keywords should not be indented, or unexpected spacing
problems may occur.</p><p>The <code>$for$</code> keyword can be used to iterate over an array.  If
the value of the associated variable is not an array, a single
iteration will be performed on its value.</p><p>You may optionally specify separators using <code>$sep$</code>, as in the
example above.</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:renderTemplate">renderTemplate</a> :: (<a href="file:///usr/share/doc/libghc-aeson-doc/html/Data-Aeson-Types.html#t:ToJSON">ToJSON</a> a, <a href="Text-Pandoc-Templates.html#t:TemplateTarget">TemplateTarget</a> b) =&gt; <a href="Text-Pandoc-Templates.html#t:Template">Template</a> -&gt; a -&gt; b</li><li class="src short"><a href="#v:renderTemplate-39-">renderTemplate'</a> :: (<a href="file:///usr/share/doc/libghc-aeson-doc/html/Data-Aeson-Types.html#t:ToJSON">ToJSON</a> a, <a href="Text-Pandoc-Templates.html#t:TemplateTarget">TemplateTarget</a> b) =&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-String.html#t:String">String</a> -&gt; a -&gt; b</li><li class="src short"><span class="keyword">class</span> <a href="#t:TemplateTarget">TemplateTarget</a> a <span class="keyword">where</span><ul class="subs"><li><a href="#v:toTarget">toTarget</a> :: <a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text.html#t:Text">Text</a> -&gt; a</li></ul></li><li class="src short"><a href="#v:varListToJSON">varListToJSON</a> :: [(<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-String.html#t:String">String</a>, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-String.html#t:String">String</a>)] -&gt; <a href="file:///usr/share/doc/libghc-aeson-doc/html/Data-Aeson-Types.html#t:Value">Value</a></li><li class="src short"><a href="#v:compileTemplate">compileTemplate</a> :: <a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text.html#t:Text">Text</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Either.html#t:Either">Either</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-String.html#t:String">String</a> <a href="Text-Pandoc-Templates.html#t:Template">Template</a></li><li class="src short"><span class="keyword">data</span> <a href="#t:Template">Template</a></li><li class="src short"><a href="#v:getDefaultTemplate">getDefaultTemplate</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:FilePath">FilePath</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-String.html#t:String">String</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Either.html#t:Either">Either</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Control-Exception-Base.html#t:IOException">IOException</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-String.html#t:String">String</a>)</li></ul></div><div id="interface"><h1>Documentation</h1><div class="top"><p class="src"><a name="v:renderTemplate" class="def">renderTemplate</a> :: (<a href="file:///usr/share/doc/libghc-aeson-doc/html/Data-Aeson-Types.html#t:ToJSON">ToJSON</a> a, <a href="Text-Pandoc-Templates.html#t:TemplateTarget">TemplateTarget</a> b) =&gt; <a href="Text-Pandoc-Templates.html#t:Template">Template</a> -&gt; a -&gt; b <a href="src/Text-Pandoc-Templates.html#renderTemplate" class="link">Source</a></p></div><div class="top"><p class="src"><a name="v:renderTemplate-39-" class="def">renderTemplate'</a> :: (<a href="file:///usr/share/doc/libghc-aeson-doc/html/Data-Aeson-Types.html#t:ToJSON">ToJSON</a> a, <a href="Text-Pandoc-Templates.html#t:TemplateTarget">TemplateTarget</a> b) =&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-String.html#t:String">String</a> -&gt; a -&gt; b <a href="src/Text-Pandoc-Templates.html#renderTemplate%27" class="link">Source</a></p><div class="doc"><p>Like <code><a href="Text-Pandoc-Templates.html#v:renderTemplate">renderTemplate</a></code>, but compiles the template first,
 raising an error if compilation fails.</p></div></div><div class="top"><p class="src"><span class="keyword">class</span> <a name="t:TemplateTarget" class="def">TemplateTarget</a> a <span class="keyword">where</span> <a href="src/Text-Pandoc-Templates.html#TemplateTarget" class="link">Source</a></p><div class="subs methods"><p class="caption">Methods</p><p class="src"><a name="v:toTarget" class="def">toTarget</a> :: <a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text.html#t:Text">Text</a> -&gt; a <a href="src/Text-Pandoc-Templates.html#toTarget" class="link">Source</a></p></div><div class="subs instances"><p id="control.i:TemplateTarget" class="caption collapser" onclick="toggleSection('i:TemplateTarget')">Instances</p><div id="section.i:TemplateTarget" class="show"><table><tr><td class="src clearfix"><span class="inst-left"><a href="Text-Pandoc-Templates.html#t:TemplateTarget">TemplateTarget</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-String.html#t:String">String</a></span> <a href="src/Text-Pandoc-Templates.html#line-153" class="link">Source</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="Text-Pandoc-Templates.html#t:TemplateTarget">TemplateTarget</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString-Lazy.html#t:ByteString">ByteString</a></span> <a href="src/Text-Pandoc-Templates.html#line-156" class="link">Source</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="Text-Pandoc-Templates.html#t:TemplateTarget">TemplateTarget</a> <a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text.html#t:Text">Text</a></span> <a href="src/Text-Pandoc-Templates.html#line-150" class="link">Source</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="Text-Pandoc-Templates.html#t:TemplateTarget">TemplateTarget</a> <a href="file:///usr/share/doc/libghc-blaze-html-doc/html/Text-Blaze-Html.html#t:Html">Html</a></span> <a href="src/Text-Pandoc-Templates.html#line-159" class="link">Source</a></td><td class="doc empty">&nbsp;</td></tr></table></div></div></div><div class="top"><p class="src"><a name="v:varListToJSON" class="def">varListToJSON</a> :: [(<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-String.html#t:String">String</a>, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-String.html#t:String">String</a>)] -&gt; <a href="file:///usr/share/doc/libghc-aeson-doc/html/Data-Aeson-Types.html#t:Value">Value</a> <a href="src/Text-Pandoc-Templates.html#varListToJSON" class="link">Source</a></p></div><div class="top"><p class="src"><a name="v:compileTemplate" class="def">compileTemplate</a> :: <a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text.html#t:Text">Text</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Either.html#t:Either">Either</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-String.html#t:String">String</a> <a href="Text-Pandoc-Templates.html#t:Template">Template</a> <a href="src/Text-Pandoc-Templates.html#compileTemplate" class="link">Source</a></p></div><div class="top"><p class="src"><span class="keyword">data</span> <a name="t:Template" class="def">Template</a> <a href="src/Text-Pandoc-Templates.html#Template" class="link">Source</a></p><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"><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Monoid.html#t:Monoid">Monoid</a> <a href="Text-Pandoc-Templates.html#t:Template">Template</a></span> <a href="src/Text-Pandoc-Templates.html#line-143" class="link">Source</a></td><td class="doc empty">&nbsp;</td></tr></table></div></div></div><div class="top"><p class="src"><a name="v:getDefaultTemplate" class="def">getDefaultTemplate</a> <a href="src/Text-Pandoc-Templates.html#getDefaultTemplate" class="link">Source</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:FilePath">FilePath</a></td><td class="doc"><p>User data directory to search first</p></td></tr><tr><td class="src">-&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-String.html#t:String">String</a></td><td class="doc"><p>Name of writer</p></td></tr><tr><td class="src">-&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Either.html#t:Either">Either</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Control-Exception-Base.html#t:IOException">IOException</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-String.html#t:String">String</a>)</td><td class="doc empty">&nbsp;</td></tr></table></div><div class="doc"><p>Get default template for the specified writer.</p></div></div></div></div><div id="footer"><p>Produced by <a href="http://www.haskell.org/haddock/">Haddock</a> version 2.16.1</p></div></body></html>