Diff for /gforth/wf.fs between versions 1.55 and 1.62

version 1.55, 2008/07/15 16:11:49 version 1.62, 2010/12/31 18:09:02
Line 1 Line 1
 \ wiki forth  \ 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.  \ This file is part of Gforth.
   
Line 270  Defer parse-line Line 270  Defer parse-line
     s" ]" link-suffix $+!      s" ]" link-suffix $+!
     link-suffix $@ alt= ;      link-suffix $@ alt= ;
   
   : replace.- ( addr u -- )
       bounds ?DO  I c@ '. = IF  '- I c!  THEN  LOOP ;
   
 : get-icon ( addr u -- )  iconpath @ IF  2drop  EXIT  THEN  : get-icon ( addr u -- )  iconpath @ IF  2drop  EXIT  THEN
     link-suffix $! s" .*" link-suffix $+!      link-suffix $! link-suffix $@ replace.-
     icon-prefix $@ open-dir throw >r      s" .*" link-suffix $+!
       icon-prefix $@ open-dir IF  drop  EXIT  THEN >r
     BEGIN      BEGIN
         pad $100 r@ read-dir throw  WHILE          pad $100 r@ read-dir throw  WHILE
         pad swap 2dup link-suffix $@ filename-match          pad swap 2dup link-suffix $@ filename-match
Line 380  Create do-words  $100 0 [DO] ' .text , [ Line 384  Create do-words  $100 0 [DO] ' .text , [
 : >tag '\ parse type '\ parse tag ;  : >tag '\ parse type '\ parse tag ;
   
 char>tag * b  char>tag * b
   char>tag / i
 char>tag _ em  char>tag _ em
 char>tag # code  char>tag # code
 :noname  '~ parse .type '~ parse .type ; '~ cells do-words + !  :noname  '~ parse .type '~ parse .type ; '~ cells do-words + !
Line 462  Create nav-buf 0 c, Line 467  Create nav-buf 0 c,
         ELSE  dup 'a 'z 1+ within IF  nav+          ELSE  dup 'a 'z 1+ within IF  nav+
             ELSE  dup '0 '9 1+ within IF  nav+              ELSE  dup '0 '9 1+ within IF  nav+
                 ELSE  dup  bl = over '- = or IF  '- nav+                  ELSE  dup  bl = over '- = or IF  '- nav+
                     ELSE  nav+                      ELSE  drop
                     THEN  THEN  THEN  THEN                      THEN  THEN  THEN  THEN
     LOOP ;      LOOP ;
 : >nav ( addr u -- addr' u' )  : >nav ( addr u -- addr' u' )
Line 531  true Value toc-image Line 536  true Value toc-image
     IF  -env cr s" p" >env  THEN ;      IF  -env cr s" p" >env  THEN ;
   
 : print-toc ( -- ) toc-index off cr  : print-toc ( -- ) toc-index off cr
     toc-image IF  s" img-menu"  ELSE  s" menu"  THEN id=      toc-image IF  s" img-menu"  ELSE  s" menu"  THEN class=
     s" div" >env cr s" p" >env      s" div" >env cr s" p" >env
     0 parse      0 parse
     dup 0= IF  toc-name $! 0  ELSE      dup 0= IF  toc-name $! 0  ELSE
Line 549  true Value toc-image Line 554  true Value toc-image
     indentlevel @ over      indentlevel @ over
     indentlevel !      indentlevel !
     2dup < IF swap DO  -env   LOOP  EXIT THEN      2dup < IF swap DO  -env   LOOP  EXIT THEN
     2dup > IF      DO   s" div" >env  LOOP EXIT THEN      2dup > IF      DO   indent= s" div" >env  LOOP EXIT THEN
     2dup = IF drop IF  -env  s" div" >env  THEN THEN      2dup = IF drop IF  -env  indent= s" div" >env  THEN THEN
 ;  
 : +indent ( -- )  
     indentlevel @ IF  -env indent= s" div" >env  THEN  
 ;  ;
   
 wordlist constant longtags  wordlist constant longtags
Line 563  Variable divs Line 565  Variable divs
 longtags set-current  longtags set-current
   
 : --- 0 indent cr s" hr" tag/ cr ;  : --- 0 indent cr s" hr" tag/ cr ;
 : *   1 indent +indent s" h1" dclass= s" h1" par s" " dclass= ;  : *   1 indent s" h1" dclass= s" h1" par s" " dclass= ;
 : **  1 indent +indent s" h2" dclass= s" h2" par s" " dclass= ;  : **  1 indent s" h2" dclass= s" h2" par s" " dclass= ;
 : *** 2 indent +indent s" h3" dclass= s" h3" par s" " dclass= ;  : *** 2 indent s" h3" dclass= s" h3" par s" " dclass= ;
 : --  0 indent cr print-toc ;  : --  0 indent cr print-toc ;
 : &&  0 parse id= ;  : &&  0 parse id= ;
 : -   s" ul" env s" li" par ;  : -   s" ul" env s" li" par ;
Line 579  longtags set-current Line 581  longtags set-current
 : p<< s" p" >env ;  : p<< s" p" >env ;
 : <<  +env ;  : <<  +env ;
 : <*  s" center" class= ;  : <*  s" center" class= ;
 : <red  s" p" >env s" #ff0000" s" color" opt s" font" >env parse-par ;  : <red  s" red" class= s" p" >env parse-par ;
 : red> -env -env ;  : red> -env ;
 : >>  -env ;  : >>  -env ;
 : *> ;  : *> ;
 : ::  interpret ;  : ::  interpret ;
Line 730  Variable orig-date Line 732  Variable orig-date
     s" Mail|@/mail.gif" .img mail $@ mailto: mail-name $@ s" a" tagged      s" Mail|@/mail.gif" .img mail $@ mailto: mail-name $@ s" a" tagged
     public-key @ IF      public-key @ IF
         public-key $@ href=  s" a" tag          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      THEN
     -envs ;      -envs ;
   
Line 740  Variable orig-date Line 742  Variable orig-date
     '< sword -trailing mail-name $! '> sword mail $! ;      '< sword -trailing mail-name $! '> sword mail $! ;
 : pgp-key ( -- )  : pgp-key ( -- )
     bl sword -trailing public-key $! ;      bl sword -trailing public-key $! ;
 : charset ( -- )  s" text/xhtml; charset=" content $!  : charset ( -- )  s" application/xhtml+xml; charset=" content $!
     bl sword -trailing 2dup content $+! _charset $! ;      bl sword -trailing 2dup content $+! _charset $! ;
   
 charset iso-8859-1  charset iso-8859-1

Removed from v.1.55  
changed lines
  Added in v.1.62


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>