Update of /project/lisppaste/cvsroot/lisppaste2 In directory common-lisp.net:/home/bmastenbrook/lisppaste2
Modified Files: coloring-types.lisp coloring-css.lisp web-server.lisp Log Message: Index of paste annotations; adjust Lisp coloring to find less english and MORE CODE; tweak to CSS to not underline links to specifications.
Date: Thu Jun 17 05:46:59 2004 Author: bmastenbrook
Index: lisppaste2/coloring-types.lisp diff -u lisppaste2/coloring-types.lisp:1.7 lisppaste2/coloring-types.lisp:1.8 --- lisppaste2/coloring-types.lisp:1.7 Tue Jun 15 06:52:52 2004 +++ lisppaste2/coloring-types.lisp Thu Jun 17 05:46:59 2004 @@ -22,10 +22,10 @@ (defparameter *close-parens* '(#)))
(define-coloring-type :lisp "Basic Lisp" - :modes (:normal :symbol :escaped-symbol :keyword :string :comment + :modes (:first-char-on-line :normal :symbol :escaped-symbol :keyword :string :comment :multiline :character :single-escaped :in-list :syntax-error) - :default-mode :normal + :default-mode :first-char-on-line :transitions (((:in-list) ((or @@ -59,10 +59,20 @@ ((scan #() (set-mode :in-list :until (scan #))))) - (:normal + ((:normal :first-char-on-line) ((scan #() (set-mode :in-list :until (scan #))))) + (:first-char-on-line + ((scan #;) + (set-mode :comment + :until (scan #\newline))) + ((scan "#|") + (set-mode :multiline + :until (scan "|#"))) + ((advance 1) + (set-mode :normal + :until (scan #\newline)))) (:multiline ((scan "#|") (set-mode :multiline @@ -81,9 +91,10 @@ (loop for i from paren-counter downto 1 collect "</span></span>"))) :formatters - ((:normal (lambda (type s) - (declare (ignore type)) - s)) + (((:normal :first-char-on-line) + (lambda (type s) + (declare (ignore type)) + s)) ((:in-list) (lambda (type s) (declare (ignore type))
Index: lisppaste2/coloring-css.lisp diff -u lisppaste2/coloring-css.lisp:1.2 lisppaste2/coloring-css.lisp:1.3 --- lisppaste2/coloring-css.lisp:1.2 Tue Jun 8 08:23:04 2004 +++ lisppaste2/coloring-css.lisp Thu Jun 17 05:46:59 2004 @@ -4,10 +4,10 @@
(defparameter *coloring-css* ".symbol { color : #770055; background-color : inherit; } -a.symbol:link { color : #229955; background-color : inherit; text-decoration: underline; } -a.symbol:active { color : #229955; background-color : inherit; text-decoration: underline; } -a.symbol:visited { color : #229955; background-color : inherit; text-decoration: underline; } -a.symbol:hover { color : #229955; background-color : inherit; text-decoration: underline; } +a.symbol:link { color : #229955; background-color : inherit; text-decoration: none; } +a.symbol:active { color : #229955; background-color : inherit; text-decoration: none; } +a.symbol:visited { color : #229955; background-color : inherit; text-decoration: none; } +a.symbol:hover { color : #229955; background-color : inherit; text-decoration: none; } .special { color : #FF5000; background-color : inherit; } .keyword { color : #770000; background-color : inherit; } .comment { color : #007777; background-color : inherit; }
Index: lisppaste2/web-server.lisp diff -u lisppaste2/web-server.lisp:1.56 lisppaste2/web-server.lisp:1.57 --- lisppaste2/web-server.lisp:1.56 Fri Jun 11 10:35:33 2004 +++ lisppaste2/web-server.lisp Thu Jun 17 05:46:59 2004 @@ -1,4 +1,4 @@ -;;;; $Id: web-server.lisp,v 1.56 2004/06/11 17:35:33 bmastenbrook Exp $ +;;;; $Id: web-server.lisp,v 1.57 2004/06/17 12:46:59 bmastenbrook Exp $ ;;;; $Source: /project/lisppaste/cvsroot/lisppaste2/web-server.lisp,v $
;;;; See the LICENSE file for licensing information. @@ -18,7 +18,8 @@ (colorization-mode :initarg :colorization-mode :initform "" :accessor paste-colorization-mode)))
(defmacro make-paste (&rest arguments) - `(make-instance 'paste ,@arguments)) + `(progn + (funcall 'make-instance 'paste ,@arguments)))
(defclass new-paste-handler (araneida:handler) ())
@@ -135,7 +136,7 @@ (t (format nil "~A~A" (time-delta-primitive delta level) (if ago-p " ago" ""))))))
(defun irc-log-link (utime channel) - (format nil "http://meme.b9.com/now?utime=~A&channel=~A" + (format nil "http://meme.b9.com/now.html?utime=~A&channel=~A" utime (string-left-trim "#" channel)))
@@ -654,12 +655,11 @@ `((tr (td) ((td :align "left" :width "100%") ,@(if (not annotation) - `((,(encode-for-pre (paste-channel paste)) ,(if *meme-links* - " | " "")))) + `((,(encode-for-pre (paste-channel paste))))) ,@(if (and *meme-links* (not (and *no-channel-pastes* (string-equal (paste-channel paste) "None")))) - `(((a :href ,(irc-log-link (paste-universal-time paste) (paste-channel paste))) "Context in IRC logs"))))))) + `(" | " ((a :href ,(irc-log-link (paste-universal-time paste) (paste-channel paste))) "Context in IRC logs"))))))) (tr ((td :align "left" :valign "top" :nowrap "nowrap") "Paste contents:") ,@(if this-url `(((td :width "100%") ((a :href ,(concatenate 'string this-url "/raw")) "(raw source)"))))) @@ -734,6 +734,18 @@ colorize:*coloring-css*)) ,(rss-link-header)) (body + + ,@(if (paste-annotations paste) + `("Index of paste annotations: " + ,@(loop for ann in (reverse (paste-annotations paste)) + for test from (length (paste-annotations paste)) downto 1 + appending + `(((a :href ,(format nil "#~A" + (paste-number ann))) + ,(prin1-to-string (paste-number ann)))) + if (not (eql test 1)) + appending '(" | ")) + (p))) ,(format-paste paste (araneida:urlstring (araneida:request-url request)) paste-number nil colorize-as linenumbers) ,@(if (paste-annotations paste)