You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@freemarker.apache.org by dd...@apache.org on 2015/12/30 19:11:35 UTC
[15/35] incubator-freemarker git commit: More helpful JavaDoc for
some OutputFormat-related parts.
More helpful JavaDoc for some OutputFormat-related parts.
Project: http://git-wip-us.apache.org/repos/asf/incubator-freemarker/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-freemarker/commit/7051e55c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-freemarker/tree/7051e55c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-freemarker/diff/7051e55c
Branch: refs/heads/2.3
Commit: 7051e55cfffe244a9ef537c62ec71d45c9d569ad
Parents: 2153e23
Author: ddekany <dd...@apache.org>
Authored: Tue Dec 22 22:17:39 2015 +0100
Committer: ddekany <dd...@apache.org>
Committed: Tue Dec 22 22:17:39 2015 +0100
----------------------------------------------------------------------
src/main/java/freemarker/template/Configuration.java | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/7051e55c/src/main/java/freemarker/template/Configuration.java
----------------------------------------------------------------------
diff --git a/src/main/java/freemarker/template/Configuration.java b/src/main/java/freemarker/template/Configuration.java
index 4fd347c..7226ef2 100644
--- a/src/main/java/freemarker/template/Configuration.java
+++ b/src/main/java/freemarker/template/Configuration.java
@@ -1800,11 +1800,15 @@ public class Configuration extends Configurable implements Cloneable, ParserConf
}
/**
- * Sets the (default) output format. Usually, you leave this on its default, which is
- * {@link UndefinedOutputFormat#INSTANCE}, and then override it for individual templates based on their name (like
- * based on their "file" extension) with {@link #setTemplateConfigurations(TemplateConfigurationFactory)}. This
- * setting is also overridden by the standard file extensions; see them at
- * {@link #setRecognizeStandardFileExtensions(boolean)}.
+ * Sets the default output format. Usually, you should leave this on its default, which is
+ * {@link UndefinedOutputFormat#INSTANCE}, and then use standard file extensions like "ftlh" (for HTML output) and
+ * ensure that {@link #setRecognizeStandardFileExtensions(boolean)} is {@code true} (see the description of standard
+ * file extensions there too). Where that approach doesn't fit, like you have no control over the file extensions,
+ * templates can be associated to output formats with patterns matching their name (their path) using
+ * {@link #setTemplateConfigurations(TemplateConfigurationFactory)}. Last not least, if all templates will have the
+ * same output format, you may use {@link #setOutputFormat(OutputFormat)} to set a value like
+ * {@link HTMLOutputFormat#INSTANCE}, {@link XMLOutputFormat#INSTANCE}, etc. Also note templates can specify their
+ * own output format like {@code <#ftl output_format="HTML">}, which overrides any configuration settings.
*
* <p>
* The output format is mostly important because of auto-escaping (see {@link #setAutoEscapingPolicy(int)}), but