Skip to content

Instantly share code, notes, and snippets.

@devn
Created May 7, 2010 19:07
Show Gist options
  • Select an option

  • Save devn/393875 to your computer and use it in GitHub Desktop.

Select an option

Save devn/393875 to your computer and use it in GitHub Desktop.
(defn application [text body]
(html
[:html
[:head
(include-js "/javascript/jquery.js"
"/javascript/syntaxhilighter/scripts/shCore.js"
"/javascript/syntaxhilighter/scripts/shBrushClojure.js"
"/javascript/application.js")
(include-css "/javascript/syntaxhilighter/styles/shCore.css"
"/javascript/syntaxhilighter/styles/shThemeDefault.css"
"/css/application.css")
(javascript-tag "SyntaxHighlighter.defaults['gutter'] = false;
SyntaxHighlighter.defaults['toolbar'] = false;
SyntaxHighlighter.defaults['light'] = true;
SyntaxHighlighter.all();")
[:title text]]
[:body
[:div#wrapper
[:div#nav]
[:div#content
[:div.doc-header
[:div.docstring
[:h1 text]
(let [sym (-> (str "clojure.core/" text) symbol find-var)]
(if (meta sym)
[:div.arglist (code* (str (:arglists (meta sym))))]))]
(let [sym (-> (str "clojure.core/" text) symbol find-var)]
(if (meta sym)
(html [:p
(when (:macro (meta sym))
[:b "Macro" [:br]])
[:i (str (ns-name (:ns (meta sym))) "/"
(:name (meta sym)))] ": "
(str (:doc (meta sym)))])))]
[:div.examples
body]]]]]))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment