Skip to content

Instantly share code, notes, and snippets.

@glucero
Created March 14, 2013 16:50
Show Gist options
  • Save glucero/5162964 to your computer and use it in GitHub Desktop.
Save glucero/5162964 to your computer and use it in GitHub Desktop.
simple tabs
(defn build-tab
[index item]
[:li [:a {:href (str "#tab-link-" index)
:data-toggle "tab"} (str (:name item))]])
(defn import-css
[location]
[:link {:type "text/css" :href location :rel "stylesheet"}])
(defn import-js
[location]
[:script {:type "text/javascript", :src location}])
(defn html5
[body]
(html {:mode :html} "<!DOCTYPE html>\n"
[:html {:lang "en"}
(import-css (URL. "http://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.1/css/bootstrap-combined.min.css"))
(import-js (URL. "http://code.jquery.com/jquery-1.9.1.min.js"))
(import-js (URL. "http://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.1/js/bootstrap.min.js"))
body]))
(defn build-page
[data]
(html5
[:body
[:div {:class "tabbable tabs-left"}
[:ul {:class "nav nav-tabs"}
(map-indexed build-tab (:items data))]]]))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment