--- gforth/wf.fs 2008/10/12 13:15:23 1.59 +++ gforth/wf.fs 2010/12/31 18:09:02 1.62 @@ -1,6 +1,6 @@ \ wiki forth -\ Copyright (C) 2003,2004,2005,2006,2007,2008 Free Software Foundation, Inc. +\ Copyright (C) 2003,2004,2005,2006,2007,2008,2010 Free Software Foundation, Inc. \ This file is part of Gforth. @@ -270,8 +270,12 @@ Defer parse-line s" ]" link-suffix $+! link-suffix $@ alt= ; +: replace.- ( addr u -- ) + bounds ?DO I c@ '. = IF '- I c! THEN LOOP ; + : get-icon ( addr u -- ) iconpath @ IF 2drop EXIT THEN - link-suffix $! s" .*" link-suffix $+! + link-suffix $! link-suffix $@ replace.- + s" .*" link-suffix $+! icon-prefix $@ open-dir IF drop EXIT THEN >r BEGIN pad $100 r@ read-dir throw WHILE @@ -550,11 +554,8 @@ true Value toc-image indentlevel @ over indentlevel ! 2dup < IF swap DO -env LOOP EXIT THEN - 2dup > IF DO s" div" >env LOOP EXIT THEN - 2dup = IF drop IF -env s" div" >env THEN THEN -; -: +indent ( -- ) - indentlevel @ IF -env indent= s" div" >env THEN + 2dup > IF DO indent= s" div" >env LOOP EXIT THEN + 2dup = IF drop IF -env indent= s" div" >env THEN THEN ; wordlist constant longtags @@ -564,9 +565,9 @@ Variable divs longtags set-current : --- 0 indent cr s" hr" tag/ cr ; -: * 1 indent +indent s" h1" dclass= s" h1" par s" " dclass= ; -: ** 1 indent +indent s" h2" dclass= s" h2" par s" " dclass= ; -: *** 2 indent +indent s" h3" dclass= s" h3" par s" " dclass= ; +: * 1 indent s" h1" dclass= s" h1" par s" " dclass= ; +: ** 1 indent s" h2" dclass= s" h2" par s" " dclass= ; +: *** 2 indent s" h3" dclass= s" h3" par s" " dclass= ; : -- 0 indent cr print-toc ; : && 0 parse id= ; : - s" ul" env s" li" par ; @@ -731,7 +732,7 @@ Variable orig-date s" Mail|@/mail.gif" .img mail $@ mailto: mail-name $@ s" a" tagged public-key @ IF public-key $@ href= s" a" tag - s" PGP key|-@/gpg.asc.gif" .img s" a" /tag + s" PGP key|-@/gpg-asc.gif" .img s" a" /tag THEN -envs ;