Jump to content

Template:File

From NixOS Wiki

Template Documentation [edit source| uses| help]

This template is used to display the content of a file, or otherwise a block of code with the context of which file it would belong to.

🐍︎ main.py
def main():
  pass

if __name__ == "__main__":
  main()

Usage

Simply include this template in your page, specifying the language, file name and content of the file. Note that you may have to surround the code in <nowiki> tags in order to display it correctly.

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

main( )
{
        printf("hello, world\n");
}
</nowiki>
}}

Template data

Display a block of code alongside the name of the file it would belong to

Template parameters[Edit template data]

ParameterDescriptionTypeStatus
File namename

Name of the file the code belongs to

Stringrequired
Programming languagelang

The programming language used in the code

Stringrequired
Content3

The code to be displayed

Stringrequired
11

no description

Unknowndeprecated
22

no description

Unknowndeprecated
filenamefilename

no description

Unknowndeprecated
filefile

no description

Unknowndeprecated
contentscontents

no description

Unknowndeprecated
languagelanguage

no description

Unknowndeprecated