Code
To display formatted code, use the %%<code>%%
tag.
Syntax
%%<code>%%source code%%</code>%%
Syntax highlighting
Syntax highlighting will be applied automatically if you supply a language
attribute.
%%<code%% php>...%%</code>%%
<?php
echo $_SERVER['HTTP_USER_AGENT'];
?>
echo $_SERVER['HTTP_USER_AGENT'];
?>
Internally, Polifonic uses the GeSHi generic syntax highlighter. All languages supported by GeSHi are therefore supported by Polifonic.
Line numbers
To display line numbers, add the lines:true
attribute.
%%<code%% php lines:true>...%%</code>%%
- <?php
- echo $_SERVER['HTTP_USER_AGENT'];
- ?>
To start line numbering at a specific number, set that number as the value of the lines
attribute.
%%<code%% php lines:10>...%%</code>%%
- <?php
- echo $_SERVER['HTTP_USER_AGENT'];
- ?>
Title
You can also display a title via the title
attribute.
%%<code%% php | Example PHP code>...%%</code>%%
Example PHP Code
<?php
echo $_SERVER['HTTP_USER_AGENT'];
?>
echo $_SERVER['HTTP_USER_AGENT'];
?>
This page was modified on 4 Nov 2015 at 2:06 PM.
Source
====== Code ======
To display formatted code, use the ''%%<code>%%'' tag.
===== Syntax =====
''%%<code>%%//source code//%%</code>%%''
==== Syntax highlighting ====
Syntax highlighting will be applied automatically if you supply a ''language'' attribute.
''%%<code%% **php**>...%%</code>%%''
<code php>
<?php
echo $_SERVER['HTTP_USER_AGENT'];
?>
</code>
Internally, Polifonic uses the [[http://qbnz.com/highlighter/|GeSHi]] generic syntax highlighter. All languages supported by GeSHi are therefore supported by Polifonic.
==== Line numbers ====
To display line numbers, add the ''lines:true'' attribute.
''%%<code%% php **lines:true**>...%%</code>%%''
<code php lines:true>
<?php
echo $_SERVER['HTTP_USER_AGENT'];
?>
</code>
To start line numbering at a specific number, set that number as the value of the ''lines'' attribute.
''%%<code%% php **lines:10**>...%%</code>%%''
<code php lines:10>
<?php
echo $_SERVER['HTTP_USER_AGENT'];
?>
</code>
==== Title ====
You can also display a title via the ''title'' attribute.
''%%<code%% php | **Example PHP code**>...%%</code>%%''
<code php | Example PHP Code>
<?php
echo $_SERVER['HTTP_USER_AGENT'];
?>
</code>