Skip to content

Commit

Permalink
Update templates, scripts, styles, and page handlers
Browse files Browse the repository at this point in the history
  • Loading branch information
thephoeron committed Jun 7, 2014
1 parent f8f6499 commit 5c41d2f
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 15 deletions.
5 changes: 5 additions & 0 deletions handlers.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,11 @@
(cl-who:with-html-output (hunchentoot::*standard-output*)
(str (3bmd:parse-and-print-to-stream "book/configuration.md" hunchentoot::*standard-output* :format :html)))))

(define-easy-handler (llthw-book-1-0-0-overview :uri "/book/1-0-0-overview/") ()
(llthw-page ()
(cl-who:with-html-output (hunchentoot::*standard-output*)
(str (3bmd:parse-and-print-to-stream "book/1-0-0-overview.md" hunchentoot::*standard-output* :format :html)))))

(define-easy-handler (llthw-book-1-1-0-syntax-overview :uri "/book/1-1-0-syntax-overview/") ()
(llthw-page ()
(cl-who:with-html-output (hunchentoot::*standard-output*)
Expand Down
16 changes: 7 additions & 9 deletions scripts.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,13 @@
(define-easy-handler (llthw-js :uri "/llthw.js") ()
(setf (content-type*) "text/javascript")
(ps
((@ ($ document) ready)
((@ ((@ ((@ ($ "#llthwdoc") children)) filter) ":header") each)
(lambda ()
((@ ($ "h1") each)
(lambda ()
(let* ((the-title ((@ ($ this) text)))
(the-id ((@ ((@ the-title to-lower-case)) replace) #\Space "-")))
((@ ($ this) attr) "id" the-id)
((@ ($ "ul.sidenav") append) (+ "<li><a href='#" the-id "'>" the-title "</a></li>"))
(return false))))
(return false)))))
(let* ((the-title ((@ ($ this) text)))
(the-id ((@ ((@ the-title to-lower-case)) replace) (regex "/[\,\.\!\@\#\$\%\^\&\*\(\)\? ]/g") "-")))
((@ ($ this) attr) "id" the-id)
((@ ($ "ul.sidenav") append) (+ "<li><a href='#" the-id "'>" the-title "</a></li>"))
(return true))))
((@ ($ "ul.sidenav") append) "<li><a href='#top'><i class='fa fa-angle-up'></i> Back to Top</a></li>")))

;; EOF
43 changes: 41 additions & 2 deletions static/css/llthw.css
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,8 @@ body {
}

.sidenav {
margin-top: 20px;
margin-bottom: 20px
margin-top: 0px;
margin-bottom: 0px
}

.sidebar .nav>li>a {
Expand Down Expand Up @@ -209,6 +209,45 @@ body {
padding-left: 28px
}

@media (min-width:992px) {
.sidebar .nav>.active>ul {
display: block
}

.sidebar.affix,.sidebar.affix-bottom {
width: 213px
}

.sidebar.affix {
position: fixed;
top: 70px
}

.sidebar.affix-bottom {
position: absolute
}

.sidebar.affix-bottom .sidenav,.sidebar.affix .sidenav {
margin-top: 0;
margin-bottom: 0
}
}

@media (min-width:1200px) {
.sidebar.affix-bottom,.sidebar.affix {
width: 263px
}
}

#llthwdoc h1,
#llthwdoc h2,
#llthwdoc h3,
#llthwdoc h4,
#llthwdoc h5,
#llthwdoc h6 {
line-height: 1.5;
}

#footer {
position: absolute;
bottom: 0;
Expand Down
8 changes: 4 additions & 4 deletions templates.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
(:link :rel "stylesheet" :href "/static/css/llthw.css")
;(:style :type "text/css" (str colorize:*coloring-css*))
(:title ,title))
(:body
(:body :data-spy "scroll" :data-target ".sidebar" :data-offset "90"
(:nav :class "navbar navbar-inverse navbar-fixed-top" :role "navigation"
(:div :class "container"
(:div :class "navbar-header"
Expand All @@ -86,11 +86,11 @@
(:div :class "container" :id "body"
(:div :class "row"
(:div :class "col-md-9" :id "llthwdoc"
(:a :name "top")
,@body)
(:div :class "col-md-3"
(:div :class "sidebar hidden-print affix" :role "complementary"
(:ul :class "nav sidenav"
(:li (:a :href "#top" "Back to Top")))))))
(:div :class "sidebar hidden-print affix" :data-spy "affix" :data-offset-top "250" :role "complementary"
(:ul :class "nav sidenav")))))
;(:div :id "console" :data-spy "affix" :data-offset-top "60" :class "affix")
(llthw-footer)
(:script :src "//code.jquery.com/jquery-1.11.0.min.js")
Expand Down

0 comments on commit 5c41d2f

Please sign in to comment.