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.11 00.11 MarkupToHTML begin
 3: 00.12 00.11 MarkupToHTML begin
 4: 00.12 00.12 MarkupToHTML end
 5: 00.12 00.12 MarkupToHTML begin
 6: 00.12 00.12 MarkupToHTML end
 7: 00.13 00.13 MarkupToHTML end
 8: 00.13 00.13 MarkupToHTML begin
 9: 00.14 00.13 ReadApprovedUrls SiteAdmin.ApprovedUrls begin
10: 00.14 00.14 ReadApprovedUrls SiteAdmin.ApprovedUrls end
11: 00.15 00.14 MarkupToHTML end
12: 00.15 00.14 MarkupToHTML begin
13: 00.15 00.14 MarkupToHTML end
14: 00.16 00.15 now
Peak memory: 3,396,160 bytes