Changeset 22567 for lang/gauche
- Timestamp:
- 11/02/08 17:14:43 (5 years ago)
- Location:
- lang/gauche/oldtype/trunk
- Files:
-
- 1 added
- 12 modified
-
Kahua/oldtype/oldtype/core.scm (modified) (2 diffs)
-
Kahua/oldtype/oldtype/format.scm (modified) (2 diffs)
-
Kahua/oldtype/oldtype/oldtype.kahua (modified) (4 diffs)
-
Kahua/oldtype/oldtype/page.scm (modified) (6 diffs)
-
Kahua/oldtype/oldtype/util.kahua (modified) (1 diff)
-
Kahua/oldtype/oldtype/version.kahua (modified) (1 diff)
-
bin/convert.sh (modified) (3 diffs)
-
command/blog (modified) (1 diff)
-
command/genref (added)
-
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)
Legend:
- Unmodified
- Added
- Removed
-
lang/gauche/oldtype/trunk/Kahua/oldtype/oldtype/core.scm
r13593 r22567 36 36 (export 37 37 oldtype:load-page 38 oldtype:load-command-list 38 39 )) 39 40 (select-module oldtype.core) … … 63 64 64 65 66 (define (oldtype:load-command-list _site-root) 67 (define (gen-sexp-filename1) 68 (string-append _site-root "/tmp/oldtype/_out/__commands.sexp")) 69 (define (gen-sexp-filename2) 70 (string-append "./__commands.sexp")) 71 (let1 filename (cond 72 ((file-exists? (gen-sexp-filename1)) 73 (gen-sexp-filename1)) 74 ((file-exists? (gen-sexp-filename2)) 75 (gen-sexp-filename2)) 76 (else 77 #f)) 78 (if filename 79 (with-input-from-file filename 80 (lambda () 81 (apply 82 append 83 (read (current-input-port))))) 84 #f))) 85 86 65 87 (provide "oldtype/core") -
lang/gauche/oldtype/trunk/Kahua/oldtype/oldtype/format.scm
r22411 r22567 150 150 ;; SXML to wiki-command list in the page. 151 151 ;; 152 (define (oldtype:sxml->command-list sxmls) 152 ;; data format is : 153 ;; '( 154 ;; ("string") ;; means [[string]] wiki name 155 ;; (reference "B" "A") ;; means `page A has reference to page B.' ( A->B ) 156 ;; (command arg1 arg2...) ;; means ##(command arg1 arg2...) 157 ;; . 158 ;; . 159 ;; ) 160 ;; 161 (define (oldtype:sxml->command-list sxmls wikiname) 153 162 (let1 commands '() 154 163 (let rec … … 172 181 (push! commands arg)) 173 182 ((wiki-name) 183 (if (string? (car arg)) 184 (if (not (#/[|]/ (car arg))) 185 (push! commands (list 'reference (car arg) wikiname)))) 174 186 (push! commands arg)) 175 187 (else -
lang/gauche/oldtype/trunk/Kahua/oldtype/oldtype/oldtype.kahua
r22008 r22567 113 113 (get-text-list oldtype-page))))) 114 114 "" 115 '() ;; command-list 115 116 lineno 116 117 )))) … … 275 276 276 277 277 (define (standard-page wikiname barcode nodes first-line . rest-arg)278 (define (standard-page wikiname barcode nodes first-line command-list . rest-arg) 278 279 (html/ (head/ (title/ (string-append wikiname " / " first-line)) 279 280 (link/ (@/ (rel "stylesheet") (type "text/css") … … 334 335 (oldtype:icon-image 'plain)) 335 336 (oldtype:hatena-bookmarks wikiname)) 337 (text/ "Related pages:")(oldtype:reference-pages/ wikiname command-list) 338 (br/) 336 339 barcode 337 340 (hr/) … … 357 360 358 361 (define (show-page/page wikiname) 359 (let1 oldtype-page (oldtype:load-page (kahua-site-root) wikiname) 360 (standard-page 361 wikiname 362 (if oldtype-page 363 (oldtype-page->barcode oldtype-page) 364 (br/)) 365 (if oldtype-page 366 (oldtype-page->higher-order-tag oldtype-page) 367 (div/ 368 (p/ 369 (@/ (class "center")) 370 (strong/ 371 (@/ (class "caption")) 372 "This wikipage was not found.")))) 373 (if oldtype-page 374 (oldtype-first-line oldtype-page) 375 "")))) 362 (let ((oldtype-page (oldtype:load-page (kahua-site-root) wikiname)) 363 (command-list (oldtype:load-command-list (kahua-site-root)))) 364 (standard-page 365 wikiname 366 (if oldtype-page 367 (oldtype-page->barcode oldtype-page) 368 (br/)) 369 (if oldtype-page 370 (oldtype-page->higher-order-tag oldtype-page) 371 (div/ 372 (p/ 373 (@/ (class "center")) 374 (strong/ 375 (@/ (class "caption")) 376 "This wikipage was not found.")))) 377 (if oldtype-page 378 (oldtype-first-line oldtype-page) 379 "") 380 command-list))) 376 381 377 382 -
lang/gauche/oldtype/trunk/Kahua/oldtype/oldtype/page.scm
r22008 r22567 60 60 get-plain-list 61 61 get-rich-list 62 get-command-list 62 63 get-rss-entry-pages 63 64 )) … … 82 83 ;; vector of rich text in page 83 84 (rich :accessor rich-of :init-keyword :rich 85 :init-value '()) 86 ;; list of commands in page 87 (commands :accessor commands-of :init-keyword :commands 84 88 :init-value '()) 85 89 )) … … 109 113 (oldtype:sxml->plain-text (sxml-of self) #t) 110 114 #\newline))) 115 (set! (commands-of self) 116 (oldtype:sxml->command-list (sxml-of self) (name-of self))) 111 117 self) 112 118 … … 118 124 (timeline . ,(serialize (timeline-of self))) 119 125 (plain . ,(vector->list (plain-of self))) 120 (rich . ,(vector->list (rich-of self))))) 126 (rich . ,(vector->list (rich-of self))) 127 (commands . ,(commands-of self)))) 121 128 122 129 … … 127 134 :timeline (deserialize (make <oldtype-timeline>) (assq-ref internal-data 'timeline)) 128 135 :plain (list->vector (assq-ref internal-data 'plain)) 129 :rich (list->vector (assq-ref internal-data 'rich)))) 136 :rich (list->vector (assq-ref internal-data 'rich)) 137 :commands (assq-ref internal-data 'commands))) 130 138 131 139 … … 162 170 (define-method get-rich-list ((self <oldtype-page>)) 163 171 (vector->list (rich-of self))) 172 173 (define-method get-command-list ((self <oldtype-page>)) 174 (commands-of self)) 164 175 165 176 -
lang/gauche/oldtype/trunk/Kahua/oldtype/oldtype/util.kahua
r22008 r22567 471 471 (img/ (@/ (src "http://d.hatena.ne.jp/images/b_entry_de.gif")))) 472 472 (img/ (@/ (src (string-append "http://b.hatena.ne.jp/entry/image/http://" (oldtype:get-arguments 'fqdn) path))))))) 473 474 475 (define (oldtype:reference-pages/ wikiname command-list) 476 (let1 ret 477 (map/ 478 (lambda (name) 479 (node-set/ 480 (text/ " ") 481 (a/ (@/ (href name)) 482 name))) 483 (reverse 484 (sort 485 (delete-duplicates 486 (filter-map 487 (lambda (x) 488 (if (eq? 'reference (car x)) 489 (let ((from (caddr x)) 490 (to (cadr x))) 491 (if (and (string=? wikiname to) 492 (not (string=? from wikiname)) 493 (not (string=? from "!RecentChanges")) 494 (not (string=? from "!AllPages"))) 495 from 496 #f)) 497 #f)) 498 command-list))))) 499 (if (null? ret) 500 (text/ "") 501 ret))) 502 503 504 505 -
lang/gauche/oldtype/trunk/Kahua/oldtype/oldtype/version.kahua
r21624 r22567 7 7 8 8 ;;--------------------------------------------------------- 9 (define *oldtype-version* "0.3. 6")9 (define *oldtype-version* "0.3.7") -
lang/gauche/oldtype/trunk/bin/convert.sh
r16043 r22567 6 6 7 7 _oldtype_to() { 8 t=$1 9 src=$2 10 dst=$3 11 log=$4 12 ann=$5 13 ${OT_HOME}/src/oldtype_to ${t} ${src} ${log} ${ann} > ../_out/${base}.sexp.tmp 8 src=$1 9 log=$2 10 ann=$3 11 ${OT_HOME}/src/oldtype_to internal ${src} ${log} ${ann} > ../_out/${base}.sexp.tmp 12 ${OT_HOME}/src/oldtype_to commands ${src} ${log} ${ann} > ../_out/${base}.commands 14 13 15 14 if [ "$?" = "0" ] ; then … … 42 41 base=`basename ${f} .ot` 43 42 echo "[" ${base} "]" 44 _oldtype_to internal "${base}.ot" ../_out/${base}.sexp43 _oldtype_to "${base}.ot" 45 44 done 46 45 … … 74 73 logger "OldType: ${msg}" 75 74 fi 76 _oldtype_to internal "${base}.ot" ../_out/${base}.sexp../_tmp/tmp.log ../_tmp/tmp.ann75 _oldtype_to "${base}.ot" ../_tmp/tmp.log ../_tmp/tmp.ann 77 76 fi 78 77 done 79 78 79 # create _commands.sexp 80 echo "(" > ../_out/__commands.sexp 81 cat ../_out/*.commands >> ../_out/__commands.sexp 82 echo ")" >> ../_out/__commands.sexp 83 80 84 popd -
lang/gauche/oldtype/trunk/command/blog
r21133 r22567 1 1 #!/usr/local/bin/gosh 2 ;;; 3 ;;; blog - generating blog aggregate page. 4 ;;; 5 ;;; Copyright (c) 2008 Kiyoka Nishiyama, All rights reserved. 6 ;;; 7 ;;; Permission is hereby granted, free of charge, to any person 8 ;;; obtaining a copy of this software and associated documentation 9 ;;; files (the "Software"), to deal in the Software without restriction, 10 ;;; including without limitation the rights to use, copy, modify, 11 ;;; merge, publish, distribute, sublicense, and/or sell copies of 12 ;;; the Software, and to permit persons to whom the Software is 13 ;;; furnished to do so, subject to the following conditions: 14 ;;; 15 ;;; The above copyright notice and this permission notice shall be 16 ;;; included in all copies or substantial portions of the Software. 17 ;;; 18 ;;; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 19 ;;; EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 20 ;;; OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 21 ;;; NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 22 ;;; BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN 23 ;;; AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF 24 ;;; OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 25 ;;; IN THE SOFTWARE. 2 26 3 27 (use srfi-1) -
lang/gauche/oldtype/trunk/src/Makefile
r22411 r22567 32 32 svn ann ../edit/Entry2.ot > Entry2.ann.txt 33 33 34 reftest: 35 gosh -I ../Kahua/oldtype ../command/genref /Users/kiyoka/work/site-unstable 34 36 35 37 svninfo: -
lang/gauche/oldtype/trunk/src/Test.no-timeline.sexp.master
r22008 r22567 27 27 (distribution)) 28 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>")) 29 (rich "<h2>UnitTest用のサンプルファイル" "</h2><hr><h4>start" "</h4><h4>Entry1" "</h4><h4>Entry2" "</h4><h4>end" "</h4>") 30 (commands 31 (reference "Entry1" "Test") 32 ("Entry1") 33 (reference "Entry2" "Test") 34 ("Entry2"))) -
lang/gauche/oldtype/trunk/src/Test.sexp.master
r22008 r22567 100 100 (13304 2))) 101 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>")) 102 (rich "<h2>UnitTest用のサンプルファイル" "</h2><hr><h4>start" "</h4><h4>Entry1" "</h4><h4>Entry2" "</h4><h4>end" "</h4>") 103 (commands 104 (reference "Entry1" "Test") 105 ("Entry1") 106 (reference "Entry2" "Test") 107 ("Entry2"))) -
lang/gauche/oldtype/trunk/src/oldtype_to
r22411 r22567 175 175 (let* ( 176 176 (sxml (oldtype-parse input-port)) 177 (sexp (oldtype:sxml->command-list sxml )))177 (sexp (oldtype:sxml->command-list sxml wikiname))) 178 178 (pretty-print-sexp sexp))) 179 179 (else
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)