Template: file

From NixOS Wiki
Jump to: navigation, search
This page is a template. It should be used as part of other articles. For more information, read Help:Template.

Please do not experiment with this template; you could ruin all pages using this template. If you want to edit this template, copy the text to Template:Sandbox, edit and test it there, and copy it back when it works.

Feel free to voice your opinion regarding this template.

The contents of a file.

Special note

The pipe character cannot be used as is within the template, as it is a special characters for templates.

It can be included using the magic word {{!}}.

Alternatively, it is possible to instead surround the contents in <nowiki> tags.

Usage

{{file|filename|language|contents}}

See documentation about <syntaxhighlight> for supported languages.

{{file|default.nix|nix|<nowiki>
{...}
{
  # Comment
}
</nowiki>}}

Example

{{file|main.c|c|
#include <stdio.h>

main( )
{
        printf("hello, world\n");
}
}}

Breeze-text-x-plain.png
main.c
#include <stdio.h>

main( )
{
        printf("hello, world\n");
}