create new tag
, view all tags
I'd like to see a list of the twiki formatting rules: their intended effect, the regular expression used to achieve it, and where/how in the code twiki uses it.

For example:

name effect rule explanation regular expression handled by
Wiki Word link to another topic whitespace, initial capital followed by any number of lower case alpha characters, followed by one or more capitals [:whitespace:] [A-Z] [a-z]* [A-Z] .* [:whitespace:] (? TWiki.pm: function xxx, lines ###-### ?)

Note: regexp elements are seperated by spaces to allow line wrap in the table

While I am not a programmer, I do know a little about constructing regular expressions and would feel comfortable slightly modifying a particular rule, as long as I knew exactly where to go.

I would think such a table would also be useful to developers working on conversion tools (other-wiki <=> twiki, html2wiki, AppletBasedEditor, EasyEditor, etc.)

-- MattWilkie - 18 Oct 2002

Syntax on one page is at TWikiShorthand - but without regexes. HTH.

-- PeterMasiar - 21 Oct 2002

If you want to see the code used, I can only say 'Use the Source, Luke', i.e. point you to CVS:lib/TWiki.pm smile Seriously, in the absence of LiterateProgramming support for TWiki, it's unlikely that any such table would be kept up to date (unless there is someone very dedicated lurking out there). There's a lot of code that would need to be summarised.

-- RichardDonkin - 21 Oct 2002

Okay, I see this would be too much work the way I've outlined it. What about a more generalised map?

function or result file(s) words to search for
convert .txt files to html view, TWiki.pm render, sub wiki2html
identify parent topics Search.pm parent, sub whoisyrdad

I tried looking (and will keep trying) through CVS:lib/TWiki.pm but without a search function it's tough slogging. Or perhaps I just need to ask the questions I'm particularily interested in on a case by case basis, for instance:

  • I want to change the separator symbol used by the % REVISIONS% variable in view.tmpl (Changing TMPL:DEF{"sep"} in twiki.tmpl has no effect). However I don't know which file to look in or what keyword/function name to grep for.

  • Where does the variable % EDITTOPIC% get assigned? (again, used in view.tmpl ) It doesn't work properly in any of the skins I've tried to build.

I don't mind reading to find this stuff out, my problem is I don't know where to start. Would it be better to ask about this kind of stuff in the Support web?

-- MattWilkie - 30 Oct 2002

The best thing is to check out the TWikiAlphaRelease source code using Cygwin - it's not too hard to get going with this. If you use Windows, download CygWin and install the cvs package, then read CvsReadme (you just need anonymous checkouts). Or you can use the TWikiBetaRelease, which doesn't require CVS and is fairly up to date.

Once you have the code, it's very easy to do commands such as grep -R REVISIONS . from the twiki directory (recursive grep, requires GNU grep), which tells me that the code which updates $revisions does indeed have the pipe symbol hard-coded. See line 218 of CVS:bin/view and similar code in CVS:bin/rdiff, or just search for ' | '.

%EDITTOPIC% and related variables changed a bit due to a bug fix for RefreshEditPage - see that page for some discussion which was based on supporting skins while also enabling this fix.

-- RichardDonkin - 02 Nov 2002

Thank you for that pointer Richard, I'll try it out and see how far I get.

I have changed the classification for this topic from FeatureEnhancementRequest to FeatureNotSuitable. (I still think a TWikiCodeMap is a good idea, I just don't have a clear idea yet of what it should look like.)

-- MattWilkie - 04 Nov 2002

Edit | Attach | Watch | Print version | History: r6 < r5 < r4 < r3 < r2 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r6 - 2002-11-04 - MattWilkie
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2018 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.