- Timestamp:
- 10/24/08 21:49:41 (5 years ago)
- Location:
- lang/gauche/oldtype/branches/stable
- Files:
-
- 15 modified
-
Kahua/oldtype/oldtype/format.scm (modified) (6 diffs)
-
Kahua/oldtype/oldtype/oldtype-mode.el (modified) (5 diffs)
-
Kahua/oldtype/oldtype/oldtype.kahua (modified) (1 diff)
-
Kahua/oldtype/oldtype/page.scm (modified) (6 diffs)
-
Kahua/oldtype/oldtype/util.kahua (modified) (2 diffs)
-
Kahua/oldtype/oldtype/util.scm (modified) (2 diffs)
-
Kahua/oldtype/oldtype/version.kahua (modified) (1 diff)
-
Makefile (modified) (1 diff)
-
src (modified) (1 prop)
-
src/Makefile (modified) (1 diff)
-
src/Test.no-timeline.sexp.master (modified) (1 diff)
-
src/Test.sexp.master (modified) (1 diff)
-
src/oldtype_to (modified) (1 diff)
-
src/test.scm (modified) (2 diffs)
-
tool/tdiary2oldtype (modified) (1 prop)
Legend:
- Unmodified
- Added
- Removed
-
lang/gauche/oldtype/branches/stable/Kahua/oldtype/oldtype/format.scm
r21138 r22071 73 73 wikiname))) 74 74 75 (define (oldtype:wiki-macro->plain expr )75 (define (oldtype:wiki-macro->plain expr rich-mode) 76 76 (let ((command (car expr)) 77 77 (arg ;; symbol list to string list. … … 84 84 (len (length (cdr expr)))) 85 85 (case command 86 ((img) "[img] ") 86 ((img img-s img-m) 87 (if (and (#/^http:/ (car arg)) rich-mode) 88 (string-append "<img src=\"" (car arg) "\"/>") 89 "[img] ")) 87 90 ((todo) "[TODO] ") 88 91 ((done) "[DONE] ") 89 ((youtube) "[YouTube] ") 92 ((youtube youtube-s youtube-m) 93 (if (< 0 len) 94 (let ((_videoid (car arg))) 95 (if (not rich-mode) 96 (format #f "[YouTube ~a] " _videoid) 97 (string-append "<img src=\"" (oldtype:youtube-thumbnail _videoid) "\"" 98 (case command 99 ((youtube) " ") 100 ((youtube-s) (format #f " height=~a " oldtype:image-height-s)) 101 ((youtube-m) (format #f " height=~a " oldtype:image-height-m))) 102 "/>"))) 103 "!!Error : No argument ##(youtube VIDEOID) command")) 90 104 ((thumb) 91 105 (if (< 0 len) … … 93 107 (string-append "[Thumb " _url "] ")) 94 108 "!!Error : No argument ##(thumb URL) command")) 95 ((amazon )109 ((amazon amazon-s amazon-m) 96 110 (if (< 0 len) 97 111 (let* ((_asin (car arg)) … … 100 114 _asin))) 101 115 (if (#/^[0-9a-zA-Z]+$/ _asin) 102 (format "[Amazon ~a] " _asin) 116 (if (not rich-mode) 117 (format #f "[Amazon ~a]" _asin) 118 (string-append "<img src=\"" (oldtype:amazon-thumbnail _asin) "\"" 119 (case command 120 ((amazon) " ") 121 ((amazon-s) (format #f " height=~a " oldtype:image-height-s)) 122 ((amazon-m) (format #f " height=~a " oldtype:image-height-m))) 123 "/>")) 103 124 (format "!!Error : ASIN code format error for ##(amazon asin) command \"~a\"!!" _asin))) 104 "!!Error : No argument ##(amazon URL) command"))125 "!!Error : No argument ##(amazon ASINCODE) command")) 105 126 ;; timestamp 106 127 ((timestamp) "[timestamp] ") … … 165 186 ;; ) 166 187 ;; 167 (define (oldtype:sxml->plain-text sxmls )188 (define (oldtype:sxml->plain-text sxmls rich-mode) 168 189 (tree->string 169 190 (let rec … … 191 212 ((pre-ol2) (cons "## " (rec arg))) 192 213 ((pre-ol3) (cons "### " (rec arg))) 193 ((h1) (cons "[] " (rec arg))) 194 ((h2) (cons "* " (rec arg))) 195 ((h3) (cons "** " (rec arg))) 196 ((h4) (cons "*** " (rec arg))) 197 ((h5) (cons "**** " (rec arg))) 198 ((h6) (cons "***** " (rec arg))) 199 ((wiki-macro) (oldtype:wiki-macro->plain arg)) 214 ((h1) (if rich-mode 215 (list "<h1>" (rec arg) "</h1>") 216 (cons "[] " (rec arg)))) 217 ((h2) (if rich-mode 218 (list "<h2>" (rec arg) "</h2>") 219 (cons "* " (rec arg)))) 220 ((h3) (if rich-mode 221 (list "<h3>" (rec arg) "</h3>") 222 (cons "** " (rec arg)))) 223 ((h4) (if rich-mode 224 (list "<h4>" (rec arg) "</h4>") 225 (cons "*** " (rec arg)))) 226 ((h5) (if rich-mode 227 (list "<h5>" (rec arg) "</h5>") 228 (cons "**** " (rec arg)))) 229 ((h6) (if rich-mode 230 (list "<h6>" (rec arg) "</h6>") 231 (cons "***** " (rec arg)))) 232 ((wiki-macro) (oldtype:wiki-macro->plain arg rich-mode)) 200 233 ((wiki-name) (oldtype:wikiname->plain (car arg))) 201 ((hr) (list "----\n")) 234 ((hr) (if rich-mode 235 (list "<hr>") 236 (list "----\n"))) 202 237 ((@) '()) 203 238 ((@@) '()) -
lang/gauche/oldtype/branches/stable/Kahua/oldtype/oldtype/oldtype-mode.el
r21138 r22071 25 25 ;; 26 26 ;; How to nstall and How to use: 27 ;; http://oldtype.sumibi.org/ 27 ;; http://oldtype.sumibi.org/show-page/oldtype-mode 28 28 ;; 29 29 ;; 30 30 ;; ChangeLog: 31 ;; [0.0.9] 32 ;; 1. Bugfix: 'Converting URL to ##(amazon ASIN) command' feature generates wrong ASIN code. 33 ;; 31 34 ;; [0.0.8] 32 35 ;; 1. Fixed bug: illegal ASINCODE of amazon and VIDEOCODE of youtube use for image file creation. … … 57 60 ;; 58 61 ;; 59 (defconst oldtype-version "0.0. 8")62 (defconst oldtype-version "0.0.9") 60 63 61 64 (defconst oldtype-wikiname-face 'oldtype-wikiname-face) … … 645 648 (shell-command 646 649 (concat 647 (format "w3m -no-graph -halfdump -o ext_halfdump=1 -o strict_iso2022=0 -o fix_width_conv=1 \'%s\' |" url)650 "w3m -no-graph -halfdump -o ext_halfdump=1 -o strict_iso2022=0 -o fix_width_conv=1 \'" url "\' |" 648 651 "awk \'-F\<\' \'/title_alt/ { print $2; }\' |" 649 652 "tail -1 |" … … 670 673 (_url_amazon-pattern 671 674 "\\(http://.*amazon[.]c.*\\)/\\([0-9A-Z-][0-9A-Z-][0-9A-Z-][0-9A-Z-][0-9A-Z-][0-9A-Z-][0-9A-Z-][0-9A-Z-][0-9A-Z-][0-9A-Z-]\\)[^0-9A-Z-]?\\(.*\\)") 675 (_url_amazon-pattern-part 676 "/dp/\\([0-9A-Z-][0-9A-Z-][0-9A-Z-][0-9A-Z-][0-9A-Z-][0-9A-Z-][0-9A-Z-][0-9A-Z-][0-9A-Z-][0-9A-Z-]\\)") 672 677 (_url_youtube-pattern 673 678 "\\(http://.*youtube[.]com/watch\\?v=\\)\\([0-9A-Za-z_-]+\\)\\(.*\\)")) … … 734 739 (e (match-end 3)) 735 740 (title (oldtype-fetch-html-title url))) 741 (when (string-match _url_amazon-pattern-part str) 742 (setq asin (match-string 1 str))) 736 743 (delete-region s e) 737 744 (goto-char s) -
lang/gauche/oldtype/branches/stable/Kahua/oldtype/oldtype/oldtype.kahua
r21138 r22071 438 438 (item/ 439 439 (title/ (string-append (name-of e) "::" (oldtype-first-line e))) 440 (description/ (string-join (get-plain-list e) "\n")) 440 (description/ 441 (string-append 442 "<pre>" 443 (string-join (get-rich-list e) "\n") 444 "</pre>")) 441 445 (link/ uri) 442 446 (guid/ uri) -
lang/gauche/oldtype/branches/stable/Kahua/oldtype/oldtype/page.scm
r21138 r22071 59 59 get-text-list 60 60 get-plain-list 61 get-rich-list 61 62 get-rss-entry-pages 62 63 )) … … 78 79 ;; vector of text in page 79 80 (plain :accessor plain-of :init-keyword :plain 81 :init-value '()) 82 ;; vector of rich text in page 83 (rich :accessor rich-of :init-keyword :rich 80 84 :init-value '()) 81 85 )) … … 98 102 (list->vector 99 103 (string-split 100 (oldtype:sxml->plain-text (sxml-of self)) 104 (oldtype:sxml->plain-text (sxml-of self) #f) 105 #\newline))) 106 (set! (rich-of self) 107 (list->vector 108 (string-split 109 (oldtype:sxml->plain-text (sxml-of self) #t) 101 110 #\newline))) 102 111 self) … … 108 117 (sxml . ,(sxml-of self)) 109 118 (timeline . ,(serialize (timeline-of self))) 110 (plain . ,(vector->list (plain-of self))))) 119 (plain . ,(vector->list (plain-of self))) 120 (rich . ,(vector->list (rich-of self))))) 111 121 112 122 … … 116 126 :sxml (assq-ref internal-data 'sxml) 117 127 :timeline (deserialize (make <oldtype-timeline>) (assq-ref internal-data 'timeline)) 118 :plain (list->vector (assq-ref internal-data 'plain)))) 128 :plain (list->vector (assq-ref internal-data 'plain)) 129 :rich (list->vector (assq-ref internal-data 'rich)))) 119 130 120 131 … … 148 159 (define-method get-plain-list ((self <oldtype-page>)) 149 160 (vector->list (plain-of self))) 161 162 (define-method get-rich-list ((self <oldtype-page>)) 163 (vector->list (rich-of self))) 150 164 151 165 -
lang/gauche/oldtype/branches/stable/Kahua/oldtype/oldtype/util.kahua
r21138 r22071 252 252 (if (< 0 len) 253 253 (let1 _videoid (car arg) 254 (a/ (@/ (href ( format "http://www.youtube.com/v/~a"_videoid)))254 (a/ (@/ (href (oldtype:youtube-link _videoid))) 255 255 (img/ 256 (@/ (src ( format "http://img.youtube.com/vi/~a/1.jpg"_videoid))256 (@/ (src (oldtype:youtube-thumbnail _videoid)) 257 257 (alt _videoid) 258 258 (class "help") … … 289 289 (if (#/^[0-9a-zA-Z]+$/ _asin) 290 290 (a/ 291 (@/ (href ( format #f "http://amazon.co.jp/o/ASIN/~a/kiye-22/ref=nosim"_asin)))291 (@/ (href (oldtype:amazon-link _asin))) 292 292 (img/ 293 (@/ (src ( format #f "http://images.amazon.com/images/P/~a.09.MZZZZZZZ_.jpg"_asin))293 (@/ (src (oldtype:amazon-thumbnail _asin)) 294 294 (alt _asin) 295 295 (class "help") -
lang/gauche/oldtype/branches/stable/Kahua/oldtype/oldtype/util.scm
r21138 r22071 57 57 oldtype:grouping-blog-entries 58 58 oldtype:thumbnail-filter 59 oldtype:amazon-link 60 oldtype:amazon-thumbnail 61 oldtype:youtube-link 62 oldtype:youtube-thumbnail 59 63 pretty-print-sexp)) 60 64 (select-module oldtype.util) … … 342 346 343 347 348 (define (oldtype:amazon-link asin-code) 349 (format #f "http://amazon.co.jp/o/ASIN/~a/kiye-22/ref=nosim" asin-code)) 350 351 (define (oldtype:amazon-thumbnail asin-code) 352 (format #f "http://images.amazon.com/images/P/~a.09.MZZZZZZZ_.jpg" asin-code)) 353 354 (define (oldtype:youtube-link video-id) 355 (format #f "http://www.youtube.com/v/~a" video-id)) 356 357 (define (oldtype:youtube-thumbnail video-id) 358 (format #f "http://img.youtube.com/vi/~a/1.jpg" video-id)) 359 360 344 361 (provide "oldtype/util") -
lang/gauche/oldtype/branches/stable/Kahua/oldtype/oldtype/version.kahua
r21138 r22071 7 7 8 8 ;;--------------------------------------------------------- 9 (define *oldtype-version* "0.3. 5")9 (define *oldtype-version* "0.3.6") -
lang/gauche/oldtype/branches/stable/Makefile
r21138 r22071 9 9 cat ./config.sh | sed 's/OT_MASTER=nil/OT_MASTER=t/' | sed 's/site-unstable/site-stable/' | sed 's/newtype/oldtype/' > ../branches/stable/config.sh 10 10 cat ./Kahua/oldtype/Makefile | sed 's/site-unstable/site-stable/' > ../branches/stable/Kahua/oldtype/Makefile 11 12 merge: 13 bash -c "cd .. ; svn merge tags/0.3.5@ trunk@ branches/stable" 14 cat ./config.sh | sed 's/OT_MASTER=nil/OT_MASTER=t/' | sed 's/site-unstable/site-stable/' | sed 's/newtype/oldtype/' > ../branches/stable/config.sh 15 cat ./Kahua/oldtype/Makefile | sed 's/site-unstable/site-stable/' > ../branches/stable/Kahua/oldtype/Makefile -
lang/gauche/oldtype/branches/stable/src
- Property svn:ignore
-
old new 17 17 Sample2.txt 18 18 Test.no-timeline.sexp 19 Sample1.rich.txt 20 Sample2.rich.txt
-
- Property svn:ignore
-
lang/gauche/oldtype/branches/stable/src/Makefile
r21138 r22071 12 12 gosh -I ../Kahua/oldtype ./oldtype_to plain ../edit/Sample1.ot > Sample1.txt 13 13 gosh -I ../Kahua/oldtype ./oldtype_to plain ../edit/Sample2.ot > Sample2.txt 14 gosh -I ../Kahua/oldtype ./oldtype_to rich ../edit/Sample1.ot > Sample1.rich.txt 15 gosh -I ../Kahua/oldtype ./oldtype_to rich ../edit/Sample2.ot > Sample2.rich.txt 14 16 15 17 test: log.txt Test.ann.txt -
lang/gauche/oldtype/branches/stable/src/Test.no-timeline.sexp.master
r21138 r22071 26 26 (text) 27 27 (distribution)) 28 (plain "* UnitTest用のサンプルファイル" "----" "*** start" "*** Entry1" "*** Entry2" "*** end" "")) 28 (plain "* UnitTest用のサンプルファイル" "----" "*** start" "*** Entry1" "*** Entry2" "*** end" "") 29 (rich "<h2>UnitTest用のサンプルファイル" "</h2><hr><h4>start" "</h4><h4>Entry1" "</h4><h4>Entry2" "</h4><h4>end" "</h4>")) -
lang/gauche/oldtype/branches/stable/src/Test.sexp.master
r21138 r22071 99 99 (13317 6 5 4 3) 100 100 (13304 2))) 101 (plain "* UnitTest用のサンプルファイル" "----" "*** start" "*** Entry1" "*** Entry2" "*** end" "")) 101 (plain "* UnitTest用のサンプルファイル" "----" "*** start" "*** Entry1" "*** Entry2" "*** end" "") 102 (rich "<h2>UnitTest用のサンプルファイル" "</h2><hr><h4>start" "</h4><h4>Entry1" "</h4><h4>Entry2" "</h4><h4>end" "</h4>")) -
lang/gauche/oldtype/branches/stable/src/oldtype_to
r21138 r22071 161 161 (let* ( 162 162 (sxml (oldtype-parse input-port)) 163 (sexp (oldtype:sxml->plain-text sxml))) 163 (sexp (oldtype:sxml->plain-text sxml #f))) 164 (print 165 (tree->string 166 sexp)))) 167 ('rich 168 (let* ( 169 (sxml (oldtype-parse input-port)) 170 (sexp (oldtype:sxml->plain-text sxml #t))) 164 171 (print 165 172 (tree->string -
lang/gauche/oldtype/branches/stable/src/test.scm
r21138 r22071 91 91 92 92 (test "ago string of lineno 1 <oldtype-timeline>" 93 " ( 4months ago)"93 " (7 months ago)" 94 94 (lambda () 95 95 (get-ago (log-by-lineno oldtype-timeline 1)))) 96 96 (test "ago string of lineno 1 <oldtype-page>" 97 " ( 4months ago)"97 " (7 months ago)" 98 98 (lambda () 99 99 (get-ago oldtype-page 1))) … … 119 119 (test "date,ago,rank,committer of lineno 1 <oldtype-page>" 120 120 '((date . "2008-03-20 21:36 (+0900)") 121 (ago . " ( 4months ago)")121 (ago . " (7 months ago)") 122 122 (rank . 5) 123 123 (committer . "kiyoka")) -
lang/gauche/oldtype/branches/stable/tool/tdiary2oldtype
- Property svn:ignore
-
old new 7 7 out 8 8 tdiary_data 9 t.sh
-
- Property svn:ignore
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)