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.03 00.03 MarkupToHTML begin
 3: 00.03 00.03 MarkupToHTML begin
 4: 00.04 00.03 MarkupToHTML end
 5: 00.04 00.03 MarkupToHTML begin
 6: 00.04 00.04 MarkupToHTML end
 7: 00.05 00.04 MarkupToHTML end
 8: 00.05 00.05 MarkupToHTML begin
 9: 00.06 00.05 ReadApprovedUrls SiteAdmin.ApprovedUrls begin
10: 00.06 00.06 ReadApprovedUrls SiteAdmin.ApprovedUrls end
11: 00.07 00.06 MarkupToHTML end
12: 00.07 00.06 MarkupToHTML begin
13: 00.07 00.07 MarkupToHTML end
14: 00.08 00.07 now
Peak memory: 3,810,736 bytes