Show Changes Show Changes
Print Print
Recent Changes Recent Changes
Subscriptions Subscriptions
Lost and Found Lost and Found
Find References Find References
Rename Rename
Administration Page Administration Page
Search

History

4/8/2008 2:54:40 PM
-12.190.158.7
2/26/2008 4:27:45 PM
-66.78.119.225
2/26/2008 12:48:09 AM
-192.36.35.3
2/26/2008 12:46:11 AM
-192.36.35.3
2/25/2008 12:54:17 AM
-192.36.35.3
List all versions List all versions

RSS feed for the FlexWiki namespace

Preformatted Text Formatting Rules
.

Whitespace Prefix

Any line starting with whitespace becomes preformatted text:

 Public Class MyClass
    Public Sub New()
        DoCoolStuff()
        If IsReallyCool Then
            DoSomethingEvenMoreCool()
        End If
    End Sub
 End Class
 public class CSharpExample {
    CSharpExample() {
       int n = 5;
       object[] test = new object[n];
    }
 }

Text inside of a PRE block doesn't get hyperlinks automatically added to it.

 Here is another '''example.'''

Non-indented preformatted text

RequiredBuild

It is difficult to cut and paste source files into Wiki and then insert 1 space before every line. The "PRE block" solves this problem. There are 2 usage scenarios: simple syntax and syntax with a key.

Simple Syntax:

{@
your text goes
here and it does not have to start with space or tab
}@

Produces:

your text goes
here and it does not have to start with space or tab

Syntax with key (if for some reason your text contains }@ at the beginning of a line)

{@UniqKey
any text
here including
}@ at line beginning
still inside pre
}@WrongKey
still inside pre
}@UniqKey

Produces:

any text
here including
}@ at line beginning
still inside pre
}@WrongKey
still inside pre

Extended Syntax

For purposes of showing large amounts of code, a lot of developers are used to seeing code presented with color syntax highlighting. To allow for this, you can use the {+ ... }+ syntax and then use the normal FlexWiki FormattingRules to apply styles. For example, this code

 {+
    %blue%public void%% Foo()
    {
        %green%// comment here%%
        %blue%string%% s;
...
    }
 }+


Would result in this output

   public void Foo()
   {
       // comment here
       string s;
       ...
   }

which will look extremely familiar to all of the Visual Studio developers out there.

Most of the normal FlexWiki processing is done on this text, it just maintains the fixed-width font and the whitespace presentation that is normally associated with the {@ ... }@ FlexWiki tag or the <pre> HTML tag. This processing includes Simple , Linking, Text size and Color, and Alternative or Textile formatting rules.

Question
It seems that WikiTalk is executed too in the extended preformatted syntax even though it isn't mentioned above. A simple test of this is to execute ProductVersion inside an extended syntax block. So if you want to colorcode a WikiTalk example to make it more readable it will be executed instead of showing as preformatted text. Is this how it's meant to be?
Answer
You are correct the WikiTalk inside the Extended Syntax Preformatting is executed. At this time it is not possible to colorize WikiTalk code, but that should be possible in a few weeks - 26 Feb 2008

Bugs

This next long line will not show as it should in IE7. It works fine in IE6 though as the whole page will have a horizontal scrollbar. In IE7 it gives the preformatted text a scrollbar itself which makes the scrollbar take up all the room resulting in that you can't see the text there:

 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 12345

You could do a small workaround where you add an empty line but this makes it look worse in IE6:

 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 12345

Not logged in. Log in

Welcome to the home of FlexWiki, an experimental collaboration tool, based on WikiWiki.

This is FlexWiki, an open source wiki engine.

This site supports the new NoFollow anti-spam initiative.
Change Style

Recent Topics