Difference between revisions of "Template:CodeBlock/Header/doc"

From Valve Developer Community
Jump to: navigation, search
m
m (Replaced content with "<noinclude>{{Delete|Unused.}}</noinclude>")
(Tag: Replaced)
 
Line 1: Line 1:
<noinclude>{{DISPLAYTITLE:Template: Code Block Header/doc}}{{doc|0}}</noinclude>
+
<noinclude>{{Delete|Unused.}}</noinclude>
Allows you to insert a header with a title and programming language anywhere in the [[:Template:CodeBlock|Markdown Code Block]].
 
 
 
__TOC__
 
 
 
== Usage ==
 
Just insert {{Code|style=1|select=1|<nowiki>{{CodeBlock/Header|YourText}}</nowiki>}} into the [[:Template:CodeBlock|Markdown Code Block]] and replace '''YourText''' with your content to make the header work.
 
 
 
<br>'''Manage Wiki Formatting:'''<br>
 
You can use {{Code|style=1|select=1|<nowiki><nowiki>YourText</nowiki></nowiki>}} to disable processing of various commands that allow the wiki to style your text. Also, it can disable the template mode.
 
 
 
<br>'''Switching Styles:'''<br>
 
Insert {{Code|style=1|select=1|<nowiki>mode|</nowiki>}} after {{Code|style=1|select=1|<nowiki>{{CodeBlock/Header|</nowiki>}} and replace '''mode''' with the name of an existing mode.
 
 
 
== Modes ==
 
{| class="standard-table"
 
! Name !! Description
 
|-
 
| <code style="padding: 1px 3px;">default</code> || allows you to write your own text on the both sides of the header
 
|-
 
| <code style="padding: 1px 3px; user-select: all;">plain</code> ||
 
|-
 
| <code style="padding: 1px 3px; user-select: all;">html</code> ||
 
|-
 
| <code style="padding: 1px 3px; user-select: all;">scss</code> ||
 
|-
 
| <code style="padding: 1px 3px; user-select: all;">less</code> ||
 
|-
 
| <code style="padding: 1px 3px; user-select: all;">js</code> ||
 
|-
 
| <code style="padding: 1px 3px; user-select: all;">json</code> ||
 
|-
 
| <code style="padding: 1px 3px; user-select: all;">php</code> ||
 
|-
 
| <code style="padding: 1px 3px; user-select: all;">c</code> ||
 
|-
 
| <code style="padding: 1px 3px; user-select: all;">cs</code> ||
 
|-
 
| <code style="padding: 1px 3px; user-select: all;">cpp</code> ||
 
|-
 
| <code style="padding: 1px 3px; user-select: all;">pascal</code> ||
 
|-
 
| <code style="padding: 1px 3px; user-select: all;">python</code> ||
 
|-
 
| <code style="padding: 1px 3px; user-select: all;">java</code> ||
 
|-
 
| <code style="padding: 1px 3px; user-select: all;">squirrel</code> ||
 
|-
 
| <code style="padding: 1px 3px; user-select: all;">lua</code> ||
 
|-
 
| <code style="padding: 1px 3px; user-select: all;">glua</code> ||
 
|}
 
 
 
== Examples ==
 
==== Default ====
 
{{CodeBlock|outline|<nowiki>{{CodeBlock|style=1|{{CodeBlock/Header|My Cute Title|My Cute Language}}* Me}}</nowiki>}}
 
 
 
{{Doc/PreviewBlock|{{CodeBlock|style=1|{{CodeBlock/Header|My Cute Title|My Cute Language}}* Me}}}}
 
 
 
 
 
==== Languages ====
 
{{CodeBlock|outline|<nowiki>{{CodeBlock|style=1|{{CodeBlock/Header|html|index.html}}<h1>Hello World</h1>}}</nowiki>}}
 
{{Doc/PreviewBlock|{{CodeBlock|style=1|{{CodeBlock/Header|html|index.html}}<nowiki><h1>Hello World</h1></nowiki>}}}}
 
 
 
 
 
{{CodeBlock|style=1|<nowiki>{{CodeBlock|style=1|{{CodeBlock/Header|css|style.css}}.string: before{
 
content: "Hello World";
 
padding: 0.5em;
 
margin-bottom: 0.5em;
 
}}}</nowiki>}}
 
{{Doc/PreviewBlock|
 
{{CodeBlock|outline|{{CodeBlock/Header|css|style.css}}<nowiki>.string:before{
 
content: "Hello World";
 
padding: 0.5em;
 
margin-bottom: 0.5em;
 
}</nowiki>}}
 
}}
 
 
 
{{Doc/PreviewBlock|
 
{{CodeBlock|style=1|{{CodeBlock/Header|scss|style.scss}}<nowiki>.string:before{
 
content: "Hello World";
 
padding: 0.5em;
 
margin-bottom: 0.5em;
 
}</nowiki>}}
 
{{CodeBlock|style=1|{{CodeBlock/Header|less|style.less}}<nowiki>.string:before{
 
content: "Hello World";
 
padding: 0.5em;
 
margin-bottom: 0.5em;
 
}</nowiki>}}
 
{{CodeBlock|style=1|{{CodeBlock/Header|js|hello.js}}<nowiki>console.log("Hello World");</nowiki>}}
 
{{CodeBlock|style=1|{{CodeBlock/Header|json|hello.json}}<nowiki>jsonString =
 
{
 
"message": "Hello",
 
"place": {
 
"name": "World"
 
}
 
}</nowiki>}}
 
{{CodeBlock|style=1|{{CodeBlock/Header|php|index.php}}<nowiki>echo "Hello World";</nowiki>}}
 
{{CodeBlock|style=1|{{CodeBlock/Header|c|Program.c}}<nowiki>#include <stdio.h>
 
 
 
int main (void)
 
{
 
  puts ("Hello, World!");
 
  return 0;
 
}</nowiki>}}
 
{{CodeBlock|outline|{{CodeBlock/Header|cs|Program.cs}}<nowiki>using System;
 
 
 
namespace HelloWorld
 
{
 
    internal class Program
 
    {
 
        static void Main(string[] args)
 
        {
 
            Console.WriteLine("Hello World");
 
        }
 
    }
 
}
 
</nowiki>}}
 
{{CodeBlock|style=1|{{CodeBlock/Header|cpp|Program.cpp}}<nowiki>#include <iostream>
 
int main()
 
{
 
std::cout << "Hello, World!" << std::endl;
 
return 0;
 
}</nowiki>}}
 
{{CodeBlock|style=1|{{CodeBlock/Header|pascal|Program.p}}<nowiki>program Hello;
 
begin
 
  writeln ('Hello, world.');
 
end.</nowiki>}}
 
{{CodeBlock|style=1|{{CodeBlock/Header|python|Program.py}}<nowiki>print("Hello World")</nowiki>}}
 
{{CodeBlock|style=1|{{CodeBlock/Header|java|Program.jar}}<nowiki>/*package whatever //do not write package name here */
 
 
import java.io.*;
 
 
class GFG {
 
    public static void main (String[] args) {
 
      System.out.println("Hello World");
 
    }
 
}</nowiki>}}
 
{{CodeBlock|style=1|{{CodeBlock/Header|squirrel|hello.nut}}<nowiki>print("Hello World!\n");</nowiki>}}
 
{{CodeBlock|style=1|{{CodeBlock/Header|lua|hello.lua}}<nowiki>print("Hello World")</nowiki>}}
 
{{CodeBlock|style=1|{{CodeBlock/Header|glua|hello.lua}}<nowiki>print("Hello World")</nowiki>}}
 
<br>
 
 
 
==== Header with Limited Code Block ====
 
{{CodeBlock|style=1|limited=1|{{CodeBlock/Header|plain|soundscapes.txt}}<nowiki>// DSP Effects
 
// 0 : "Normal (off)"
 
// 1 : "Generic"
 
// 2 : "Metal Small"
 
// 3 : "Metal Medium"
 
// 4 : "Metal Large"
 
// 5 : "Tunnel Small"
 
// 6 : "Tunnel Medium"
 
// 7 : "Tunnel Large"
 
// 8 : "Chamber Small"
 
// 9 : "Chamber Medium"
 
// 10: "Chamber Large"
 
// 11: "Bright Small"
 
// 12: "Bright Medium"
 
// 13: "Bright Large"
 
// 14: "Water 1"
 
// 15: "Water 2"
 
// 16: "Water 3"
 
// 17: "Concrete Small"
 
// 18: "Concrete Medium"
 
// 19: "Concrete Large"
 
// 20: "Big 1"
 
// 21: "Big 2"
 
// 22: "Big 3"
 
// 23: "Cavern Small"
 
// 24: "Cavern Medium"
 
// 25: "Cavern Large"
 
// 26: "Weirdo 1"
 
// 27: "Weirdo 2"
 
// 28: "Weirdo 3"
 
 
 
 
 
"tf2.respawn_room"
 
{
 
"dsp" "1"
 
 
 
"playlooping"
 
 
"volume" ".6"
 
"pitch" "100"
 
"wave" "ambient/underground.wav"
 
}
 
 
 
"playlooping"
 
{
 
"volume" ".30"
 
"pitch" "100"
 
"wave" "ambient/machine_hum2.wav"
 
}
 
 
"playlooping"
 
{
 
"volume" ".75"
 
"pitch" "100"
 
"position" "0"
 
"attenuation" "0.7"
 
"wave" "ambient/machine_hum.wav"
 
}
 
}</nowiki>
 
 
 
 
 
{{CodeBlock/Header|plain|soundscapes_2fort.txt}}<nowiki>// DSP Effects
 
// 0 : "Normal (off)"
 
// 1 : "Generic"
 
// 2 : "Metal Small"
 
// 3 : "Metal Medium"
 
// 4 : "Metal Large"
 
// 5 : "Tunnel Small"
 
// 6 : "Tunnel Medium"
 
// 7 : "Tunnel Large"
 
// 8 : "Chamber Small"
 
// 9 : "Chamber Medium"
 
// 10: "Chamber Large"
 
// 11: "Bright Small"
 
// 12: "Bright Medium"
 
// 13: "Bright Large"
 
// 14: "Water 1"
 
// 15: "Water 2"
 
// 16: "Water 3"
 
// 17: "Concrete Small"
 
// 18: "Concrete Medium"
 
// 19: "Concrete Large"
 
// 20: "Big 1"
 
// 21: "Big 2"
 
// 22: "Big 3"
 
// 23: "Cavern Small"
 
// 24: "Cavern Medium"
 
// 25: "Cavern Large"
 
// 26: "Weirdo 1"
 
// 27: "Weirdo 2"
 
// 28: "Weirdo 3"
 
 
 
// ATTN_NONE 0.0f
 
// ATTN_NORM 0.8f 75dB
 
// ATTN_IDLE 2.0f 60dB
 
// ATTN_STATIC 1.25f 66dB
 
// ATTN_RICOCHET 1.5f 65dB
 
// ATTN_GUNFIRE 0.27f 140dB
 
 
 
// SNDLVL_50dB = 50, // 3.9
 
// SNDLVL_55dB = 55, // 3.0
 
// SNDLVL_IDLE = 60, // 2.0
 
// SNDLVL_TALKING = 60, // 2.0
 
// SNDLVL_60dB = 60, // 2.0
 
// SNDLVL_65dB = 65, // 1.5
 
// SNDLVL_STATIC = 66, // 1.25
 
// SNDLVL_70dB = 70, // 1.0
 
// SNDLVL_NORM = 75,
 
// SNDLVL_75dB = 75, // 0.8
 
// SNDLVL_80dB = 80, // 0.7
 
// SNDLVL_85dB = 85, // 0.6
 
// SNDLVL_90dB = 90, // 0.5
 
// SNDLVL_95dB = 95,
 
// SNDLVL_100dB = 100, // 0.4
 
// SNDLVL_105dB = 105,
 
// SNDLVL_120dB = 120,
 
// SNDLVL_130dB = 130,
 
// SNDLVL_GUNFIRE = 140, // 0.27
 
// SNDLVL_140dB = 140, // 0.2
 
// SNDLVL_150dB = 150, // 0.2
 
 
 
 
 
"2fort.Underground"
 
{
 
"dsp" "1"
 
 
 
 
 
"playlooping"
 
{
 
"volume" ".6"
 
"pitch" "100"
 
"wave" "ambient/underground.wav"
 
}
 
 
 
"playlooping"
 
{
 
"volume" ".30"
 
"pitch" "100"
 
"wave" "ambient/machine_hum2.wav"
 
}
 
 
"playlooping"
 
{
 
"volume" ".75"
 
"pitch" "100"
 
"position" "0"
 
"attenuation" "0.7"
 
"wave" "ambient/machine_hum.wav"
 
}
 
 
 
"playlooping"
 
{
 
"volume" ".4"
 
"pitch" "100"
 
"position" "1"
 
"attenuation" "0.7"
 
"wave" "ambient/computer_tape.wav"
 
}
 
 
 
"playlooping"
 
{
 
"volume" ".75"
 
"pitch" "100"
 
"position" "2"
 
"attenuation" "0.7"
 
"wave" "ambient/computer_working.wav"
 
}
 
 
 
"playlooping"
 
{
 
"volume" ".4"
 
"pitch" "100"
 
"position" "3"
 
"attenuation" "0.7"
 
"wave" "ambient/computer_tape2.wav"
 
}
 
 
 
"playlooping"
 
{
 
"volume" ".75"
 
"pitch" "100"
 
"position" "4"
 
"attenuation" "0.7"
 
"wave" "ambient/command_center.wav"
 
}
 
 
 
"playlooping"
 
{
 
"volume" ".75"
 
"pitch" "100"
 
"position" "5"
 
"attenuation" "0.7"
 
"wave" "ambient/printer.wav"
 
}
 
}</nowiki>}}
 
 
 
{{CodeBlock|limited=1|{{CodeBlock/Header|plain|soundscapes.txt}}<nowiki>// DSP Effects
 
// 0 : "Normal (off)"
 
// 1 : "Generic"
 
// 2 : "Metal Small"
 
// 3 : "Metal Medium"
 
// 4 : "Metal Large"
 
// 5 : "Tunnel Small"
 
// 6 : "Tunnel Medium"
 
// 7 : "Tunnel Large"
 
// 8 : "Chamber Small"
 
// 9 : "Chamber Medium"
 
// 10: "Chamber Large"
 
// 11: "Bright Small"
 
// 12: "Bright Medium"
 
// 13: "Bright Large"
 
// 14: "Water 1"
 
// 15: "Water 2"
 
// 16: "Water 3"
 
// 17: "Concrete Small"
 
// 18: "Concrete Medium"
 
// 19: "Concrete Large"
 
// 20: "Big 1"
 
// 21: "Big 2"
 
// 22: "Big 3"
 
// 23: "Cavern Small"
 
// 24: "Cavern Medium"
 
// 25: "Cavern Large"
 
// 26: "Weirdo 1"
 
// 27: "Weirdo 2"
 
// 28: "Weirdo 3"
 
 
 
 
 
"tf2.respawn_room"
 
{
 
"dsp" "1"
 
 
 
"playlooping"
 
 
"volume" ".6"
 
"pitch" "100"
 
"wave" "ambient/underground.wav"
 
}
 
 
 
"playlooping"
 
{
 
"volume" ".30"
 
"pitch" "100"
 
"wave" "ambient/machine_hum2.wav"
 
}
 
 
"playlooping"
 
{
 
"volume" ".75"
 
"pitch" "100"
 
"position" "0"
 
"attenuation" "0.7"
 
"wave" "ambient/machine_hum.wav"
 
}
 
}</nowiki>
 
 
 
 
 
{{CodeBlock/Header|plain|soundscapes_2fort.txt}}<nowiki>// DSP Effects
 
// 0 : "Normal (off)"
 
// 1 : "Generic"
 
// 2 : "Metal Small"
 
// 3 : "Metal Medium"
 
// 4 : "Metal Large"
 
// 5 : "Tunnel Small"
 
// 6 : "Tunnel Medium"
 
// 7 : "Tunnel Large"
 
// 8 : "Chamber Small"
 
// 9 : "Chamber Medium"
 
// 10: "Chamber Large"
 
// 11: "Bright Small"
 
// 12: "Bright Medium"
 
// 13: "Bright Large"
 
// 14: "Water 1"
 
// 15: "Water 2"
 
// 16: "Water 3"
 
// 17: "Concrete Small"
 
// 18: "Concrete Medium"
 
// 19: "Concrete Large"
 
// 20: "Big 1"
 
// 21: "Big 2"
 
// 22: "Big 3"
 
// 23: "Cavern Small"
 
// 24: "Cavern Medium"
 
// 25: "Cavern Large"
 
// 26: "Weirdo 1"
 
// 27: "Weirdo 2"
 
// 28: "Weirdo 3"
 
 
 
// ATTN_NONE 0.0f
 
// ATTN_NORM 0.8f 75dB
 
// ATTN_IDLE 2.0f 60dB
 
// ATTN_STATIC 1.25f 66dB
 
// ATTN_RICOCHET 1.5f 65dB
 
// ATTN_GUNFIRE 0.27f 140dB
 
 
 
// SNDLVL_50dB = 50, // 3.9
 
// SNDLVL_55dB = 55, // 3.0
 
// SNDLVL_IDLE = 60, // 2.0
 
// SNDLVL_TALKING = 60, // 2.0
 
// SNDLVL_60dB = 60, // 2.0
 
// SNDLVL_65dB = 65, // 1.5
 
// SNDLVL_STATIC = 66, // 1.25
 
// SNDLVL_70dB = 70, // 1.0
 
// SNDLVL_NORM = 75,
 
// SNDLVL_75dB = 75, // 0.8
 
// SNDLVL_80dB = 80, // 0.7
 
// SNDLVL_85dB = 85, // 0.6
 
// SNDLVL_90dB = 90, // 0.5
 
// SNDLVL_95dB = 95,
 
// SNDLVL_100dB = 100, // 0.4
 
// SNDLVL_105dB = 105,
 
// SNDLVL_120dB = 120,
 
// SNDLVL_130dB = 130,
 
// SNDLVL_GUNFIRE = 140, // 0.27
 
// SNDLVL_140dB = 140, // 0.2
 
// SNDLVL_150dB = 150, // 0.2
 
 
 
 
 
"2fort.Underground"
 
{
 
"dsp" "1"
 
 
 
 
 
"playlooping"
 
{
 
"volume" ".6"
 
"pitch" "100"
 
"wave" "ambient/underground.wav"
 
}
 
 
 
"playlooping"
 
{
 
"volume" ".30"
 
"pitch" "100"
 
"wave" "ambient/machine_hum2.wav"
 
}
 
 
"playlooping"
 
{
 
"volume" ".75"
 
"pitch" "100"
 
"position" "0"
 
"attenuation" "0.7"
 
"wave" "ambient/machine_hum.wav"
 
}
 
 
 
"playlooping"
 
{
 
"volume" ".4"
 
"pitch" "100"
 
"position" "1"
 
"attenuation" "0.7"
 
"wave" "ambient/computer_tape.wav"
 
}
 
 
 
"playlooping"
 
{
 
"volume" ".75"
 
"pitch" "100"
 
"position" "2"
 
"attenuation" "0.7"
 
"wave" "ambient/computer_working.wav"
 
}
 
 
 
"playlooping"
 
{
 
"volume" ".4"
 
"pitch" "100"
 
"position" "3"
 
"attenuation" "0.7"
 
"wave" "ambient/computer_tape2.wav"
 
}
 
 
 
"playlooping"
 
{
 
"volume" ".75"
 
"pitch" "100"
 
"position" "4"
 
"attenuation" "0.7"
 
"wave" "ambient/command_center.wav"
 
}
 
 
 
"playlooping"
 
{
 
"volume" ".75"
 
"pitch" "100"
 
"position" "5"
 
"attenuation" "0.7"
 
"wave" "ambient/printer.wav"
 
}
 
}</nowiki>}}
 
}}
 
 
 
<includeonly>{{sandbox other||
 
[[Category:Markdown]]
 
}}</includeonly>
 

Latest revision as of 09:38, 27 January 2023

Warning icon.png
This template has been marked as a candidate for speedy deletion for the following reason:
Unused.
If you object to this decision, then please discuss why hereIf this page doesn't meet the criteria for speedy deletion, then please remove this notice, but do not remove it from pages that you have created yourself
Administrators - Remember to check if anything links here and the page history (last edit) before deleting.