http://git-wip-us.apache.org/repos/asf/incubator-freemarker-site/blob/52c070a9/builds/2.3.26-nightly/ref_directive_visit.html ---------------------------------------------------------------------- diff --git a/builds/2.3.26-nightly/ref_directive_visit.html b/builds/2.3.26-nightly/ref_directive_visit.html new file mode 100644 index 0000000..c95e861 --- /dev/null +++ b/builds/2.3.26-nightly/ref_directive_visit.html @@ -0,0 +1,384 @@ +<!doctype html> +<!-- Generated by FreeMarker/Docgen from DocBook --> +<html lang="en" class="page-type-section"> +<head prefix="og: http://ogp.me/ns#"> +<meta charset="utf-8"> +<title>visit, recurse, fallback - Apache FreeMarker Manual</title> +<meta http-equiv="X-UA-Compatible" content="IE=edge"> +<meta name="viewport" content="width=device-width,initial-scale=1"> +<meta name="format-detection" content="telephone=no"> +<meta property="og:site_name" content="Apache FreeMarker Manual"> +<meta property="og:title" content="visit, recurse, fallback"> +<meta property="og:locale" content="en_US"> +<meta property="og:url" content="http://freemarker.org/docs/ref_directive_visit.html"> +<link rel="canonical" href="http://freemarker.org/docs/ref_directive_visit.html"> +<link rel="icon" href="favicon.png" type="image/png"> +<link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Roboto:500,700,400,300|Droid+Sans+Mono"> +<link rel="stylesheet" type="text/css" href="docgen-resources/docgen.min.css?1489402528979"> +<script> +(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ +(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), +m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) +})(window,document,'script','//www.google-analytics.com/analytics.js','ga'); +ga('create', 'UA-55420501-1', 'auto'); +ga('send', 'pageview'); +</script> +</head> +<body itemscope itemtype="https://schema.org/Code"> + <meta itemprop="url" content="http://freemarker.org/docs/"> + <meta itemprop="name" content="Apache FreeMarker Manual"> + + <!--[if lte IE 9]> + <div style="background-color: #C00; color: #fff; padding: 12px 24px;">Please use a modern browser to view this website.</div> + <![endif]--><div class="header-top-bg"><div class="site-width header-top"><a class="logo" href="http://freemarker.org" role="banner"> <img itemprop="image" src="logo.png" alt="FreeMarker"> +</a><ul class="tabs"><li><a href="http://freemarker.org/">Home</a></li><li class="current"><a href="index.html">Manual</a></li><li><a class="external" href="api/index.html">Java API</a></li></ul><ul class="secondary-tabs"><li><a class="tab icon-heart" href="http://freemarker.org/contribute.html" title="Contribute"><span>Contribute</span></a></li><li><a class="tab icon-bug" href="https://issues.apache.org/jira/browse/FREEMARKER/" title="Report a Bug"><span>Report a Bug</span></a></li><li><a class="tab icon-download" href="http://freemarker.org/freemarkerdownload.html" title="Download"><span>Download</span></a></li></ul></div></div><div class="header-bottom-bg"><div class="site-width search-row"><a href="index.html" class="navigation-header">Manual</a><div class="navigation-header"></div><form method="get" class="search-form" action="search-results.html"><fieldset><legend class="sr-only">Search form</legend><label for="search-field" class="sr-only">Search query</label><input id="searc h-field" name="q" type="search" class="search-input" placeholder="Search" spellcheck="false" autocorrect="off" autocomplete="off"><button type="submit" class="search-btn"><span class="sr-only">Search</span></button></fieldset></form></div><div class="site-width breadcrumb-row"><ul class="breadcrumb" itemscope itemtype="http://schema.org/BreadcrumbList"><li class="step-0" itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem"><a class="label" itemprop="item" href="index.html"><span itemprop="name">Apache FreeMarker Manual</span></a></li><li class="step-1" itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem"><a class="label" itemprop="item" href="ref.html"><span itemprop="name">Template Language Reference</span></a></li><li class="step-2" itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem"><a class="label" itemprop="item" href="ref_directives.html"><span itemprop="name">Directive Reference</span></a></li><li class="step- 3" itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem"><a class="label" itemprop="item" href="ref_directive_visit.html"><span itemprop="name">visit, recurse, fallback</span></a></li></ul><div class="bookmarks" title="Bookmarks"><span class="sr-only">Bookmarks:</span><ul class="bookmark-list"><li><a href="alphaidx.html">Alpha. index</a></li><li><a href="gloss.html">Glossary</a></li><li><a href="dgui_template_exp.html#exp_cheatsheet">Expressions</a></li><li><a href="ref_builtins_alphaidx.html">?builtins</a></li><li><a href="ref_directive_alphaidx.html">#directives</a></li><li><a href="ref_specvar.html">.spec_vars</a></li><li><a href="app_faq.html">FAQ</a></li></ul></div></div></div> <div class="main-content site-width"> + <div class="content-wrapper"> + <div id="table-of-contents-wrapper" class="col-left"> + <script>var breadcrumb = ["Apache FreeMarker Manual","Template Language Reference","Directive Reference","visit, recurse, fallback"];</script> + <script src="toc.js?1489402528979"></script> + <script src="docgen-resources/main.min.js?1489402528979"></script> + </div> +<div class="col-right"><div class="page-content"><div class="page-title"><div class="pagers top"><a class="paging-arrow previous" href="ref_directive_userDefined.html"><span>Previous</span></a><a class="paging-arrow next" href="ref_specvar.html"><span>Next</span></a></div><div class="title-wrapper"> +<h1 class="content-header header-section1" id="ref_directive_visit" itemprop="headline">visit, recurse, fallback</h1> +</div></div><div class="page-menu"> +<div class="page-menu-title">Page Contents</div> +<ul><li><a class="page-menu-link" href="#autoid_134" data-menu-target="autoid_134">Synopsis</a></li><li><a class="page-menu-link" href="#autoid_135" data-menu-target="autoid_135">Description</a><ul><li><a class="page-menu-link" href="#autoid_136" data-menu-target="autoid_136">Visit</a></li><li><a class="page-menu-link" href="#autoid_137" data-menu-target="autoid_137">Recurse</a></li><li><a class="page-menu-link" href="#autoid_138" data-menu-target="autoid_138">Fallback</a></li></ul></li></ul> </div><a name="ref.directive.visit"></a> + + + + +<h2 class="content-header header-section2" id="autoid_134">Synopsis</h2> + + + +<pre class="metaTemplate"><code class="inline-code"><#visit <em class="code-color">node</em> using <em class="code-color">namespace</em>></code> +or +<code class="inline-code"><#visit <em class="code-color">node</em>></code></pre> + + + +<pre class="metaTemplate"><code class="inline-code"><#recurse <em class="code-color">node</em> using <em class="code-color">namespace</em>></code> +or +<code class="inline-code"><#recurse <em class="code-color">node</em>></code> +or +<code class="inline-code"><#recurse using <em class="code-color">namespace</em>></code> +or +<code class="inline-code"><#recurse></code></pre> + + + +<pre class="metaTemplate"><code class="inline-code"><#fallback></code></pre> + + + <p>Where:</p> + + <ul> + <li> + <code class="inline-code"><em class="code-color">node</em></code>: + Expression evaluates to a <a href="xgui_expose_dom.html">node + variable</a>. + </li> + + <li> + <code class="inline-code"><em class="code-color">namespace</em></code>: A + <a href="dgui_misc_namespace.html">namespace</a>, or a + sequence of namespaces. A namespace can be given with the + namespace hash (a.k.a. gate hash), or with a string literal that + store the path of template that could be imported. Instead of + namespace hashes, you can use plain hashes as well. + </li> + </ul> + + + + + +<h2 class="content-header header-section2" id="autoid_135">Description</h2> + + + <p>The <code class="inline-code">visit</code> and <code class="inline-code">recurse</code> + directives are used for the recursive processing of trees. In + practice, this will mostly be used for <a href="xgui.html">processing XML.</a></p> + + + + + + +<h3 class="content-header header-section3" id="autoid_136">Visit</h3> + + + <p>When you call <code class="inline-code"><#visit + <em class="code-color">node</em>></code>, it looks for a + user-defined directive (like a macro) to invoke that has the name + deducted from the node's name + (<code class="inline-code"><em class="code-color">node</em>?node_name</code>) and + namespace + (<code class="inline-code"><em class="code-color">node</em>?node_namesoace</code>). + The rules of name deduction:</p> + + <ul> + <li> + <p>If the node doesn't support node namespaces (as text + nodes in XML), then the directive name is simply the name of + the node + (<code class="inline-code"><em class="code-color">node</em>?node_name</code>). + <span class="marked-for-programmers">A node does not support node + namespaces if the <code class="inline-code">getNodeNamespace</code> method + returns <code class="inline-code">null</code>.</span></p> + </li> + + <li> + <p>If the node does support node namespaces (as element + nodes in XML), then a prefix deduced from the node namespace + maybe appended before the node name with a colon used as + separator (e.g. <code class="inline-code">e:book</code>). The prefix, and if + there is a prefix used at all, depends on what prefixes has + been registered with the <code class="inline-code">ns_prefixes</code> + parameter of the <code class="inline-code">ftl</code> directive in the <a href="dgui_misc_namespace.html">FTL namespace</a> where + <code class="inline-code">visit</code> looks for the handler directive + (which is not necessary the same as the FTL namespace where + <code class="inline-code">visit</code> was called from, as you will see + later). Concretely, if there was no default namespace + registered with <code class="inline-code">ns_prefixes</code> then for nodes + that does not belong to any namespace (<span class="marked-for-programmers">when <code class="inline-code">getNodeNamespace</code> + returns <code class="inline-code">""</code></span>) no prefix is used. If + there was a default namespace registered with + <code class="inline-code">ns_prefixes</code> then for nodes that does not + belong to any namespace prefix <code class="inline-code">N</code> is used, + and for nodes that belong to the default node namespace no + prefix is used. Otherwise, in both case, the prefix associated + to the node namespace with the <code class="inline-code">ns_prefixes</code> + is used. If there is not prefix associated to the node + namespace of the node, then <code class="inline-code">visit</code> simply + behave as if there was no directive found with the proper + name.</p> + </li> + </ul> + + <p>The node for which the user-defined directive was invoked is + available for it as special variable <code class="inline-code">.node</code>. + Example:</p> + + + +<div class="code-wrapper"><pre class="code-block code-template"><#-- Assume that nodeWithNameX?node_name is "x" --> +<#visit nodeWithNameX> +Done. +<#macro x> + Now I'm handling a node that has the name "x". + Just to show how to access this node: this node has ${.node?children?size} children. +</#macro></pre></div> + + <p>The output will be something like:</p> + + + +<div class="code-wrapper"><pre class="code-block code-output"> Now I'm handling a node that has the name "x". + Just to show how to access this node: this node has 3 children. +Done.</pre></div> + + <p>If one or more namespaces is specified using the optional + <code class="inline-code">using</code> clause, then <code class="inline-code">visit</code> + will look for the directives in those namespaces only, with the + earlier specified namespaces in the list getting priority. If no + <code class="inline-code">using</code> clause is specified, the namespace or + sequence of namespaces specified with the <code class="inline-code">using</code> + clause of the last uncompleted <code class="inline-code">visit</code> call is + reused. If there is no such pending <code class="inline-code">visit</code> call, + then the current namespace is used. For example, if you execute + this template:</p> + + + +<div class="code-wrapper"><pre class="code-block code-template"><#import "n1.ftl" as n1> +<#import "n2.ftl" as n2> + +<#-- This will call n2.x (because there is no n1.x): --> +<#visit nodeWithNameX using [n1, n2]> + +<#-- This will call the x of the current namespace: --> +<#visit nodeWithNameX> + +<#macro x> + Simply x +</#macro></pre></div> + + <p>and this is <code class="inline-code">n1.ftl</code>:</p> + + + +<div class="code-wrapper"><pre class="code-block code-template"><#macro y> + n1.y +</#macro></pre></div> + + <p>and this is <code class="inline-code">n2.ftl</code>:</p> + + + +<div class="code-wrapper"><pre class="code-block code-template"><#macro x> + n2.x + <#-- This callc n1.y as it inherits the "using [n1, n2]" from the pending visit call: --> + <#visit nodeWithNameY> + <#-- This will call n2.y: --> + <#visit nodeWithNameY using .namespace> +</#macro> + +<#macro y> + n2.y +</#macro></pre></div> + + <p>then this will print:</p> + + + +<div class="code-wrapper"><pre class="code-block code-output"> + n2.x + n1.y + n2.y + + Simply x + </pre></div> + + <p>If <code class="inline-code">visit</code> doesn't find a user-defined + directive in either FTL namespaces with the name identical to the + name deduced with the rules described earlier, then it tries to + find an user-defined directive with name + <code class="inline-code">@<em class="code-color">node_type</em></code>, or if + the node does not support node type property (i.e. + <code class="inline-code"><em class="code-color">node</em>?node_type</code> + returns undefined variable), then with name + <code class="inline-code">@default</code>. For the lookup, it uses the same + mechanism as was explained earlier. If it still doesn't find an + user-defined directive to handle the node, then + <code class="inline-code">visit</code> stops template processing with error. + Some XML specific node types have special handling in this regard; + see: <a href="xgui_declarative_details.html">XML Processing Guide/Declarative XML processing/Details</a>. Example:</p> + + + +<div class="code-wrapper"><pre class="code-block code-template"><#-- Assume that nodeWithNameX?node_name is "x" --> +<#visit nodeWithNameX> + +<#-- Assume that nodeWithNameY?node_type is "foo" --> +<#visit nodeWithNameY> + +<#macro x> +Handling node x +</#macro> + +<#macro @foo> +There was no specific handler for node ${node?node_name} +</#macro></pre></div> + + <p>This would print:</p> + + + +<div class="code-wrapper"><pre class="code-block code-output">Handling node x + +There was no specific handler for node y + + </pre></div> + + + + + + + +<h3 class="content-header header-section3" id="autoid_137">Recurse</h3> + + + <a name="ref.directive.recurse"></a> + + <p>The <code class="inline-code"><#recurse></code> directive is really + syntactic sugar. It visits all children nodes of the node (and not + the node itself). So, to write:</p> + + + +<div class="code-wrapper"><pre class="code-block code-template"><#recurse <em>someNode</em> using <em>someLib</em>></pre></div> + + <p>is equivalent to writing:</p> + + + +<div class="code-wrapper"><pre class="code-block code-template"><#list <em>someNode</em>?children as <em>child</em>><#visit <em>child</em> using <em>someLib</em>></#list></pre></div> + + <p>However, target node is optional in the + <code class="inline-code">recurse</code> directive. If the target node is + unspecified, it simply uses the <code class="inline-code">.node</code>. Thus, + the terse instruction <code class="inline-code"><#recurse></code> is + equivalent to:</p> + + + +<div class="code-wrapper"><pre class="code-block code-template"><#list .node?children as child><#visit child></#list></pre></div> + + <p>As a side comment for those who are familiar with XSLT, + <code class="inline-code"><#recurse></code> is pretty much exactly + analogous to the <code class="inline-code"><xsl:apply-templates/></code> + instruction in XSLT.</p> + + + + + + + +<h3 class="content-header header-section3" id="autoid_138">Fallback</h3> + + + <a name="ref.directive.fallback"></a> + + <p>As you could learn earlier, in the documentation of the + <code class="inline-code">visit</code> directive, the user-defined directive + that handles the node is maybe searched in multiple FTL + name-spaces. The <code class="inline-code">fallback</code> directive can be used + in a user-defined directive that was invoked to handle a node. It + directs FreeMarker to continue the searching for the user-defined + directive in the further name-spaces (that is, in the name-spaces + that are after the name-space of the currently invoked + user-defined directive in the list of name-spaces). If a handler + for the node is found then it is invoked, otherwise + <code class="inline-code">fallback</code> does nothing.</p> + + <p>A typical usage of this to write customization layer over a + handler library, that sometimes passes the handling to the + customized library:</p> + + + +<div class="code-wrapper"><pre class="code-block code-template"><#import "/lib/docbook.ftl" as docbook> + +<#-- + We use the docbook library, but we override some handlers + in this namespace. +--> +<#visit document using [.namespace, docbook]> + +<#-- + Override the "programlisting" handler, but only in the case if + its "role" attribute is "java" +--> +<#macro programlisting> + <#if .node.@role[0]!"" == "java"> + <#-- Do something special here... --> + ... + <#else> + <#-- Just use the original (overidden) handler --> + <#fallback> + </#if> +</#macro></pre></div> + + <div class="bottom-pagers-wrapper"><div class="pagers bottom"><a class="paging-arrow previous" href="ref_directive_userDefined.html"><span>Previous</span></a><a class="paging-arrow next" href="ref_specvar.html"><span>Next</span></a></div></div></div></div> </div> + </div> +<div class="site-footer"><div class="site-width"><div class="footer-top"><div class="col-left sitemap"><div class="column"><h3 class="column-header">Overview</h3><ul><li><a href="http://freemarker.org/">What is FreeMarker?</a></li><li><a href="http://freemarker.org/freemarkerdownload.html">Download</a></li><li><a href="app_versions.html">Version history</a></li><li><a href="http://freemarker.org/history.html">About us</a></li><li><a itemprop="license" href="app_license.html">License</a></li></ul></div><div class="column"><h3 class="column-header">Handy stuff</h3><ul><li><a href="http://freemarker-online.kenshoo.com/">Try template online</a></li><li><a href="dgui_template_exp.html#exp_cheatsheet">Expressions cheatsheet</a></li><li><a href="ref_directive_alphaidx.html">#directives</a></li><li><a href="ref_builtins_alphaidx.html">?built_ins</a></li><li><a href="ref_specvar.html">.special_vars</a></li></ul></div><div class="column"><h3 class="column-header">Community</h3><ul><li><a href ="https://github.com/freemarker/freemarker">FreeMarker on Github</a></li><li><a href="https://twitter.com/freemarker">Follow us on Twitter</a></li><li><a href="https://issues.apache.org/jira/browse/FREEMARKER/">Report a bug</a></li><li><a href="http://stackoverflow.com/questions/ask?tags=freemarker">Ask a question</a></li><li><a href="http://freemarker.org/mailing-lists.html">Mailing lists</a></li></ul></div></div><div class="col-right"><ul class="social-icons"><li><a class="github" href="https://github.com/freemarker/freemarker">Github</a></li><li><a class="twitter" href="https://twitter.com/freemarker">Twitter</a></li><li><a class="stack-overflow" href="http://stackoverflow.com/questions/ask?tags=freemarker">Stack Overflow</a></li></ul><a class="xxe" href="http://www.xmlmind.com/xmleditor/" rel="nofollow" title="Edited with XMLMind XML Editor"><span>Edited with XMLMind XML Editor</span></a></div></div><div class="footer-bottom"> <p class="last-generated"> +Last generated: +<time itemprop="dateModified" datetime="2017-03-13T10:55:28Z" title="Monday, March 13, 2017 10:55:28 AM GMT">2017-03-13 10:55:28 GMT</time>, for Freemarker 2.3.26 </p> +<p class="copyright"> +© <span itemprop="copyrightYear">1999</span>â2017 +<a itemtype="http://schema.org/Organization" itemprop="copyrightHolder" href="http://apache.org/">The Apache Software Foundation</a>. Apache FreeMarker, FreeMarker, Apache Incubator, Apache, the Apache FreeMarker logo are trademarks of The Apache Software Foundation. </p> +</div></div></div></body> +</html>
http://git-wip-us.apache.org/repos/asf/incubator-freemarker-site/blob/52c070a9/builds/2.3.26-nightly/ref_directives.html ---------------------------------------------------------------------- diff --git a/builds/2.3.26-nightly/ref_directives.html b/builds/2.3.26-nightly/ref_directives.html new file mode 100644 index 0000000..8551220 --- /dev/null +++ b/builds/2.3.26-nightly/ref_directives.html @@ -0,0 +1,54 @@ +<!doctype html> +<!-- Generated by FreeMarker/Docgen from DocBook --> +<html lang="en" class="page-type-chapter"> +<head prefix="og: http://ogp.me/ns#"> +<meta charset="utf-8"> +<title>Directive Reference - Apache FreeMarker Manual</title> +<meta http-equiv="X-UA-Compatible" content="IE=edge"> +<meta name="viewport" content="width=device-width,initial-scale=1"> +<meta name="format-detection" content="telephone=no"> +<meta property="og:site_name" content="Apache FreeMarker Manual"> +<meta property="og:title" content="Directive Reference"> +<meta property="og:locale" content="en_US"> +<meta property="og:url" content="http://freemarker.org/docs/ref_directives.html"> +<link rel="canonical" href="http://freemarker.org/docs/ref_directives.html"> +<link rel="icon" href="favicon.png" type="image/png"> +<link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Roboto:500,700,400,300|Droid+Sans+Mono"> +<link rel="stylesheet" type="text/css" href="docgen-resources/docgen.min.css?1489402528979"> +<script> +(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ +(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), +m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) +})(window,document,'script','//www.google-analytics.com/analytics.js','ga'); +ga('create', 'UA-55420501-1', 'auto'); +ga('send', 'pageview'); +</script> +</head> +<body itemscope itemtype="https://schema.org/Code"> + <meta itemprop="url" content="http://freemarker.org/docs/"> + <meta itemprop="name" content="Apache FreeMarker Manual"> + + <!--[if lte IE 9]> + <div style="background-color: #C00; color: #fff; padding: 12px 24px;">Please use a modern browser to view this website.</div> + <![endif]--><div class="header-top-bg"><div class="site-width header-top"><a class="logo" href="http://freemarker.org" role="banner"> <img itemprop="image" src="logo.png" alt="FreeMarker"> +</a><ul class="tabs"><li><a href="http://freemarker.org/">Home</a></li><li class="current"><a href="index.html">Manual</a></li><li><a class="external" href="api/index.html">Java API</a></li></ul><ul class="secondary-tabs"><li><a class="tab icon-heart" href="http://freemarker.org/contribute.html" title="Contribute"><span>Contribute</span></a></li><li><a class="tab icon-bug" href="https://issues.apache.org/jira/browse/FREEMARKER/" title="Report a Bug"><span>Report a Bug</span></a></li><li><a class="tab icon-download" href="http://freemarker.org/freemarkerdownload.html" title="Download"><span>Download</span></a></li></ul></div></div><div class="header-bottom-bg"><div class="site-width search-row"><a href="index.html" class="navigation-header">Manual</a><div class="navigation-header"></div><form method="get" class="search-form" action="search-results.html"><fieldset><legend class="sr-only">Search form</legend><label for="search-field" class="sr-only">Search query</label><input id="searc h-field" name="q" type="search" class="search-input" placeholder="Search" spellcheck="false" autocorrect="off" autocomplete="off"><button type="submit" class="search-btn"><span class="sr-only">Search</span></button></fieldset></form></div><div class="site-width breadcrumb-row"><ul class="breadcrumb" itemscope itemtype="http://schema.org/BreadcrumbList"><li class="step-0" itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem"><a class="label" itemprop="item" href="index.html"><span itemprop="name">Apache FreeMarker Manual</span></a></li><li class="step-1" itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem"><a class="label" itemprop="item" href="ref.html"><span itemprop="name">Template Language Reference</span></a></li><li class="step-2" itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem"><a class="label" itemprop="item" href="ref_directives.html"><span itemprop="name">Directive Reference</span></a></li></ul><div class= "bookmarks" title="Bookmarks"><span class="sr-only">Bookmarks:</span><ul class="bookmark-list"><li><a href="alphaidx.html">Alpha. index</a></li><li><a href="gloss.html">Glossary</a></li><li><a href="dgui_template_exp.html#exp_cheatsheet">Expressions</a></li><li><a href="ref_builtins_alphaidx.html">?builtins</a></li><li><a href="ref_directive_alphaidx.html">#directives</a></li><li><a href="ref_specvar.html">.spec_vars</a></li><li><a href="app_faq.html">FAQ</a></li></ul></div></div></div> <div class="main-content site-width"> + <div class="content-wrapper"> + <div id="table-of-contents-wrapper" class="col-left"> + <script>var breadcrumb = ["Apache FreeMarker Manual","Template Language Reference","Directive Reference"];</script> + <script src="toc.js?1489402528979"></script> + <script src="docgen-resources/main.min.js?1489402528979"></script> + </div> +<div class="col-right"><div class="page-content"><div class="page-title"><div class="pagers top"><a class="paging-arrow previous" href="ref_builtins_expert.html"><span>Previous</span></a><a class="paging-arrow next" href="ref_directive_alphaidx.html"><span>Next</span></a></div><div class="title-wrapper"> +<h1 class="content-header header-chapter" id="ref_directives" itemprop="headline">Directive Reference</h1> +</div></div><div class="page-menu"> +<div class="page-menu-title">Section Contents</div> +<ul><li><a class="page-menu-link" href="ref_directive_alphaidx.html" data-menu-target="ref_directive_alphaidx">Alphabetical index</a></li><li><a class="page-menu-link" href="ref_directive_assign.html" data-menu-target="ref_directive_assign">assign</a></li><li><a class="page-menu-link" href="ref_directive_attempt.html" data-menu-target="ref_directive_attempt">attempt, recover</a></li><li><a class="page-menu-link" href="ref_directive_autoesc.html" data-menu-target="ref_directive_autoesc">autoesc</a></li><li><a class="page-menu-link" href="ref_directive_compress.html" data-menu-target="ref_directive_compress">compress</a></li><li><a class="page-menu-link" href="ref_directive_escape.html" data-menu-target="ref_directive_escape">escape, noescape (deprecated)</a></li><li><a class="page-menu-link" href="ref_directive_flush.html" data-menu-target="ref_directive_flush">flush</a></li><li><a class="page-menu-link" href="ref_directive_ftl.html" data-menu-target="ref_directive_ftl">ftl</a></li>< li><a class="page-menu-link" href="ref_directive_function.html" data-menu-target="ref_directive_function">function, return</a></li><li><a class="page-menu-link" href="ref_directive_global.html" data-menu-target="ref_directive_global">global</a></li><li><a class="page-menu-link" href="ref_directive_if.html" data-menu-target="ref_directive_if">if, else, elseif</a></li><li><a class="page-menu-link" href="ref_directive_import.html" data-menu-target="ref_directive_import">import</a></li><li><a class="page-menu-link" href="ref_directive_include.html" data-menu-target="ref_directive_include">include</a></li><li><a class="page-menu-link" href="ref_directive_list.html" data-menu-target="ref_directive_list">list, else, items, sep, break</a></li><li><a class="page-menu-link" href="ref_directive_local.html" data-menu-target="ref_directive_local">local</a></li><li><a class="page-menu-link" href="ref_directive_macro.html" data-menu-target="ref_directive_macro">macro, nested, return</a></li><li><a class="page-menu-link" href="ref_directive_noautoesc.html" data-menu-target="ref_directive_noautoesc">noautoesc</a></li><li><a class="page-menu-link" href="ref_directive_noparse.html" data-menu-target="ref_directive_noparse">noparse</a></li><li><a class="page-menu-link" href="ref_directive_nt.html" data-menu-target="ref_directive_nt">nt</a></li><li><a class="page-menu-link" href="ref_directive_outputformat.html" data-menu-target="ref_directive_outputformat">outputformat</a></li><li><a class="page-menu-link" href="ref_directive_setting.html" data-menu-target="ref_directive_setting">setting</a></li><li><a class="page-menu-link" href="ref_directive_stop.html" data-menu-target="ref_directive_stop">stop</a></li><li><a class="page-menu-link" href="ref_directive_switch.html" data-menu-target="ref_directive_switch">switch, case, default, break</a></li><li><a class="page-menu-link" href="ref_directive_t.html" data-menu-target="ref_directive_t">t, lt, rt</a></li><li><a class="page-menu-link" href="ref_directive_userDefined.html" data-menu-target="ref_directive_userDefined">User-defined directive (<@...>)</a></li><li><a class="page-menu-link" href="ref_directive_visit.html" data-menu-target="ref_directive_visit">visit, recurse, fallback</a></li></ul> </div><div class="bottom-pagers-wrapper"><div class="pagers bottom"><a class="paging-arrow previous" href="ref_builtins_expert.html"><span>Previous</span></a><a class="paging-arrow next" href="ref_directive_alphaidx.html"><span>Next</span></a></div></div></div></div> </div> + </div> +<div class="site-footer"><div class="site-width"><div class="footer-top"><div class="col-left sitemap"><div class="column"><h3 class="column-header">Overview</h3><ul><li><a href="http://freemarker.org/">What is FreeMarker?</a></li><li><a href="http://freemarker.org/freemarkerdownload.html">Download</a></li><li><a href="app_versions.html">Version history</a></li><li><a href="http://freemarker.org/history.html">About us</a></li><li><a itemprop="license" href="app_license.html">License</a></li></ul></div><div class="column"><h3 class="column-header">Handy stuff</h3><ul><li><a href="http://freemarker-online.kenshoo.com/">Try template online</a></li><li><a href="dgui_template_exp.html#exp_cheatsheet">Expressions cheatsheet</a></li><li><a href="ref_directive_alphaidx.html">#directives</a></li><li><a href="ref_builtins_alphaidx.html">?built_ins</a></li><li><a href="ref_specvar.html">.special_vars</a></li></ul></div><div class="column"><h3 class="column-header">Community</h3><ul><li><a href ="https://github.com/freemarker/freemarker">FreeMarker on Github</a></li><li><a href="https://twitter.com/freemarker">Follow us on Twitter</a></li><li><a href="https://issues.apache.org/jira/browse/FREEMARKER/">Report a bug</a></li><li><a href="http://stackoverflow.com/questions/ask?tags=freemarker">Ask a question</a></li><li><a href="http://freemarker.org/mailing-lists.html">Mailing lists</a></li></ul></div></div><div class="col-right"><ul class="social-icons"><li><a class="github" href="https://github.com/freemarker/freemarker">Github</a></li><li><a class="twitter" href="https://twitter.com/freemarker">Twitter</a></li><li><a class="stack-overflow" href="http://stackoverflow.com/questions/ask?tags=freemarker">Stack Overflow</a></li></ul><a class="xxe" href="http://www.xmlmind.com/xmleditor/" rel="nofollow" title="Edited with XMLMind XML Editor"><span>Edited with XMLMind XML Editor</span></a></div></div><div class="footer-bottom"> <p class="last-generated"> +Last generated: +<time itemprop="dateModified" datetime="2017-03-13T10:55:28Z" title="Monday, March 13, 2017 10:55:28 AM GMT">2017-03-13 10:55:28 GMT</time>, for Freemarker 2.3.26 </p> +<p class="copyright"> +© <span itemprop="copyrightYear">1999</span>â2017 +<a itemtype="http://schema.org/Organization" itemprop="copyrightHolder" href="http://apache.org/">The Apache Software Foundation</a>. Apache FreeMarker, FreeMarker, Apache Incubator, Apache, the Apache FreeMarker logo are trademarks of The Apache Software Foundation. </p> +</div></div></div></body> +</html> http://git-wip-us.apache.org/repos/asf/incubator-freemarker-site/blob/52c070a9/builds/2.3.26-nightly/ref_reservednames.html ---------------------------------------------------------------------- diff --git a/builds/2.3.26-nightly/ref_reservednames.html b/builds/2.3.26-nightly/ref_reservednames.html new file mode 100644 index 0000000..3e80bbc --- /dev/null +++ b/builds/2.3.26-nightly/ref_reservednames.html @@ -0,0 +1,96 @@ +<!doctype html> +<!-- Generated by FreeMarker/Docgen from DocBook --> +<html lang="en" class="page-type-chapter"> +<head prefix="og: http://ogp.me/ns#"> +<meta charset="utf-8"> +<title>Reserved names in FTL - Apache FreeMarker Manual</title> +<meta http-equiv="X-UA-Compatible" content="IE=edge"> +<meta name="viewport" content="width=device-width,initial-scale=1"> +<meta name="format-detection" content="telephone=no"> +<meta property="og:site_name" content="Apache FreeMarker Manual"> +<meta property="og:title" content="Reserved names in FTL"> +<meta property="og:locale" content="en_US"> +<meta property="og:url" content="http://freemarker.org/docs/ref_reservednames.html"> +<link rel="canonical" href="http://freemarker.org/docs/ref_reservednames.html"> +<link rel="icon" href="favicon.png" type="image/png"> +<link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Roboto:500,700,400,300|Droid+Sans+Mono"> +<link rel="stylesheet" type="text/css" href="docgen-resources/docgen.min.css?1489402528979"> +<script> +(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ +(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), +m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) +})(window,document,'script','//www.google-analytics.com/analytics.js','ga'); +ga('create', 'UA-55420501-1', 'auto'); +ga('send', 'pageview'); +</script> +</head> +<body itemscope itemtype="https://schema.org/Code"> + <meta itemprop="url" content="http://freemarker.org/docs/"> + <meta itemprop="name" content="Apache FreeMarker Manual"> + + <!--[if lte IE 9]> + <div style="background-color: #C00; color: #fff; padding: 12px 24px;">Please use a modern browser to view this website.</div> + <![endif]--><div class="header-top-bg"><div class="site-width header-top"><a class="logo" href="http://freemarker.org" role="banner"> <img itemprop="image" src="logo.png" alt="FreeMarker"> +</a><ul class="tabs"><li><a href="http://freemarker.org/">Home</a></li><li class="current"><a href="index.html">Manual</a></li><li><a class="external" href="api/index.html">Java API</a></li></ul><ul class="secondary-tabs"><li><a class="tab icon-heart" href="http://freemarker.org/contribute.html" title="Contribute"><span>Contribute</span></a></li><li><a class="tab icon-bug" href="https://issues.apache.org/jira/browse/FREEMARKER/" title="Report a Bug"><span>Report a Bug</span></a></li><li><a class="tab icon-download" href="http://freemarker.org/freemarkerdownload.html" title="Download"><span>Download</span></a></li></ul></div></div><div class="header-bottom-bg"><div class="site-width search-row"><a href="index.html" class="navigation-header">Manual</a><div class="navigation-header"></div><form method="get" class="search-form" action="search-results.html"><fieldset><legend class="sr-only">Search form</legend><label for="search-field" class="sr-only">Search query</label><input id="searc h-field" name="q" type="search" class="search-input" placeholder="Search" spellcheck="false" autocorrect="off" autocomplete="off"><button type="submit" class="search-btn"><span class="sr-only">Search</span></button></fieldset></form></div><div class="site-width breadcrumb-row"><ul class="breadcrumb" itemscope itemtype="http://schema.org/BreadcrumbList"><li class="step-0" itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem"><a class="label" itemprop="item" href="index.html"><span itemprop="name">Apache FreeMarker Manual</span></a></li><li class="step-1" itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem"><a class="label" itemprop="item" href="ref.html"><span itemprop="name">Template Language Reference</span></a></li><li class="step-2" itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem"><a class="label" itemprop="item" href="ref_reservednames.html"><span itemprop="name">Reserved names in FTL</span></a></li></ul><div c lass="bookmarks" title="Bookmarks"><span class="sr-only">Bookmarks:</span><ul class="bookmark-list"><li><a href="alphaidx.html">Alpha. index</a></li><li><a href="gloss.html">Glossary</a></li><li><a href="dgui_template_exp.html#exp_cheatsheet">Expressions</a></li><li><a href="ref_builtins_alphaidx.html">?builtins</a></li><li><a href="ref_directive_alphaidx.html">#directives</a></li><li><a href="ref_specvar.html">.spec_vars</a></li><li><a href="app_faq.html">FAQ</a></li></ul></div></div></div> <div class="main-content site-width"> + <div class="content-wrapper"> + <div id="table-of-contents-wrapper" class="col-left"> + <script>var breadcrumb = ["Apache FreeMarker Manual","Template Language Reference","Reserved names in FTL"];</script> + <script src="toc.js?1489402528979"></script> + <script src="docgen-resources/main.min.js?1489402528979"></script> + </div> +<div class="col-right"><div class="page-content"><div class="page-title"><div class="pagers top"><a class="paging-arrow previous" href="ref_specvar.html"><span>Previous</span></a><a class="paging-arrow next" href="ref_deprecated.html"><span>Next</span></a></div><div class="title-wrapper"> +<h1 class="content-header header-chapter" id="ref_reservednames" itemprop="headline">Reserved names in FTL</h1> +</div></div><p>The following names cannot be used for top-level variables without + square-bracket syntax (as <code class="inline-code">.vars["in"]</code>), since they + are keywords in FTL:</p><ul> + <li> + <code class="inline-code">true</code>: boolean value + "true" + </li> + + <li> + <code class="inline-code">false</code>: boolean value + "false" + </li> + + <li> + <code class="inline-code">gt</code>: comparison operator "greater + than" + </li> + + <li> + <code class="inline-code">gte</code>: comparison operator "greater + than or equivalent" + </li> + + <li> + <code class="inline-code">lt</code>: comparison operator "less + than" + </li> + + <li> + <code class="inline-code">lte</code>: comparison operator "less than + or equivalent" + </li> + + <li> + <code class="inline-code">as</code>: used by a few directives + </li> + + <li> + <code class="inline-code">in</code>: used by a few directives + </li> + + <li> + <code class="inline-code">using</code>: used by a few directives + </li> + </ul><div class="bottom-pagers-wrapper"><div class="pagers bottom"><a class="paging-arrow previous" href="ref_specvar.html"><span>Previous</span></a><a class="paging-arrow next" href="ref_deprecated.html"><span>Next</span></a></div></div></div></div> </div> + </div> +<div class="site-footer"><div class="site-width"><div class="footer-top"><div class="col-left sitemap"><div class="column"><h3 class="column-header">Overview</h3><ul><li><a href="http://freemarker.org/">What is FreeMarker?</a></li><li><a href="http://freemarker.org/freemarkerdownload.html">Download</a></li><li><a href="app_versions.html">Version history</a></li><li><a href="http://freemarker.org/history.html">About us</a></li><li><a itemprop="license" href="app_license.html">License</a></li></ul></div><div class="column"><h3 class="column-header">Handy stuff</h3><ul><li><a href="http://freemarker-online.kenshoo.com/">Try template online</a></li><li><a href="dgui_template_exp.html#exp_cheatsheet">Expressions cheatsheet</a></li><li><a href="ref_directive_alphaidx.html">#directives</a></li><li><a href="ref_builtins_alphaidx.html">?built_ins</a></li><li><a href="ref_specvar.html">.special_vars</a></li></ul></div><div class="column"><h3 class="column-header">Community</h3><ul><li><a href ="https://github.com/freemarker/freemarker">FreeMarker on Github</a></li><li><a href="https://twitter.com/freemarker">Follow us on Twitter</a></li><li><a href="https://issues.apache.org/jira/browse/FREEMARKER/">Report a bug</a></li><li><a href="http://stackoverflow.com/questions/ask?tags=freemarker">Ask a question</a></li><li><a href="http://freemarker.org/mailing-lists.html">Mailing lists</a></li></ul></div></div><div class="col-right"><ul class="social-icons"><li><a class="github" href="https://github.com/freemarker/freemarker">Github</a></li><li><a class="twitter" href="https://twitter.com/freemarker">Twitter</a></li><li><a class="stack-overflow" href="http://stackoverflow.com/questions/ask?tags=freemarker">Stack Overflow</a></li></ul><a class="xxe" href="http://www.xmlmind.com/xmleditor/" rel="nofollow" title="Edited with XMLMind XML Editor"><span>Edited with XMLMind XML Editor</span></a></div></div><div class="footer-bottom"> <p class="last-generated"> +Last generated: +<time itemprop="dateModified" datetime="2017-03-13T10:55:28Z" title="Monday, March 13, 2017 10:55:28 AM GMT">2017-03-13 10:55:28 GMT</time>, for Freemarker 2.3.26 </p> +<p class="copyright"> +© <span itemprop="copyrightYear">1999</span>â2017 +<a itemtype="http://schema.org/Organization" itemprop="copyrightHolder" href="http://apache.org/">The Apache Software Foundation</a>. Apache FreeMarker, FreeMarker, Apache Incubator, Apache, the Apache FreeMarker logo are trademarks of The Apache Software Foundation. </p> +</div></div></div></body> +</html> http://git-wip-us.apache.org/repos/asf/incubator-freemarker-site/blob/52c070a9/builds/2.3.26-nightly/ref_specvar.html ---------------------------------------------------------------------- diff --git a/builds/2.3.26-nightly/ref_specvar.html b/builds/2.3.26-nightly/ref_specvar.html new file mode 100644 index 0000000..f10bf42 --- /dev/null +++ b/builds/2.3.26-nightly/ref_specvar.html @@ -0,0 +1,290 @@ +<!doctype html> +<!-- Generated by FreeMarker/Docgen from DocBook --> +<html lang="en" class="page-type-chapter"> +<head prefix="og: http://ogp.me/ns#"> +<meta charset="utf-8"> +<title>Special Variable Reference - Apache FreeMarker Manual</title> +<meta http-equiv="X-UA-Compatible" content="IE=edge"> +<meta name="viewport" content="width=device-width,initial-scale=1"> +<meta name="format-detection" content="telephone=no"> +<meta property="og:site_name" content="Apache FreeMarker Manual"> +<meta property="og:title" content="Special Variable Reference"> +<meta property="og:locale" content="en_US"> +<meta property="og:url" content="http://freemarker.org/docs/ref_specvar.html"> +<link rel="canonical" href="http://freemarker.org/docs/ref_specvar.html"> +<link rel="icon" href="favicon.png" type="image/png"> +<link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Roboto:500,700,400,300|Droid+Sans+Mono"> +<link rel="stylesheet" type="text/css" href="docgen-resources/docgen.min.css?1489402528979"> +<script> +(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ +(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), +m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) +})(window,document,'script','//www.google-analytics.com/analytics.js','ga'); +ga('create', 'UA-55420501-1', 'auto'); +ga('send', 'pageview'); +</script> +</head> +<body itemscope itemtype="https://schema.org/Code"> + <meta itemprop="url" content="http://freemarker.org/docs/"> + <meta itemprop="name" content="Apache FreeMarker Manual"> + + <!--[if lte IE 9]> + <div style="background-color: #C00; color: #fff; padding: 12px 24px;">Please use a modern browser to view this website.</div> + <![endif]--><div class="header-top-bg"><div class="site-width header-top"><a class="logo" href="http://freemarker.org" role="banner"> <img itemprop="image" src="logo.png" alt="FreeMarker"> +</a><ul class="tabs"><li><a href="http://freemarker.org/">Home</a></li><li class="current"><a href="index.html">Manual</a></li><li><a class="external" href="api/index.html">Java API</a></li></ul><ul class="secondary-tabs"><li><a class="tab icon-heart" href="http://freemarker.org/contribute.html" title="Contribute"><span>Contribute</span></a></li><li><a class="tab icon-bug" href="https://issues.apache.org/jira/browse/FREEMARKER/" title="Report a Bug"><span>Report a Bug</span></a></li><li><a class="tab icon-download" href="http://freemarker.org/freemarkerdownload.html" title="Download"><span>Download</span></a></li></ul></div></div><div class="header-bottom-bg"><div class="site-width search-row"><a href="index.html" class="navigation-header">Manual</a><div class="navigation-header"></div><form method="get" class="search-form" action="search-results.html"><fieldset><legend class="sr-only">Search form</legend><label for="search-field" class="sr-only">Search query</label><input id="searc h-field" name="q" type="search" class="search-input" placeholder="Search" spellcheck="false" autocorrect="off" autocomplete="off"><button type="submit" class="search-btn"><span class="sr-only">Search</span></button></fieldset></form></div><div class="site-width breadcrumb-row"><ul class="breadcrumb" itemscope itemtype="http://schema.org/BreadcrumbList"><li class="step-0" itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem"><a class="label" itemprop="item" href="index.html"><span itemprop="name">Apache FreeMarker Manual</span></a></li><li class="step-1" itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem"><a class="label" itemprop="item" href="ref.html"><span itemprop="name">Template Language Reference</span></a></li><li class="step-2" itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem"><a class="label" itemprop="item" href="ref_specvar.html"><span itemprop="name">Special Variable Reference</span></a></li></ul><div cl ass="bookmarks" title="Bookmarks"><span class="sr-only">Bookmarks:</span><ul class="bookmark-list"><li><a href="alphaidx.html">Alpha. index</a></li><li><a href="gloss.html">Glossary</a></li><li><a href="dgui_template_exp.html#exp_cheatsheet">Expressions</a></li><li><a href="ref_builtins_alphaidx.html">?builtins</a></li><li><a href="ref_directive_alphaidx.html">#directives</a></li><li>.spec_vars</li><li><a href="app_faq.html">FAQ</a></li></ul></div></div></div> <div class="main-content site-width"> + <div class="content-wrapper"> + <div id="table-of-contents-wrapper" class="col-left"> + <script>var breadcrumb = ["Apache FreeMarker Manual","Template Language Reference","Special Variable Reference"];</script> + <script src="toc.js?1489402528979"></script> + <script src="docgen-resources/main.min.js?1489402528979"></script> + </div> +<div class="col-right"><div class="page-content"><div class="page-title"><div class="pagers top"><a class="paging-arrow previous" href="ref_directive_visit.html"><span>Previous</span></a><a class="paging-arrow next" href="ref_reservednames.html"><span>Next</span></a></div><div class="title-wrapper"> +<h1 class="content-header header-chapter" id="ref_specvar" itemprop="headline">Special Variable Reference</h1> +</div></div><p>Special variables are variables defined by the FreeMarker engine + itself. To access them, you use the + <code class="inline-code">.<em class="code-color">variable_name</em></code> syntax. For + example, you can't write simply <code class="inline-code">version</code>; you have to + write <code class="inline-code">.version</code>.</p> <div class="callout note"> + <strong class="callout-label">Note:</strong> + + <p>As of FreeMarker 2.3.23, you can use camel case instead of snake + case for special variable names, like <code class="inline-code">dataModel</code> + instead of <code class="inline-code">data_model</code>. But know that then within + the same template, FreeMarker will enforce the usage of camel case for + all identifiers that are part of the template language (user defined + names are not affected).</p> + </div> +<p>The supported special variables are:</p><ul> + <li> + <code class="inline-code">auto_esc</code> (since 2.3.24): Boolean + value that tells if auto-escaping (based on output format) is on or + off at the place where this variable is referred (resolved + statically). This is <em>not</em> affected by the + deprecated <code class="inline-code">escape</code> directive. This only deals with + automatic escaping based on the output format mechanism. + </li> + + <li> + <code class="inline-code">current_template_name</code>: The name of + the template where we are now (available since FreeMarker 2.3.23). + This can be missing (<code class="inline-code">null</code>) if the template was + created on-the-fly in Java <span class="marked-for-programmers">(via + <code class="inline-code">new Template(null, + <em class="code-color">...</em>)</code>)</span>, rather than + loaded from a backing store by name <span class="marked-for-programmers">(via + <code class="inline-code"><em class="code-color">cfg</em>.getTemplate(name, + <em class="code-color">...</em>)</code>)</span>. Migration + notice: If you replace the deprecated + <code class="inline-code">template_name</code> with this, note that the later is a + 0-length string instead of missing (<code class="inline-code">null</code>) if the + template has no name, so you might want to write + <code class="inline-code">current_template_name!''</code> in legacy + templates. + </li> + + <li> + <code class="inline-code">data_model</code>: A hash that you can use to + access the data-model directly. That is, variables you did with + <code class="inline-code">global</code> directive are not visible here. + </li> + + <li> + <code class="inline-code">error</code> (available since FreeMarker + 2.3.1): This variable accessible in the body of the <a href="ref_directive_attempt.html#ref.directive.attempt"><code>recover</code> + directive</a>, where it stores the error message of the error we + recover from. + </li> + + <li> + <code class="inline-code">globals</code>: A hash that you can use to access + the globally accessible variables: the data-model and the variables + created with <code class="inline-code">global</code> directive. Note that + variables created with <code class="inline-code">assign</code> or + <code class="inline-code">macro</code> are not globals, thus they never hide the + variables when you use <code class="inline-code">globals</code>. + </li> + + <li> + <code class="inline-code">incompatible_improvements</code> (since + FreeMarker 2.3.24): The <a href="pgui_config_incompatible_improvements.html"><code>incompatbile_improvements</code> + setting</a> of the current FreeMarker configuration, as a + string. + </li> + + <li> + <code class="inline-code">lang</code>: Returns the language part of + the current value of the locale setting. For example if + <code class="inline-code">.locale</code> is <code class="inline-code">en_US</code>, then + <code class="inline-code">.lang</code> is <code class="inline-code">en</code>. + </li> + + <li> + <code class="inline-code">locale</code>: Returns the current value + of the locale setting. This is a string, for example + <code class="inline-code">en_US</code>. For more information about locale strings + <a href="ref_directive_setting.html#ref.directive.setting">see the + <code>setting</code> directive</a>. + </li> + + <li> + <code class="inline-code">locale_object</code> (available since + FreeMarker 2.3.21): Returns the current value of the locale setting + as a <code class="inline-code">java.util.Locale</code> object, rather than as a + string. This meant to be used instead of <code class="inline-code">.locale</code> + when you want to pass it as a <code class="inline-code">java.util.Locale</code> + object to a Java method. (The <code class="inline-code">Locale</code> object will + be wrapped according the <code class="inline-code">object_wrapper</code> setting + value. Whether you can actually pass this value to a Java method as + a <code class="inline-code">Locale</code> object depends on the object wrapper, + but an object wrapper that let you call Java methods directly is + very unlikely to not support that.) + </li> + + <li> + <code class="inline-code">locals</code>: A hash that you can use to access + the local variables (the variables created with the + <code class="inline-code">local</code> directive, and the parameters of + macro). + </li> + + <li> + <code class="inline-code">main</code>: A hash that you can use to access the + main <a href="dgui_misc_namespace.html">namespace</a>. Note that + global variables like the variables of data-model are + <em>not</em> visible through this hash. + </li> + + <li> + <code class="inline-code">main_template_name</code>: The name of the + top level template (available since FreeMarker 2.3.23). <span class="marked-for-programmers">(In Java, this is the template for which + <code class="inline-code">Template.process</code> was called.) </span>This can + be missing (<code class="inline-code">null</code>) if the template was created + on-the-fly in Java <span class="marked-for-programmers">(via <code class="inline-code">new + Template(null, <em class="code-color">...</em>)</code>)</span>, + rather than loaded from a backing store by name <span class="marked-for-programmers">(via + <code class="inline-code"><em class="code-color">cfg</em>.getTemplate(name, + <em class="code-color">...</em>)</code>)</span>. Migration + notice: If you replace the deprecated + <code class="inline-code">template_name</code> with this, note that the later is a + 0-length string instead of missing (<code class="inline-code">null</code>) if the + template has no name, so you might want to write + <code class="inline-code">main_template_name!''</code> in legacy templates. + </li> + + <li> + <code class="inline-code">namespace</code>: A hash that you can use to + access the current <a href="dgui_misc_namespace.html">namespace</a>. Note that global + variables like the variables of data-model are + <em>not</em> visible through this hash. + </li> + + <li> + <code class="inline-code">node</code> (alias <code class="inline-code">current_node</code> + for historical reasons): The node you are currently processing with + the visitor pattern (i.e. with the <a href="ref_directive_visit.html"><code>visit</code>, + <code>recurse</code>, ...etc. directives</a>). Also, it + initially stores the root node when you use the <a href="pgui_misc_ant.html">FreeMarker XML Ant task</a>. + </li> + + <li> + <code class="inline-code">now</code>: Returns the current date-time. + Usage examples: "<code class="inline-code">Page generated: ${.now}</code>", + "<code class="inline-code">Today is ${.now?date}</code>", "<code class="inline-code">The current + time is ${.now?time}</code>". + </li> + + <li> + Returns the name of the current <a href="dgui_misc_autoescaping.html#dgui_misc_autoescaping_outputformat">output format</a>. + This value is never missing/null. It's maybe the string + <code class="inline-code">"undefined"</code>, which is just the name of the + default output format. + </li> + + <li> + <code class="inline-code">output_encoding</code> (available since + FreeMarker 2.3.1): Returns the name of the current output charset. + This special variable is not existent if the framework that + encapsulates FreeMarker doesn't specify the output charset for + FreeMarker. <span class="marked-for-programmers">(Programmers can read more + about charset issues <a href="pgui_misc_charset.html">here...</a>)</span> + </li> + + <li> + <code class="inline-code">pass</code>: This is a macro that does nothing. It + has no parameters. Mostly used as no-op node handler in XML + processing. + </li> + + <li> + <code class="inline-code">template_name</code>: <em>Don't use + it, because its behavior is strange when macros are used; use + <code class="inline-code">current_template_name</code> or + <code class="inline-code">main_template_name</code> instead (see migration notices + there).</em> Gives the name of the main template, or if we are + running an included or imported template, the name of that template. + When calling macros, it becomes rather confusing: the macro call + won't change the value of this special variable, but when + <code class="inline-code">nested</code> is called, it changes it to the name of + the template that belongs to the current namespace. (Available since + FreeMarker 2.3.14.) + </li> + + <li> + <code class="inline-code">url_escaping_charset</code> (available + since FreeMarker 2.3.1): If exists, it stores the name of the + charset that should be used for URL escaping. If this variable + doesn't exist that means that nobody has specified what charset + should be used for URL encoding yet. In this case the <a href="ref_builtins_string.html#ref_builtin_url"><code>url</code> built-in</a> + uses the charset specified by the <code class="inline-code">output_encoding</code> + special variable for URL encoding; custom mechanism may follow the + same logic. <span class="marked-for-programmers">(Programmers can read more + about charset issues <a href="pgui_misc_charset.html">here...</a>)</span> + </li> + + <li> + <code class="inline-code">output_format</code> (since 2.3.24): The + name of output format at the place where this variable is referred + (resolved statically), such as <code class="inline-code">"HTML"</code>, + <code class="inline-code">"XML"</code>, <code class="inline-code">"RTF"</code>, + <code class="inline-code">"plainText"</code>, <code class="inline-code">"undefined"</code>, etc. + <span class="marked-for-programmers">(The available names can be extended + by the programmers, by the + <code class="inline-code">registered_custom_output_formats</code> + setting.)</span> + </li> + + <li> + <code class="inline-code">vars</code>: Expression + <code class="inline-code">.vars.foo</code> returns the same variable as expression + <code class="inline-code">foo</code>. It's useful if for some reasons you have to + use square bracket syntax, since that works only for hash sub + variables, so you need an artificial parent hash. For example, to + read a top-level variable that has a strange name that would confuse + FreeMarker, you can write + <code class="inline-code">.vars["A strange name!"]</code>. Or, to access a + top-level variable with dynamic name given with variable + <code class="inline-code">varName</code> you can write + <code class="inline-code">.vars[varName]</code>. Note that the hash returned by + <code class="inline-code">.vars</code> does not support <code class="inline-code">?keys</code> + and <code class="inline-code">?values</code>. + </li> + + <li> + <code class="inline-code">version</code>: Returns the FreeMarker + version number as string, for example <code class="inline-code">2.2.8</code>. This + can be used to check which FreeMarker version does your application + use, but note that this special variable does not exist prior to the + 2.3.0 or 2.2.8 versions. The version number of non-final releases + contains dash and further info after the numbers, like in + 2.3.21-nightly_20140726T151800Z. + </li> + </ul><div class="bottom-pagers-wrapper"><div class="pagers bottom"><a class="paging-arrow previous" href="ref_directive_visit.html"><span>Previous</span></a><a class="paging-arrow next" href="ref_reservednames.html"><span>Next</span></a></div></div></div></div> </div> + </div> +<div class="site-footer"><div class="site-width"><div class="footer-top"><div class="col-left sitemap"><div class="column"><h3 class="column-header">Overview</h3><ul><li><a href="http://freemarker.org/">What is FreeMarker?</a></li><li><a href="http://freemarker.org/freemarkerdownload.html">Download</a></li><li><a href="app_versions.html">Version history</a></li><li><a href="http://freemarker.org/history.html">About us</a></li><li><a itemprop="license" href="app_license.html">License</a></li></ul></div><div class="column"><h3 class="column-header">Handy stuff</h3><ul><li><a href="http://freemarker-online.kenshoo.com/">Try template online</a></li><li><a href="dgui_template_exp.html#exp_cheatsheet">Expressions cheatsheet</a></li><li><a href="ref_directive_alphaidx.html">#directives</a></li><li><a href="ref_builtins_alphaidx.html">?built_ins</a></li><li><a href="ref_specvar.html">.special_vars</a></li></ul></div><div class="column"><h3 class="column-header">Community</h3><ul><li><a href ="https://github.com/freemarker/freemarker">FreeMarker on Github</a></li><li><a href="https://twitter.com/freemarker">Follow us on Twitter</a></li><li><a href="https://issues.apache.org/jira/browse/FREEMARKER/">Report a bug</a></li><li><a href="http://stackoverflow.com/questions/ask?tags=freemarker">Ask a question</a></li><li><a href="http://freemarker.org/mailing-lists.html">Mailing lists</a></li></ul></div></div><div class="col-right"><ul class="social-icons"><li><a class="github" href="https://github.com/freemarker/freemarker">Github</a></li><li><a class="twitter" href="https://twitter.com/freemarker">Twitter</a></li><li><a class="stack-overflow" href="http://stackoverflow.com/questions/ask?tags=freemarker">Stack Overflow</a></li></ul><a class="xxe" href="http://www.xmlmind.com/xmleditor/" rel="nofollow" title="Edited with XMLMind XML Editor"><span>Edited with XMLMind XML Editor</span></a></div></div><div class="footer-bottom"> <p class="last-generated"> +Last generated: +<time itemprop="dateModified" datetime="2017-03-13T10:55:28Z" title="Monday, March 13, 2017 10:55:28 AM GMT">2017-03-13 10:55:28 GMT</time>, for Freemarker 2.3.26 </p> +<p class="copyright"> +© <span itemprop="copyrightYear">1999</span>â2017 +<a itemtype="http://schema.org/Organization" itemprop="copyrightHolder" href="http://apache.org/">The Apache Software Foundation</a>. Apache FreeMarker, FreeMarker, Apache Incubator, Apache, the Apache FreeMarker logo are trademarks of The Apache Software Foundation. </p> +</div></div></div></body> +</html> http://git-wip-us.apache.org/repos/asf/incubator-freemarker-site/blob/52c070a9/builds/2.3.26-nightly/search-results.html ---------------------------------------------------------------------- diff --git a/builds/2.3.26-nightly/search-results.html b/builds/2.3.26-nightly/search-results.html new file mode 100644 index 0000000..bef3650 --- /dev/null +++ b/builds/2.3.26-nightly/search-results.html @@ -0,0 +1,65 @@ +<!doctype html> +<!-- Generated by FreeMarker/Docgen from DocBook --> +<html lang="en" class="page-type-docgen-search-results"> +<head prefix="og: http://ogp.me/ns#"> +<meta charset="utf-8"> +<title>Search results - Apache FreeMarker Manual</title> +<meta http-equiv="X-UA-Compatible" content="IE=edge"> +<meta name="viewport" content="width=device-width,initial-scale=1"> +<meta name="format-detection" content="telephone=no"> +<meta property="og:site_name" content="Apache FreeMarker Manual"> +<meta property="og:title" content="Search results"> +<meta property="og:locale" content="en_US"> +<link rel="icon" href="favicon.png" type="image/png"> +<link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Roboto:500,700,400,300|Droid+Sans+Mono"> +<link rel="stylesheet" type="text/css" href="docgen-resources/docgen.min.css?1489402528979"> +<script> +(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ +(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), +m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) +})(window,document,'script','//www.google-analytics.com/analytics.js','ga'); +ga('create', 'UA-55420501-1', 'auto'); +ga('send', 'pageview'); +</script> +</head> +<body itemscope itemtype="https://schema.org/Code"> + <meta itemprop="url" content="http://freemarker.org/docs/"> + <meta itemprop="name" content="Apache FreeMarker Manual"> + + <!--[if lte IE 9]> + <div style="background-color: #C00; color: #fff; padding: 12px 24px;">Please use a modern browser to view this website.</div> + <![endif]--><div class="header-top-bg"><div class="site-width header-top"><a class="logo" href="http://freemarker.org" role="banner"> <img itemprop="image" src="logo.png" alt="FreeMarker"> +</a><ul class="tabs"><li><a href="http://freemarker.org/">Home</a></li><li class="current"><a href="index.html">Manual</a></li><li><a class="external" href="api/index.html">Java API</a></li></ul><ul class="secondary-tabs"><li><a class="tab icon-heart" href="http://freemarker.org/contribute.html" title="Contribute"><span>Contribute</span></a></li><li><a class="tab icon-bug" href="https://issues.apache.org/jira/browse/FREEMARKER/" title="Report a Bug"><span>Report a Bug</span></a></li><li><a class="tab icon-download" href="http://freemarker.org/freemarkerdownload.html" title="Download"><span>Download</span></a></li></ul></div></div><div class="header-bottom-bg"><div class="site-width search-row"><a href="index.html" class="navigation-header">Manual</a><div class="navigation-header"></div><form method="get" class="search-form" action="search-results.html"><fieldset><legend class="sr-only">Search form</legend><label for="search-field" class="sr-only">Search query</label><input id="searc h-field" name="q" type="search" class="search-input" placeholder="Search" spellcheck="false" autocorrect="off" autocomplete="off"><button type="submit" class="search-btn"><span class="sr-only">Search</span></button></fieldset></form></div><div class="site-width breadcrumb-row"><ul class="breadcrumb" itemscope itemtype="http://schema.org/BreadcrumbList"><li class="step-0" itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem"><a class="label" itemprop="item" href="index.html"><span itemprop="name">Apache FreeMarker Manual</span></a></li><li class="step-1" itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem"><a class="label" itemprop="item" href="index.html#searchresults"><span itemprop="name">Search results</span></a></li></ul><div class="bookmarks" title="Bookmarks"><span class="sr-only">Bookmarks:</span><ul class="bookmark-list"><li><a href="alphaidx.html">Alpha. index</a></li><li><a href="gloss.html">Glossary</a></li><li><a href="dgui_temp late_exp.html#exp_cheatsheet">Expressions</a></li><li><a href="ref_builtins_alphaidx.html">?builtins</a></li><li><a href="ref_directive_alphaidx.html">#directives</a></li><li><a href="ref_specvar.html">.spec_vars</a></li><li><a href="app_faq.html">FAQ</a></li></ul></div></div></div> <div class="main-content site-width"> + <div class="content-wrapper"> + <div id="table-of-contents-wrapper" class="col-left"> + <script>var breadcrumb = ["Apache FreeMarker Manual","Search results"];</script> + <script src="toc.js?1489402528979"></script> + <script src="docgen-resources/main.min.js?1489402528979"></script> + </div> +<div class="col-right"><div class="page-content"><div class="page-title"><div class="title-wrapper"> +<h2 class="content-header header-section" id="searchresults">Search results</h2> +</div></div> <div class="search-results"> + <script> + (function() { + var cx = '003127866208504630097:arjqbv_znfw'; + var gcse = document.createElement('script'); + gcse.type = 'text/javascript'; + gcse.async = true; + gcse.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') + + '//cse.google.com/cse.js?cx=' + cx; + var s = document.getElementsByTagName('script')[0]; + s.parentNode.insertBefore(gcse, s); + })(); + </script> + <gcse:searchresults-only>Loadingâ¦</gcse:searchresults-only> + </div> +<div class="bottom-pagers-wrapper"></div></div></div> </div> + </div> +<div class="site-footer"><div class="site-width"><div class="footer-top"><div class="col-left sitemap"><div class="column"><h3 class="column-header">Overview</h3><ul><li><a href="http://freemarker.org/">What is FreeMarker?</a></li><li><a href="http://freemarker.org/freemarkerdownload.html">Download</a></li><li><a href="app_versions.html">Version history</a></li><li><a href="http://freemarker.org/history.html">About us</a></li><li><a itemprop="license" href="app_license.html">License</a></li></ul></div><div class="column"><h3 class="column-header">Handy stuff</h3><ul><li><a href="http://freemarker-online.kenshoo.com/">Try template online</a></li><li><a href="dgui_template_exp.html#exp_cheatsheet">Expressions cheatsheet</a></li><li><a href="ref_directive_alphaidx.html">#directives</a></li><li><a href="ref_builtins_alphaidx.html">?built_ins</a></li><li><a href="ref_specvar.html">.special_vars</a></li></ul></div><div class="column"><h3 class="column-header">Community</h3><ul><li><a href ="https://github.com/freemarker/freemarker">FreeMarker on Github</a></li><li><a href="https://twitter.com/freemarker">Follow us on Twitter</a></li><li><a href="https://issues.apache.org/jira/browse/FREEMARKER/">Report a bug</a></li><li><a href="http://stackoverflow.com/questions/ask?tags=freemarker">Ask a question</a></li><li><a href="http://freemarker.org/mailing-lists.html">Mailing lists</a></li></ul></div></div><div class="col-right"><ul class="social-icons"><li><a class="github" href="https://github.com/freemarker/freemarker">Github</a></li><li><a class="twitter" href="https://twitter.com/freemarker">Twitter</a></li><li><a class="stack-overflow" href="http://stackoverflow.com/questions/ask?tags=freemarker">Stack Overflow</a></li></ul><a class="xxe" href="http://www.xmlmind.com/xmleditor/" rel="nofollow" title="Edited with XMLMind XML Editor"><span>Edited with XMLMind XML Editor</span></a></div></div><div class="footer-bottom"> <p class="last-generated"> +Last generated: +<time itemprop="dateModified" datetime="2017-03-13T10:55:28Z" title="Monday, March 13, 2017 10:55:28 AM GMT">2017-03-13 10:55:28 GMT</time>, for Freemarker 2.3.26 </p> +<p class="copyright"> +© <span itemprop="copyrightYear">1999</span>â2017 +<a itemtype="http://schema.org/Organization" itemprop="copyrightHolder" href="http://apache.org/">The Apache Software Foundation</a>. Apache FreeMarker, FreeMarker, Apache Incubator, Apache, the Apache FreeMarker logo are trademarks of The Apache Software Foundation. </p> +</div></div></div></body> +</html>
