Template:Highlight: Difference between revisions

From Computernewb Wiki
Jump to navigation Jump to search
computernewb>Judyhegao
(A brand new version of syntaxhighlight for complex projects.)
(No difference)

Revision as of 21:53, 3 May 2021

{{{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"