Changeset 15941 for lang/gauche
- Timestamp:
- 07/17/08 21:12:06 (4 months ago)
- Location:
- lang/gauche/oldtype/branches/stable
- Files:
-
- 2 added
- 17 modified
-
Kahua/oldtype/Makefile (modified) (1 diff)
-
Kahua/oldtype/oldtype/format.scm (modified) (1 diff)
-
Kahua/oldtype/oldtype/oldtype.css (modified) (1 diff)
-
Kahua/oldtype/oldtype/oldtype.kahua (modified) (2 diffs)
-
Kahua/oldtype/oldtype/page.scm (modified) (1 diff)
-
Kahua/oldtype/oldtype/svn.scm (added)
-
Kahua/oldtype/oldtype/timeline.scm (modified) (1 diff)
-
Kahua/oldtype/oldtype/util.kahua (modified) (2 diffs)
-
Kahua/oldtype/oldtype/util.scm (modified) (2 diffs)
-
Kahua/oldtype/oldtype/version.kahua (modified) (1 diff)
-
Kahua/oldtype/plugins/oldtype.scm (modified) (1 diff)
-
Makefile (modified) (1 diff)
-
bin/batch.sh (modified) (1 diff)
-
bin/convert.sh (modified) (1 diff)
-
command/blog (modified) (3 diffs)
-
src/Makefile (modified) (1 diff)
-
src/Test.no-timeline.sexp.master (added)
-
src/oldtype_to (modified) (1 diff)
-
src/test.scm (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lang/gauche/oldtype/branches/stable/Kahua/oldtype/Makefile
r13637 r15941 36 36 37 37 TEST_DIR = $(PWD) 38 SCRIPTFILES = $(package)/$(package).kahua $(package)/version.kahua $(package)/util.kahua $(package)/format.scm $(package)/core.scm $(package)/parse.scm $(package)/util.scm $(package)/pasttime.scm $(package)/page.scm $(package)/timeline.scm $(package)/log.scm 38 SCRIPTFILES = \ 39 $(package)/$(package).kahua $(package)/version.kahua $(package)/util.kahua $(package)/format.scm $(package)/core.scm \ 40 $(package)/parse.scm $(package)/util.scm $(package)/pasttime.scm $(package)/page.scm $(package)/timeline.scm \ 41 $(package)/log.scm $(package)/svn.scm 39 42 STATICFILES = $(package)/$(package).css $(package)/staticimg/*.png $(package)/*.el $(package)/import/*.js $(package)/import/*.css $(package)/$(package).js 40 43 -
lang/gauche/oldtype/branches/stable/Kahua/oldtype/oldtype/format.scm
r14312 r15941 109 109 ;; download link oldtype-mode.el source code 110 110 ((download-el) "[Download oldtype-mode.el now]") 111 ;; comment-data 112 ((comment-data) 113 (if (< 1 len) 114 (string-append (format "----< ~a >----" (uri-decode-string (car arg))) 115 "\n" 116 (uri-decode-string (cadr arg))) 117 (format "!!Error : comment-data format error for ##(comment-data user string) command"))) 118 ;; else 111 119 (else 112 (format " !!Error : no such macro \"~a\"!!" command)))))120 (format "[~a]" command))))) 113 121 114 122 -
lang/gauche/oldtype/branches/stable/Kahua/oldtype/oldtype/oldtype.css
r14934 r15941 681 681 color: white; 682 682 } 683 684 pre.comment { 685 margin-left: 0.5em; 686 font-size: medium; 687 padding-left: 0.5em; 688 margin-top: 1px; 689 margin-bottom: 1px; 690 } 691 692 table.comment { 693 width: 70%; 694 text-align: left; 695 } -
lang/gauche/oldtype/branches/stable/Kahua/oldtype/oldtype/oldtype.kahua
r14934 r15941 14 14 (use oldtype.timeline) 15 15 (use oldtype.page) 16 (use oldtype.svn) 16 17 (use srfi-1) 17 18 (use srfi-19) 19 (use srfi-27) 18 20 (load "oldtype/version.kahua") 19 21 (load "oldtype/util.kahua") … … 259 261 ((h5) `(,@(h5/ (@/ (id "h5")) (node-set (rec arg))))) 260 262 ((h6) `(,@(h6/ (@/ (id "h6")) (node-set (rec arg)))))))) 261 ((wiki-macro) `(,@(oldtype:format-macro arg )))263 ((wiki-macro) `(,@(oldtype:format-macro arg oldtype-page))) 262 264 ((wiki-name) `(,@(oldtype:expand-wiki-name (car arg)))) 263 265 ((hr) (hr/)) -
lang/gauche/oldtype/branches/stable/Kahua/oldtype/oldtype/page.scm
r14370 r15941 82 82 83 83 84 ;; Parsing wiki format 85 ;; 86 ;; In case of log-file or ann-file is #f, this function takes only parse action. 87 ;; 84 88 (define-method parse ((self <oldtype-page>) wiki-port log-file ann-file) 85 89 (let1 timeline (make <oldtype-timeline> :name (name-of self)) 86 90 (set! (timeline-of self) 87 (parse timeline log-file ann-file))) 91 (if (and log-file ann-file) 92 (parse timeline log-file ann-file) 93 timeline))) 88 94 (set! (sxml-of self) 89 95 (oldtype:sxml->internal -
lang/gauche/oldtype/branches/stable/Kahua/oldtype/oldtype/timeline.scm
r13637 r15941 70 70 ;; vector of <oldtype-log> in page 71 71 (annotation :accessor annotation-of :init-keyword :annotation 72 :init-value ' ())72 :init-value '#()) 73 73 ;; vector of text in page 74 74 (text :accessor text-of :init-keyword :text 75 :init-value ' ())75 :init-value '#()) 76 76 ;; distribution of revision 77 77 (distribution :accessor distribution-of :init-keyword :distribution -
lang/gauche/oldtype/branches/stable/Kahua/oldtype/oldtype/util.kahua
r15392 r15941 230 230 (img/ (@/ (src (string-append (oldtype:static-image-path) "icon.article_text.png")) 231 231 (alt "PLAIN")))) 232 ((comment) 233 (img/ (@/ (src (string-append (oldtype:static-image-path) "icon.comment_blue.png")) 234 (alt "COMMENT")))) 235 ((double-comment) 236 (img/ (@/ (src (string-append (oldtype:static-image-path) "icon.double_comment.png")) 237 (alt "DCOMMENT")))) 238 ((alert) 239 (img/ (@/ (src (string-append (oldtype:static-image-path) "icon.stop_round.png")) 240 (alt "ALERT")))) 232 241 (else 233 242 `(p/ ,(format "!!Error : no such icon-image \"~a\"!!" sym))))) 234 235 236 (define (oldtype:format-macro expr) 243 244 245 (define (oldtype:add-comment oldtype-page name comment) 246 (apply append 247 (map 248 (lambda (str) 249 (if (#/##\(comment\)/ str) 250 `( 251 ,(format "##(comment-data ~a ~a)" 252 (uri-encode-string name) 253 (uri-encode-string comment)) 254 ,str) 255 `(,str))) 256 (get-text-list oldtype-page)))) 257 258 259 (define (oldtype:format-macro expr oldtype-page) 237 260 (let ((command (car expr)) 238 261 (arg ;; symbol list to string list. … … 337 360 ;; input comment 338 361 ((comment) 339 (form/ (@/ (action ".")) 340 (table/ 341 (tr/ (th/ "Post a comment")) 342 (tr/ (td/ 343 "Name:" 344 (input/ 345 (@/ (type "text") (value "") (size 20))))) 346 (tr/ (td/ 347 (textarea/ 348 (@/ (cols 120) (rows 3))))) 349 (tr/ (td/ 350 (input/ (@/ (type "submit") (value "Submit comment")))))))) 362 (form/cont/ 363 (@@/ (cont 364 (entry-lambda (:keyword name comment) 365 (let1 nodes 366 (p/ 367 (oldtype:icon-image 'alert) 368 "Error: commit action missed.") 369 (if (or (> 1 (string-length name)) 370 (> 1 (string-length comment))) 371 (set! nodes (p/ 372 (oldtype:icon-image 'alert) 373 "Please input name and comment.")) 374 (let1 work (make <svn-work> 375 :url (oldtype:get-arguments 'svn) 376 :user (oldtype:get-arguments 'anon-user) 377 :pass (oldtype:get-arguments 'anon-pass) 378 :basepath (oldtype:workpath)) 379 (init work (string-append 380 (number->string (sys-time)) 381 "." 382 (number->string (random-integer 100)))) 383 (save-text-list work (name-of oldtype-page) 384 (oldtype:add-comment oldtype-page name comment)) 385 (let1 result (status work (name-of oldtype-page)) 386 (when (string=? "M" (car result)) 387 (begin 388 (commit work) 389 (set! nodes 390 (p/ 391 (oldtype:icon-image 'info) 392 "Thank you! Your comment was registered."))))))) 393 (standard-page 394 (name-of oldtype-page) 395 (br/) 396 (div/ 397 nodes 398 (p/ "Back to " (oldtype:expand-wiki-name (name-of oldtype-page)))) 399 "" 400 1))))) 401 (table/ (@/ (class "comment")) 402 (tr/ (th/ 403 (oldtype:icon-image 'double-comment) 404 "Post a comment")) 405 (tr/ (td/ 406 "Name:" 407 (input/ 408 (@/ (type "text") (name "name") (value "") (size 20))))) 409 (tr/ (td/ 410 (textarea/ 411 (@/ (cols 120) (rows 3) (name "comment"))))) 412 (tr/ (td/ 413 (input/ (@/ (type "submit") (value "Submit comment")))))))) 414 415 ;; display comment 416 ((comment-data) 417 (if (> 2 len) 418 (p/ "!!Error : No argument ##(comment-data user str) command") 419 (table/ (@/ (class "comment")) 420 (tr/ (th/ 421 (oldtype:icon-image 'comment) 422 (uri-decode-string (car arg)))) 423 (tr/ (td/ 424 (pre/ (@/ (class "comment")) 425 (uri-decode-string (cadr arg)))))))) 351 426 352 427 ;; no listing to !RecentChanges -
lang/gauche/oldtype/branches/stable/Kahua/oldtype/oldtype/util.scm
r14370 r15941 44 44 oldtype:get-string-of-today 45 45 oldtype:editpath 46 oldtype:workpath 46 47 oldtype:user-local 47 48 oldtype:user-backend … … 84 85 (sys-getenv "OT_SITE") 85 86 "/tmp/oldtype/edit")) 87 88 (define (oldtype:workpath) 89 (string-append 90 (sys-getenv "OT_SITE") 91 "/tmp/work")) 86 92 87 93 (define (oldtype:user-local) -
lang/gauche/oldtype/branches/stable/Kahua/oldtype/oldtype/version.kahua
r15392 r15941 7 7 8 8 ;;--------------------------------------------------------- 9 (define *oldtype-version* "0.3. 0")9 (define *oldtype-version* "0.3.1") -
lang/gauche/oldtype/branches/stable/Kahua/oldtype/plugins/oldtype.scm
r13637 r15941 18 18 (allow-module oldtype.timeline) 19 19 (allow-module oldtype.page) 20 (allow-module oldtype.svn) 20 21 (allow-module rfc.uri) -
lang/gauche/oldtype/branches/stable/Makefile
r8263 r15941 7 7 tar xfC ../stable.tar ../branches/stable 8 8 /bin/rm -f ../stable.tar 9 cat ./config.sh | sed 's/OT_MASTER=nil/OT_MASTER=t/' | sed 's/site-unstable/site-stable/' > ../branches/stable/config.sh9 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 -
lang/gauche/oldtype/branches/stable/bin/batch.sh
r15392 r15941 38 38 #run-parts ${OT_HOME}/hook 39 39 echo -n [info] sleep... 40 sleep 540 sleep 1 41 41 echo wakeup 42 42 } -
lang/gauche/oldtype/branches/stable/bin/convert.sh
r15392 r15941 49 49 echo ${base} | grep "!" > /dev/null 50 50 generated=$? 51 if [ "0" = $generated] ; then51 if [ "0" = "$generated" ] ; then 52 52 diffs=`_svn t diff ${base}.ot | wc -l | awk '{ print $1; }'` 53 53 # echo diffs : ${diffs} 54 54 [ "0" != "${diffs}" -o ! -f ../_out/${base}.sexp ] 55 55 status=$? 56 57 ## TODO: fix me ( Must implement !xxxxx.ot contents converttion check ) 58 status=0 59 56 60 # echo status : ${status} 57 61 else -
lang/gauche/oldtype/branches/stable/command/blog
r15392 r15941 2 2 3 3 (use srfi-1) 4 (use util.list) 4 5 (use oldtype.util) 5 6 … … 36 37 (display 37 38 (string-append "* [[" (oldtype:otpath->wikiname filename) "]]")))) 38 (for-each print (port->string-list (current-input-port)))))) 39 (for-each 40 (lambda (line) 41 (if (#/##\(comment\)/ line) 42 (print (string-append "comment please => [[" (oldtype:otpath->wikiname filename) "]]")) 43 (print line))) 44 (port->string-list (current-input-port)))))) 39 45 entrylist) 40 46 (display appendix) … … 60 66 (cons 61 67 ot-blog-header 62 (take (ot-blog-entrylist) ot-new-entry-limit))68 (take* (ot-blog-entrylist) ot-new-entry-limit)) 63 69 "") 64 70 (output-blog-list (string-append ot-blog ".list.ot") -
lang/gauche/oldtype/branches/stable/src/Makefile
r14312 r15941 5 5 all: log.txt Test.ann.txt Entry1.ann.txt Entry2.ann.txt 6 6 gosh -I ../Kahua/oldtype ./oldtype_to internal ../edit/Test.ot log.txt Test.ann.txt > Test.sexp 7 gosh -I ../Kahua/oldtype ./oldtype_to internal ../edit/Test.ot > Test.no-timeline.sexp 7 8 gosh -I ../Kahua/oldtype ./oldtype_to internal ../edit/Entry1.ot log.txt Entry1.ann.txt > Entry1.sexp 8 9 gosh -I ../Kahua/oldtype ./oldtype_to internal ../edit/Entry2.ot log.txt Entry2.ann.txt > Entry2.sexp -
lang/gauche/oldtype/branches/stable/src/oldtype_to
r14312 r15941 145 145 (case type 146 146 ('internal 147 (when (< 1 (length rest)) 148 (let1 oldtype-page (parse (make <oldtype-page> :name wikiname) input-port (car rest) (cadr rest)) 149 (pretty-print-sexp (serialize oldtype-page))))) 147 (if (< 1 (length rest)) 148 (let1 oldtype-page (parse (make <oldtype-page> :name wikiname) input-port (car rest) (cadr rest)) 149 (pretty-print-sexp (serialize oldtype-page))) 150 (let1 oldtype-page (parse (make <oldtype-page> :name wikiname) input-port #f #f) 151 (pretty-print-sexp (serialize oldtype-page))))) 150 152 ('sxml 151 153 (let1 sxml (oldtype-parse input-port) -
lang/gauche/oldtype/branches/stable/src/test.scm
r14312 r15941 13 13 (use oldtype.page) 14 14 (use oldtype.core) 15 (use oldtype.svn) 15 16 (use gauche.test) 16 17 (use util.list) … … 35 36 (open-input-string converted-str))) 36 37 (let ((oldtype-page #f) 38 (oldtype-page-no-timeline #f) 37 39 (oldtype-timeline #f) 38 (loaded (with-input-from-file "Test.sexp.master" 39 (lambda () 40 (read))))) 41 40 (loaded 41 (with-input-from-file "Test.sexp.master" 42 (lambda () 43 (read)))) 44 (loaded-no-timeline 45 (with-input-from-file "Test.no-timeline.sexp.master" 46 (lambda () 47 (read))))) 42 48 (test-start "serialize,deserialize") 43 49 … … 53 59 54 60 (test-section "oldtype-page") 55 (set! oldtype-page (parse (make <oldtype-page> :name "Test") input-port log-file ann-file)) 61 (set! oldtype-page 62 (parse (make <oldtype-page> :name "Test") input-port log-file ann-file)) 63 (port-seek input-port 0) 64 (set! oldtype-page-no-timeline 65 (parse (make <oldtype-page> :name "Test") input-port #f #f)) 66 56 67 (let1 serialized (serialize oldtype-page) 57 (test "serialized == DATA "68 (test "serialized == DATA (1) " 58 69 loaded 59 70 (lambda () (serialize oldtype-page))) 60 71 61 72 (test "serialized == deserialized" serialized (lambda () 62 73 (serialize 63 74 (deserialize 64 75 (make <oldtype-page>) 65 serialized))))) 76 serialized)))) 77 (test "serialized == DATA (2) " 78 loaded-no-timeline 79 (lambda () (serialize oldtype-page-no-timeline)))) 66 80 (test-end) 67 81 … … 168 182 (test-end) 169 183 184 (test-start "svn commit") 185 186 (let1 work 187 (make <svn-work> :url "http://genkan.sumibi.org/svn/newtype" :user "anonymous" :pass "anonymous" :basepath "/Users/kiyoka/work/tmp") 188 189 (test "Initialize svn work directory" 190 #t 191 (lambda () 192 (string? (init work (number->string (sys-time)))))) 193 194 (test "status of wikiname (no changes)" 195 '("" "") 196 (lambda () 197 (status work "_kiyoka"))) 198 199 (test "status of wikiname (some changes)" 200 "M" 201 (lambda () 202 (save-text-list work 203 "test" 204 '("UnitTest用ページ。" "----" "##(comment)")) 205 (car (status work "test")))) 206 207 (when 208 #t 209 (test "commit from work" 210 #t 211 (lambda () 212 (commit work))))) 213 214 (test-end) 215 170 216 )))
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)