Template:Sandbox: Difference between revisions

From NixOS Wiki
imported>Artturin
No edit summary
imported>Artturin
(testing what hr does)
Line 4: Line 4:


== Usage ==
== Usage ==
<nowiki>{{file|filename|language|contents}}</nowiki>
See documentation about <code>&lt;syntaxhighlight></code> for supported languages.
<nowiki>{{file|default.nix|nix|&lt;nowiki>
{...}
{
  # Comment
}
&lt;/nowiki>}}</nowiki>


== Example ==
== Example ==


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


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


<hr />
{{sandbox|bash}}
<hr />





Revision as of 20:56, 18 November 2020

This page is a template. It should be used as part of other articles. For more information, see 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 discuss this template in the talk page.

If you wanted to create a new page instead, use the search box to search for the title of the new page you want to create and follow the link Create the page "XYZ" on this wiki! in the results page. An alternative is to create a dangling link to the new page from an existing page. A final option is to directly visit the expected URL of the page.

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

Example

bash