Skip to main content
The NCI Community Hub will be retiring in May 2024. For more information please visit the NCIHub Retirement Page:https://ncihub.cancer.gov/groups/ncihubshutdown/overview
close

Help: Processors

Version
by (unknown)
Version 2
by (unknown)

Deletions or items before changed

Additions or items after changed

1 -
 
+
Processors are WikiMacros designed to provide alternative markup formats for the Wiki engine. Processors can be thought of as ''macro functions to process user-edited text''.
2 +
3 +
Wiki processors can be used in any Wiki text throughout the wiki, for various different purposes, like:
4 +
5 +
* syntax highlighting or for rendering text verbatim,
6 +
* rendering Wiki markup inside a context, like inside `<div>` blocks or `<span>` or within `<td>` or `<th>` table cells,
7 +
* using an alternative markup syntax, like raw HTML
8 +
9 +
=== Using Processors ===
10 +
11 +
To use a processor on a block of text, first delimit the lines using a Wiki code block:
12 +
13 +
{{{
14 +
{{{
15 +
The lines
16 +
that should be processed...
17 +
}}}
18 +
}}}
19 +
20 +
On the line just below the the curly braces add `#!` followed by the ''processor name''
21 +
22 +
{{{
23 +
{{{
24 +
#!processorname
25 +
The lines
26 +
that should be processed...
27 +
}}}
28 +
}}}
29 +
30 +
This is the "shebang" notation, familiar to most UNIX users.
31 +
32 +
Besides their content, some Wiki processors can also accept parameters, which are then given as key=value pairs after the processor name, on the same line. If value has to contain space, as it's often the case for the style parameter, a quoted string can be used (key="value with space").
33 +
34 +
As some processors are meant to process Wiki markup, it's quite possible to nest processor blocks. You may want to indent the content of nested blocks for increased clarity, this extra indentation will be ignored when processing the content.
35 +
36 +
=== Available Processors ===
37 +
38 +
|| `#!default` || Present the text verbatim in a preformatted text block. This is the same as specifying no processor name (and no `#!`) ||
39 +
|| `#!comment` || Do not process the text in this section (i.e. contents exist only in the plain text - not in the rendered page). ||
40 +
||||==. Admonitions =||
41 +
|| `#!wiki type` || Admonitions are used to make some text stand out or to point out something which doesn’t fit in the normal flow of the text. For more details see the [Help:Admonitions Admonitions help page].[[br]][[br]]''type'' can be caution, warning, important, note, or tip. ||
42 +
||||==. HTML related =||
43 +
|| `#!html` || Insert custom HTML in a wiki page. For more details see the [Help:WikiHtml Wiki HTML help page]. ||
44 +
|| `#!htmlcomment` || Insert an HTML comment in a wiki page. ||
45 +
||||==. Code Highlighting Support =||
46 +
|| `#!c` [[br]] `#!cpp` (C++)[[br]] `#!python` [[br]] `#!perl` [[br]] `#!ruby` [[br]] `#!php` [[br]] `#!asp` [[br]] `#!java` [[br]] `#!js` (Javascript)[[br]] `#!sql` [[br]] `#!xml` [[br]] `#!sh` (Bourne/Bash shell) || The wiki includes processors to provide inline syntax highlighting for source code in various languages. ||
47 +
48 +
Example:
49 +
50 +
{{{
51 +
{{{
52 +
#!php
53 +
$yes = true;
54 +
if ($yes)
55 +
{
56 +
echo 'Yes!';
57 +
}
58 +
}}}
59 +
}}}
60 +
61 +
Displays:
62 +
63 +
{{{
64 +
#!php
65 +
$yes = true;
66 +
if ($yes)
67 +
{
68 +
echo 'Yes!';
69 +
}
70 +
}}}
71 +
72 +
----
73 +
See also: [Help:WikiFormatting Wiki Formatting], [Help:WikiHtml Wiki HTML], [Help:Admonitions Admonitions]