Indentation in MediaWiki

Is it possible to indent code block in MediaWiki using SyntaxHighlight GeSHi ?

For example, I would like the code container below to be aligned with a third level list

* This is plain text of a first-level list to be rendered by MediaWiki
** This is plain text of a a second-level list to be rendered by MediaWiki
*** This is plain text of a third-level list to be rendered by MediaWiki

<source lang="Cpp">
int main(int argc, char** argv)
{
    my_function(4, 1, 2, 3);
    return 0;
}
</source>

I tried wrapping a container of GeSHi colons code (using the MediaWiki standard indentation syntax ), but this prevents the parsing of GeSHi syntax.

To clarify, I would like to avoid wrapping my code with <code></code>, since I need the correct syntax highlighting.

Any suggestions?

+5
source share
3 answers

You can always wrap it with regular HTML div tags:

<div style="margin-left: 2em;">
  <source ...>
    ...
  </source>
</div>
+7

, :

:::{|
|
<source ...>
...
</source>
|}
+3

, HTML <ul>...</ul>? ( ) Meta, WikiMedia, : ?:

<ul>
      <li>one</li>
      <li>two<pre>

Here are a couple lines...
...of preformatted text

      </pre></li>
      <li>and the numbering</li>
      <li>starts over</li>
   </ul>

WikiMedia, bash , :

 <ul>
<source lang="bash">sudo apt-get install \
build-essential \
...
libglu1-mesa-dev libxmu-dev</source>
   </ul>

!

+1

All Articles