Template:Highlight

From Computernewb Wiki
Revision as of 04:29, 20 May 2022 by Dartz (talk | contribs) (1 revision imported)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
{{{code}}}


Documentation

This template is intended to be an advanced version of the <syntaxhighlight> tag. It can be used for tutorials on projects which have multiple files, as it lets users display the name of the file and programming language that they are currently using. Here is a list of the available parameters:

Parameter Optional? Description
code No The program's code.
lang No The language that the program is in. Required for syntax highlighting. Defaults to plaintext.
displaylang Yes The name of the language. Displayed at the top of the template.
filename Yes The name of the file. Displayed at the top of the template.

Some examples of this template are displayed below.

Language: Python, File Name: test.py
print("Hello, world!")


Language: C#
using System;

for(int i = 10; i >= 0; i--) {
    Console.WriteLine($"{i}");
}


File Name: MyTweaks.reg
Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\*\shell\Open In Command Prompt\Command]
"Default"="cmd.exe %1"

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced]
"ShowSecondsInSystemClock"="dword:1"