/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. */
  18. package org.fusesource.scalate.scaml
  19. /**
  20. *
  21. * @author <a href="http://hiramchirino.com">Hiram Chirino</a>
  22. */
  23. object ScamlOptions {
  24. object Format extends Enumeration {
  25. val xhtml, html4, html5 = Value
  26. }
  27. val DEFAULT_FORMAT = Format.xhtml
  28. val DEFAULT_AUTOCLOSE = List(
  29. "meta",
  30. "img",
  31. "link",
  32. "br",
  33. "hr",
  34. "input")
  35. val DEFAULT_INDENT = " "
  36. val DEFAULT_NL = "\n"
  37. val DEFAULT_UGLY = false
  38. var format = DEFAULT_FORMAT
  39. /**
  40. * If this is set to null, then all elements is be autoclosed.
  41. */
  42. var autoclose = DEFAULT_AUTOCLOSE
  43. /**
  44. * The indent type used in Scaml markup output. Defaults
  45. * to two spaces.
  46. */
  47. var indent = DEFAULT_INDENT
  48. /**
  49. * The newline separator used in the produced markup output. Defaults
  50. * to <code>"\n"</code>.
  51. */
  52. var nl = DEFAULT_NL
  53. /**
  54. * Use ugly content rendering by default. When ugly rendering is
  55. * enabled, evaluated content is not re-indented and newline
  56. * preservation is not applied either.
  57. */
  58. var ugly = DEFAULT_UGLY
  59. }