User:Daniel Gregoire/Code Formatting in the J Wiki

From J Wiki
Jump to navigation Jump to search

Long-time user, first-time editor of a wiki using the MediaWiki stack.

Here are some things I just learned by looking at other people's contributions.

J Syntax Highlighting

<syntaxhighlight lang=J line start=7>NB. Nota bene
i.10
1 2 3 + 4 5 6
(+/%#)
1j8</syntaxhighlight>

Looks like:

 7NB. Nota bene
 8i.10
 91 2 3 + 4 5 6
10(+/%#)
111j8

Or:

2 3 4$i.24

You can also use

<code></code>

tags instead of

<tt></tt>

tags, which adds a background color:

Here is tt, here is code.