- Timestamp:
- 10/24/08 07:06:05 (5 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
lang/gauche/oldtype/trunk/Kahua/oldtype/oldtype/format.scm
r20419 r22008 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 ((@@) '())
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)