Template:CodeBox

From PZwiki
Notebook.pngTemplate Documentation

The {{CodeBox}} template is used to hide and display a code snippet, to reduce page length for the average user.

Usage

Usage: {{CodeBox|This text will be hidden}}

Produces:
Code icon.png Code snippet! This section contains source code from Project ZomboidShow / Hide

This text will be hidden

Examples

The below is an example of typical usage alongside {{CodeSnip}}.

{{CodeBox
| {{CodeSnip
  | lang = java
  | line = true
  | start = 92
  | source = items.txt
  | retrieved = true
  | version = 41.78.16
  | code =
item BucketEmpty
	{
	    DisplayCategory = WaterContainer,
		Weight	=	1,
		CanStoreWater	=	TRUE,
		Type	=	Normal,
		DisplayName	=	Bucket,
		Icon	=	MetalBucket,
        ReplaceOnUseOn = WaterSource-BucketWaterFull,
        MetalValue = 20,
        RainFactor = 1,
		Tooltip = Tooltip_item_RainFromGround,
        EatType = Bucket,
        SurvivalGear = TRUE,
        WorldStaticModel = Bucket_Ground,
	}
}}
}}

Produces:

Code icon.png Code snippet! This section contains source code from Project ZomboidShow / Hide

Source: ProjectZomboid\media\scripts\items.txt

Retrieved: Build 41.78.16
item BucketEmpty
	{
	    DisplayCategory = WaterContainer,
		Weight	=	1,
		CanStoreWater	=	TRUE,
		Type	=	Normal,
		DisplayName	=	Bucket,
		Icon	=	MetalBucket,
        ReplaceOnUseOn = WaterSource-BucketWaterFull,
        MetalValue = 20,
        RainFactor = 1,
		Tooltip = Tooltip_item_RainFromGround,
        EatType = Bucket,
        SurvivalGear = TRUE,
        WorldStaticModel = Bucket_Ground,
	}

How to translate

This template doesn't need to/shouldn't be translated, but you can translate the documentation of this template with the following steps:

  1. Create a subpage of this template with the language code of the language you want to translate to.
  2. Copy the code wrapped in the <noinclude> tag in this template into the page you created.
    {{Translation guide}} template should be removed from the translated documentation.
  3. Translate the page according to the translation requirements of normal pages.

See also

Editors can experiment in this template's sandbox.