Changeset 14311 for lang/gauche/oldtype

Show
Ignore:
Timestamp:
06/20/08 23:57:48 (5 years ago)
Author:
kiyoka
Message:

Made the contents of RSS feed's <description> cotain full text.
Supported null line for Wiki format.

Location:
lang/gauche/oldtype/trunk/Kahua/oldtype/oldtype
Files:
7 modified

Legend:

Unmodified
Added
Removed
  • lang/gauche/oldtype/trunk/Kahua/oldtype/oldtype/format.scm

    r14263 r14311  
    139139                      ((pre-ol2)     (cons "## "    (rec arg))) 
    140140                      ((pre-ol3)     (cons "### "   (rec arg))) 
    141                       ((h1)          (cons "[] "    (rec (cdr arg)))) 
    142                       ((h2)          (cons "* "     (rec (cdr arg)))) 
    143                       ((h3)          (cons "** "    (rec (cdr arg)))) 
    144                       ((h4)          (cons "*** "   (rec (cdr arg)))) 
    145                       ((h5)          (cons "**** "  (rec (cdr arg)))) 
    146                       ((h6)          (cons "***** " (rec (cdr arg)))) 
     141                      ((h1)          (cons "[] "    (rec arg))) 
     142                      ((h2)          (cons "* "     (rec arg))) 
     143                      ((h3)          (cons "** "    (rec arg))) 
     144                      ((h4)          (cons "*** "   (rec arg))) 
     145                      ((h5)          (cons "**** "  (rec arg))) 
     146                      ((h6)          (cons "***** " (rec arg))) 
    147147                      ((wiki-macro)  (oldtype:wiki-macro->plain arg)) 
    148148                      ((wiki-name)   (oldtype:wikiname->plain (car arg))) 
    149149                      ((hr)          (list "----\n")) 
     150                      ((@)           '()) 
     151                      ((@@)          '()) 
    150152                      (else 
    151153                       (format "!!Error : no such tag \"~a\"!!" name))) 
  • lang/gauche/oldtype/trunk/Kahua/oldtype/oldtype/oldtype.kahua

    r13660 r14311  
    9999              (tr/ 
    100100               (td/ "lineno") 
    101                (td/ lineno)) 
    102               (tr/ 
    103                (td/ "EmacsLisp") 
    104                (td/ (format ";; (oldtype-openfile \"~a\" ~a)" (name-of oldtype-page) lineno)))) 
     101               (td/ lineno))) 
    105102             (h2/ "Information of This Page.") 
    106103             (pre/ 
     
    114111                (get-text-list oldtype-page))))) 
    115112            "" 
     113            lineno 
    116114            )))) 
    117115   nodeset)) 
     
    275273 
    276274 
    277 (define (standard-page wikiname barcode nodes first-line) 
     275(define (standard-page wikiname barcode nodes first-line . rest-arg) 
    278276  (html/ (head/ (title/ (string-append wikiname " / " first-line)) 
    279277                (link/ (@/ (rel "stylesheet") (type "text/css") 
     
    292290                (if (eq? 'w3m (oldtype-user-agent)) 
    293291                    (div/ 
    294                      (format " ;; (oldtype-openfile \"~a\" 1)" wikiname) 
     292                     (format " ;; (oldtype-openfile \"~a\" ~d)" wikiname (if (not (null? rest-arg)) 
     293                                                                             (car rest-arg) 
     294                                                                             1)) 
    295295                     (br/)) 
    296296                    (text/ "")) 
     
    315315                (span/ (@/ (class "forw3m")))) 
    316316          (br/) 
    317           (h1/ 
    318            wikiname 
    319            " " 
    320            (a/ (@/ (href (oldtype:gen-rss-path wikiname)) 
    321                    (class "help") 
    322                    (title "This is RSS feed URL")) 
    323                (oldtype:icon-image 'rss)) 
    324            (oldtype:hatena-bookmarks wikiname)) 
     317          (h1/ wikiname 
     318               " " 
     319               (a/ (@/ (href (oldtype:gen-rss-path wikiname)) 
     320                       (class "help") 
     321                       (title "This is RSS feed URL")) 
     322                   (oldtype:icon-image 'rss)) 
     323               (a/ (@/ (href (oldtype:gen-plain-path wikiname)) 
     324                       (class "help") 
     325                       (title "PLAIN TEXT")) 
     326                   (oldtype:icon-image 'plain)) 
     327               (oldtype:hatena-bookmarks wikiname)) 
    325328          barcode 
    326329          (hr/) 
     
    341344            (#/^[ ]*$/ x) 
    342345            (#/^[ ]*##/ x)))) 
    343     (get-text-list oldtype-page)))) 
     346    (get-plain-list oldtype-page)))) 
    344347 
    345348 
     
    367370  (let ((wikiname (or wikiname "index"))) 
    368371    (show-page/page wikiname))) 
     372 
     373 
     374(define-entry (show-plain wikiname) 
     375  (let* ((wikiname (or wikiname "index")) 
     376         (oldtype-page (oldtype:load-page (kahua-site-root) wikiname))) 
     377    (html/ 
     378     (head/ 
     379      (title/ (string-append wikiname))) 
     380     (body/ 
     381      (pre/ 
     382       (string-join 
     383        (get-plain-list oldtype-page) 
     384        "\n")))))) 
    369385 
    370386 
     
    400416                (item/ 
    401417                 (title/            (string-append (name-of e) "::" (oldtype-first-line e))) 
    402                  (description/      (oldtype-first-line e)) 
     418                 (description/      (string-join (get-plain-list e) "<br>")) 
    403419                 (link/             (string-append base-url "show-page/" (uri-encode-string (name-of e)) 
    404420                                                   (if (< 1 lineno) 
  • lang/gauche/oldtype/trunk/Kahua/oldtype/oldtype/page.scm

    r14263 r14311  
    5757          get-text 
    5858          get-text-list 
     59          get-plain-list 
    5960          get-rss-entry-pages 
    6061          )) 
     
    138139  (vector->list (text-of (timeline-of self)))) 
    139140 
     141(define-method get-plain-list ((self <oldtype-page>)) 
     142  (vector->list (plain-of self))) 
     143 
    140144 
    141145(define-method _get-rss-lineno-list ((self <oldtype-page>)) 
  • lang/gauche/oldtype/trunk/Kahua/oldtype/oldtype/parse.scm

    r14228 r14311  
    208208      (case (token-type tok) 
    209209        ((eof)  (reverse! seed)) 
    210         ((null) (block (next-token ctx) ctx (cons `(div (@@ (lineno ,line-no)) (p-normal "\n")) seed))) 
     210        ((null) (block (next-token ctx) ctx (cons `(div (@@ (lineno ,line-no)) (p-normal " \n")) seed))) 
    211211        ((hr)   (block (next-token ctx) ctx (cons `(div (@@ (lineno ,line-no)) (hr)) seed))) 
    212212        ((open-single-verb) 
  • lang/gauche/oldtype/trunk/Kahua/oldtype/oldtype/staticimg/preview_list.html

    r9948 r14311  
    88<img src="icon.person.png"/> 
    99<img src="dot16.png" />  
    10 img src="dot18.png" />  
     10<img src="dot18.png" />  
    1111<img src="dot20.png" />  
    1212<img src="icon.accept.png" />  
  • lang/gauche/oldtype/trunk/Kahua/oldtype/oldtype/util.kahua

    r13542 r14311  
    226226    ((rss) 
    227227     (img/ (@/ (src (string-append (oldtype:static-image-path) "icon.rss.png")) 
    228                (alt "RSS") (class "icon")))) 
     228               (alt "RSS")))) 
     229    ((plain) 
     230     (img/ (@/ (src (string-append (oldtype:static-image-path) "icon.article_text.png")) 
     231               (alt "PLAIN")))) 
    229232    (else 
    230233     `(p/ ,(format "!!Error : no such icon-image \"~a\"!!" sym))))) 
     
    347350   "/get-rss/" wikiname)) 
    348351 
     352(define (oldtype:gen-plain-path wikiname) 
     353  (string-append 
     354   "/show-plain/" wikiname)) 
     355 
    349356(define (oldtype:expand-wiki-name name) 
    350357  (let1 url-name 
  • lang/gauche/oldtype/trunk/Kahua/oldtype/oldtype/util.scm

    r13617 r14311  
    11;;; 
    2 ;;; oldtype/format.scm - format wiki pages (backward compatibility module) 
    3 ;;; 
    4 ;;;  Copyright (c) 2003-2006 Shiro Kawai, All rights reserved. 
     2;;; oldtype/util.scm - util for OldType 
     3;;; 
     4;;;  Copyright (c) 2008 Kiyoka Nishiyama, All rights reserved. 
    55;;; 
    66;;;  Permission is hereby granted, free of charge, to any person 
     
    2525;;; 
    2626;;; $Id: util.scm 199 2008-01-13 11:16:43Z kiyoka $ 
    27 ;;; 
    28 ;;; Modified by kiyoka to implement OldType wiki formatter. 
    29 ;;; I renamed namespace of wiliki- 'oldtype-' to avoid collision of 
    30 ;;; installation. 
    3127;;; 
    3228