Back

doctype (clj)

(source)

variable

Map of doctype strings.

Examples

davidsantiago/tinsel
(ns tinsel.test.core
  (:use tinsel.core
        clojure.test)
  ;; These two are just for testing, see test-ns-membership.
  (:require [clojure.string :as str]
            [clojure.zip :as zip]
            [hiccup.core :as hiccup]
            [hiccup.page :as hpage])
  (:use clojure.walk))

;; Make sure we can use a string as a hiccup form, so we can set doctype.
(deftemplate string-as-form-template
  ["<!DOCTYPE html>" [:html ["body"]] "<!--asdf-->"]
  [])
deps-app/versions
(ns jarkeeper.utils
  (:require
    [hiccup.page :as page]
    [hiccup2.core :refer [html]]
    [compojure.response])
  (:import (hiccup.util RawString)))

(defmacro html5
  "Create a HTML5 document with the supplied contents."
  [options & contents]
  (if-not (map? options)
    `(html5 {} ~options ~@contents)
    `(let [options# (dissoc ~options :xml?)]
       (html {:mode :html}
             (page/doctype :html5)
             [:html options# ~@contents]))))