Skip to content

Commit

Permalink
another update to the css -- looking even better now!
Browse files Browse the repository at this point in the history
  • Loading branch information
devn committed Apr 26, 2010
1 parent d82edbf commit ec8b778
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 32 deletions.
39 changes: 24 additions & 15 deletions resources/public/css/application.css
Expand Up @@ -52,9 +52,6 @@ table {
}

/* GetClojure.org Custom CSS */
.toggle a {
text-decoration: none;
}

/* @group Generic */
body{
Expand All @@ -70,12 +67,13 @@ s,strike{text-decoration:line-through}

/* @group Content */
#content{
width:65%;
width:100%;
}
/* @group Doc Header */
.docstring{
overflow:hidden;
width:100%;
padding-bottom: 10px;
}
.doc-header{
background:#EEE;
Expand All @@ -96,43 +94,54 @@ s,strike{text-decoration:line-through}
color:#333;
font-weight:bold;
}
.doc-header h1,.doc-header .syntaxhighlighter{
float:left !important;
margin-left: 20px !important;
.doc-header h1,.doc-header .arglist{
float:left;
margin-left: 20px;
}
.doc-header p{
color:#444;
font-size:12px;
margin:3px 0px 3px 20px;
}
.doc-header .syntaxhighlighter{
.doc-header .arglist{
width: 250px;
height: 2em;
background:#FFF;
border:1px solid #DDD;
margin:9px 0 0 15px;
padding:5px;
margin: 5px 0px 5px 10px;
padding:0px 5px 10px 0px;;
}
/* @end */

/* @group Examples */
.examples{
padding-top:125px;
padding-top:90px;
position:relative;
}
.example{
border-bottom:1px solid #DDD;
padding:10px 0px;
overflow:hidden;
width:100% !important;
overflow: hidden;
}
.example:last-child{
border-bottom:0;
}

.example .left,.example .right{
float: left;
width: 100%;
}

.example h1{
font-size:18px;
margin:10px 0;
color: #888;
margin:5px 0px;
padding: 5px 0 0 0;
}
.example .left,.example .right{

.example .syntaxhighlighter{
float:left;
width: 60%;
}

.example .code,.example .return{
Expand Down
2 changes: 1 addition & 1 deletion src/walton/core.clj
Expand Up @@ -7,7 +7,7 @@
ring.util.response
ring.middleware.file
[ring.adapter.jetty :only [run-jetty]]
[walton integration layout]) ;; removed irc
[walton integration layout]) ;; removed irc for the time being
(:require [org.danlarkin [json :as json]])
(:gen-class))

Expand Down
27 changes: 11 additions & 16 deletions src/walton/layout.clj
Expand Up @@ -38,41 +38,37 @@
"Show codes (literal strings or forms) in a pre/code block."
[& codes]
(let [code-string (apply format-code codes)
class-string "brush: clojure; toolbar: true;"
class-string
(if (one-liner? code-string)
(str class-string " light: true;") class-string)]
class-string "brush: clojure; toolbar: true;"]
[:script {:type "syntaxhighlighter" :class class-string}
(str "<![CDATA[" code-string "]]>")]))

(defn hide-show [#^String s n]
[:div.example
[:div.left
[:h1 (str n)]]
[:h1 (str n ". ")]]
[:div.right
[:div.code (code* (first s))]
[:div.return (code* (second s))]]])

(defn google-api []
(html
(include-js "http://www.google.com/jsapi?key=ABQIAAAAf81JAvR-zjjyFg4UPBcQ7hRUEEC_1sQajlg8OegeKNzx-mGf0RTW79MfTS7T6otdVJ5Q6A0_gqwzcg")
(javascript-tag "google.load(\"jquery\", \"1.4.2\");
google.load(\"jqueryui\", \"1.8.0\");")))
(javascript-tag "google.load(jquery, 1.4.2);")))

(defn application [text body]
(html
[:html
[:head
(include-js "/javascript/syntaxhilighter/scripts/shCore.js"
"/javascript/syntaxhilighter/scripts/shBrushClojure.js"
"/javascript/jquery-1.4.2.js"
"/javascript/application.js")
(google-api)
(include-css "/javascript/syntaxhilighter/styles/shCore.css"
"/javascript/syntaxhilighter/styles/shThemeDefault.css"
"/css/application.css")
(javascript-tag "SyntaxHighlighter.defaults['gutter'] = false;
SyntaxHighlighter.defaults['toolbar'] = true;
SyntaxHighlighter.defaults['light'] = false;
SyntaxHighlighter.defaults['toolbar'] = false;
SyntaxHighlighter.defaults['light'] = true;
SyntaxHighlighter.all();")
[:title text]]
[:body
Expand All @@ -84,15 +80,14 @@ SyntaxHighlighter.all();")
[:h1 text]
(let [sym (-> (str "clojure.core/" text) symbol find-var)]
(if (meta sym)
[:pre.brush:.clojure (str (:arglists (meta sym)))]))]
[:div.arglist (code* (str (:arglists (meta sym))))]))]
(let [sym (-> (str "clojure.core/" text) symbol find-var)]
(if (meta sym)
(html [:p [:i
(str (ns-name (:ns (meta sym))) "/"
(:name (meta sym)))] ":"
[:br]
(html [:p
(when (:macro (meta sym))
[:b "Macro"])
[:b "Macro" [:br]])
[:i (str (ns-name (:ns (meta sym))) "/"
(:name (meta sym)))] ": "
(str (:doc (meta sym)))])))]
[:div.examples
body]]]]]))
Expand Down

0 comments on commit ec8b778

Please sign in to comment.