PageRenderTime 25ms CodeModel.GetById 15ms app.highlight 5ms RepoModel.GetById 2ms app.codeStats 0ms

/scalate-core/src/main/scala/org/fusesource/scalate/scaml/ScamlOptions.scala

http://github.com/scalate/scalate
Scala | 69 lines | 22 code | 10 blank | 37 comment | 0 complexity | 490b1f0127051211f5d56d0134ee52b2 MD5 | raw file
 1/**
 2 * Copyright (C) 2009-2011 the original author or authors.
 3 * See the notice.md file distributed with this work for additional
 4 * information regarding copyright ownership.
 5 *
 6 * Licensed under the Apache License, Version 2.0 (the "License");
 7 * you may not use this file except in compliance with the License.
 8 * You may obtain a copy of the License at
 9 *
10 *     http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
17 */
18package org.fusesource.scalate.scaml
19
20/**
21 *
22 * @author <a href="http://hiramchirino.com">Hiram Chirino</a>
23 */
24object ScamlOptions {
25
26  object Format extends Enumeration {
27    val xhtml, html4, html5 = Value
28  }
29
30  val DEFAULT_FORMAT = Format.xhtml
31  val DEFAULT_AUTOCLOSE = List(
32    "meta",
33    "img",
34    "link",
35    "br",
36    "hr",
37    "input")
38
39  val DEFAULT_INDENT = "  "
40  val DEFAULT_NL = "\n"
41  val DEFAULT_UGLY = false
42
43  var format = DEFAULT_FORMAT
44
45  /**
46   * If this is set to null, then all elements is be autoclosed.
47   */
48  var autoclose = DEFAULT_AUTOCLOSE
49
50  /**
51   * The indent type used in Scaml markup output.  Defaults
52   * to two spaces.
53   */
54  var indent = DEFAULT_INDENT
55
56  /**
57   * The newline separator used in the produced markup output.  Defaults
58   * to <code>"\n"</code>.
59   */
60  var nl = DEFAULT_NL
61
62  /**
63   * Use ugly content rendering by default.  When ugly rendering is
64   * enabled, evaluated content is not re-indented and newline
65   * preservation is not applied either.
66   */
67  var ugly = DEFAULT_UGLY
68
69}