MarkupTricks


Commenting out long blocks on a page

Also known as: multiline comments

If you want to put many lines of comments on a page that are only visible in edit view and that can include directives that you don't want processed, use the "if false" trick:

The (:markup:)...(:markupend:) directive works here:

this text will be visible
(:if false:)
here is some
text
(:searchbox:)
with other directives
(:if:)
but the intervening lines will only show in edit view

this text will be visible but the intervening lines will only show in edit view

Spaceless block preformat

How can I do spaceless block preformat - that is, preformat multiple lines without prefixing each line with a single space? For instance, I want to display a code block in the wiki.

The answer is our old friend, [=...=], but with a space on the line before the opening bracket. Here is an example:

The (:markup:)...(:markupend:) directive DOES NOT work here:

 [= 
int main(int argc, char** argv)
{
  time_t epoch;
  char sdate[MAXS];
  struct tm* tmP;
  if (argc<2) {
    USAGE(NULL);
  }
} =]
  
int main(int argc, char** argv)
{
  time_t epoch;
  char sdate[MAXS];
  struct tm* tmP;
  if (argc<2) {
    USAGE(NULL);
  }
} 
 0: 00.00 00.00 config start
 1: 00.01 00.01 config end
 2: 00.21 00.20 MarkupToHTML begin
 3: 00.21 00.20 MarkupToHTML begin
 4: 00.21 00.21 MarkupToHTML end
 5: 00.21 00.21 MarkupToHTML begin
 6: 00.21 00.21 MarkupToHTML end
 7: 00.22 00.21 MarkupToHTML end
 8: 00.23 00.22 MarkupToHTML begin
 9: 00.23 00.22 ReadApprovedUrls SiteAdmin.ApprovedUrls begin
10: 00.24 00.23 ReadApprovedUrls SiteAdmin.ApprovedUrls end
11: 00.24 00.23 MarkupToHTML end
12: 00.24 00.23 MarkupToHTML begin
13: 00.25 00.23 MarkupToHTML end
14: 00.25 00.24 now
Peak memory: 3,710,944 bytes