Permalink
Browse files

Synced with 3bmd changes, factored out article description printing

  • Loading branch information...
1 parent 5dca309 commit a4f146012adf65e72da5e2db275f67f98d472d09 @vsedach committed Nov 16, 2011
Showing with 20 additions and 11 deletions.
  1. +10 −7 src/markup.lisp
  2. +2 −4 src/search.lisp
  3. +8 −0 static/css/style.css
View
@@ -61,7 +61,7 @@
(define-rule category-link (and (and (? #\\) "*(") (+ (and (! #\)) character)) #\))
(:destructure (start category end)
(declare (ignore start end))
- (cons :article-link (cliki2::cut-whitespace (text category)))))
+ (cons :article-link (cut-whitespace (text category)))))
;;;; code-block
@@ -101,12 +101,15 @@
:attributes (("a" . ("href" "class")))
:protocols (("a" . (("href" . (:ftp :http :https :mailto :relative))))))
+(defun pprint-article-summary-li (article)
+ #H[<li>] (pprint-article-link (title article))
+ #H[<span class="search_result_description">${(generate-html-from-markup (article-description article) +links-only+)}</span></li>])
+
(defmethod 3bmd:print-tagged-element ((tag (eql :cliki2-category-list)) *html-stream* category)
- #H[<ul>]
- (dolist (article (sort (copy-list (cliki2::articles-with-category category))
- #'string<
- :key 'cliki2::canonical-title))
- #H[<li><a href="${(link-to article)}">${(title article)}</a> - ${(generate-html-from-markup (article-description article) +links-only+)}</li>])
+ #H[<ul class="category_list">]
+ (map nil #'pprint-article-summary-li
+ (sort (copy-list (articles-with-category category))
+ #'string< :key 'canonical-title))
#H[</ul>])
;;;; package-link
@@ -121,7 +124,7 @@
;;;; cliki2 markup extensions
-(define-rule 3bmd-grammar:inline-extensions
+(define-rule 3bmd-grammar::inline-extensions
(or article-link
person-link
hyperspec-link
View
@@ -48,10 +48,8 @@
#H[<h1>Search results</h1>]
(if articles
(progn
- #H[<ol start="${(1+ start)}">]
- (dolist (article articles)
- #H[<li>] (pprint-article-link (title article))
- #H[<div>${(article-description article)}</div></li>])
+ #H[<ol start="${(1+ start)}" id="search_results">]
+ (map nil #'pprint-article-summary-li articles)
#H[</ol>
<div id="paginator">
<span>Result page:</span>
View
@@ -156,6 +156,10 @@
#search input[type=submit] {border:none;background:#175487;width: 65px; height: 23px;line-height:23px;color:white;cursor:pointer;}
#search input[type=submit]:hover { background: #256aa3 ; }
+#search_results .search_result_description {
+ display:block;
+}
+
#paginator {
color: #333;
background: #eee;
@@ -222,6 +226,10 @@
#content a.hyperspec { color: #4040f2;}
#content a.download { color: #00E; font-weight: bold; }
+.category_list .search_result_description:before {
+ content:" - ";
+}
+
#footer {
margin-top: 20px;
}

0 comments on commit a4f1460

Please sign in to comment.