Forth Wiki Projects

Given the large set of non-overlapping Forthers interests, this page can just list starting points for each project in a given area.

Think of this page as the YellowPages? of open-source new Forth projects.


Would it be silly to write a wiki in Forth ? (WikiWikiClone)( ForthishWikiName )( ShortestWikiContest )

Not at all, there is even some activity going on towards that goal, at (demonstration) http://fwiki.logilan.com/. The source code for this is at http://fwiki.logilan.com/cgi/fwiki.forth. The descriptions at http://wiki.forthfreak.net/index.cgi?ForthWiki suggest that it is meant for use with JsForth.

It's difficult to handle traditional Wiki syntax in Forth, but I have written a Wiki-inspired markup language engine in RetroForth. You can view it at http://fwiki.retroforth.org -- Charles Childers

I object to the former poster's idea that writing traditional wiki syntax markup in Forth would be difficult. All right, bare Forth does not have the string function built-in one would like to use for this, but, as Forth can be extended, those an be loaded. There are a number of string packages available for download, and even if one wouldn't use a ready-to-use string package, it is not that much effort to write the required words.

I've come to the conclusion that it's not as hard as I originally thought. My current code is compact (<16 lines), but meets most of my current needs with a pretty simple syntax. My code, for RetroForth, follows. This doesn't inclue the code needed to obtain the page or pass it to the "wiki" word, but that's pretty easy to write. (Update: an expanded version of this code is now running on http://www.retroforth.org/wiki) -- Charles Childers

     create wi 'w 1, 'i 1, 0 1,                : set wi 2 + c! wi 3 ;
     : display 2drop wi 2 + c@ emit ;
     : handler set find ?if execute ;; then display ;
     : wiki for dup c@ handler 1+ next drop ;
     : opening 1 swap ! 2drop type ;
     : closing 0 swap ! type 2drop ;
     : choose dup @ 0 =if opening ;; then closing ;

: variables for variable next ; 4 variables bold italic underline heading : wi* s" <b>" s" </b>" bold choose ; : wi/ s" <i>" s" </i>" italic choose ; : wi_ s" <u>" s" </u>" underline choose ; : wi= s" <h1>" s" </h1>" heading choose ; : wi[ ." <a href=" ; : wi] ." </a>" ; : wi| ." >" ; : wi\ ." <br>" cr ; : wi~ 1+ dup c@ emit ; : wi{ ." <img src=" ; : wi} ." >" ;

| Quick Reference | -------------------- | *text* bold | /text/ italics | _text_ underline | =text= heading | \ line break | ~ quote next char (e.g., ~* to display a *) | [page|description] make a link | {imagename.ext} inline images


ForthLanguage, ForthCommunity


CategoryForth


EditText of this page (last edited September 3, 2007) or FindPage with title or text search