Jump to content

Template:File/Doc: Difference between revisions

From NixOS Wiki
DoggoBit (talk | contribs)
Created page with "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. {{file|main.py|| def main() pass if __name__ == "__main__" main() }} == Usage == <nowiki>{{file|filename|language|contents}}</nowiki> See documentation about <code><syntaxhighlight></code> for supported languages. <nowiki>{{file|main.c|c| #include <stdio.h> main( ) { printf("hello, world\n"); } }}</nowiki> == Ex..."
(No difference)

Revision as of 18:14, 7 June 2025

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
{{{3}}}

Usage

{{file|filename|language|contents}}

See documentation about <syntaxhighlight> for supported languages.

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

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

Example

C︎ main.c
#include <stdio.h>

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