Note:

The Funtoo Linux project has transitioned to "Hobby Mode" and this wiki is now read-only.

Help:Funtoo Editing Guidelines/Source Code

From Funtoo
Revision as of 03:17, February 24, 2019 by Drobbins (talk | contribs)
Jump to navigation Jump to search

Displaying Source Code

To display source code, use can use the file template, specifying a lang= parameter:

   source code example

{{file|name=foobar|lang=python|desc=foobarosity|body=
import system
}}

This will produce:

   foobar (python source code) - foobarosity
import system

The parameters name (filename), lang (language for syntax highlighting) and desc (Description, appearing as a caption) are optional. For a list of supported languages, see this list.

   Important

If you need to display the pipe ("|") character within the body of a file template, replace each "|" with {{!}} -- otherwise your file contents will not display properly. This is necessary because {{file}} is a template and the "|" character is used as a delimiter for arguments to the template.