Edge Rewrite
// HTMLRewriter · presentation

This page was redesigned at the edge.

Cloudflare fetched the original article and streamed it through HTMLRewriter to apply an entirely new visual system without rebuilding the source page.

Jump to content

Template:Parameter/testcases

From Wikipedia, the free encyclopedia

Syntax highlighting

[edit]

in these, the pipe and the assigned value (if any) use #333; the assignment operator uses #666 – these colors same as <syntaxhighlight>...</syntaxhighlight> as of 2024-08-07

Test 1
{{Parameter|foo|bar}}

{{Parameter}}

|foo=bar

{{Parameter/sandbox}}

|foo=bar

– 'foo' uses #767600 (default; same as <syntaxhighlight>...</syntaxhighlight> as of 2024-08-07)

Test 2
{{Parameter|foo|bar|color=}}

{{Parameter}}

|foo=bar

{{Parameter/sandbox}}

|foo=bar

– 'foo' uses no color
Test 3
{{Parameter|foo|bar|color=inherit}}

{{Parameter}}

|foo=bar

{{Parameter/sandbox}}

|foo=bar

– nothing in the output is colored

Test 4
{{Parameter|foo|bar|color=inherit |plain=yes}}

{{Parameter}}

|foo=bar

{{Parameter/sandbox}}

|foo=bar

– nothing in the output is colored and no border

Test 5
{{Parameter|foo|bar|color=red}}

{{Parameter}}

|foo=bar

{{Parameter/sandbox}}

|foo=bar

– 'foo' uses #8B0000; same color used by {{!mxt}}

Test 6
{{Parameter|foo|bar|color=green}}

{{Parameter}}

|foo=bar

{{Parameter/sandbox}}

|foo=bar

– 'foo' uses #008000; a slightly brighter green than the color used by {{mxt}} (#006400)

Test 7
{{Parameter|foo|bar|color=blue}}

{{Parameter}}

|foo=bar

{{Parameter/sandbox}}

|foo=bar

– 'foo' uses whatever color is specified in |color= (except red and green); for red, use |color=#f00; for green use |color=#0f0

Test 8
{{Parameter|foo|bar|color=#f00}}

{{Parameter}}

|foo=bar

{{Parameter/sandbox}}

|foo=bar

Test 9
{{Parameter|foo|bar|color=#0f0}}

{{Parameter}}

|foo=bar

{{Parameter/sandbox}}

|foo=bar

These tests should be removed in the future when we get rid of |red=, |green=, |mxt=, and |!mxt=:

Test 10
{{Parameter|foo|bar|red=y}}

{{Parameter}}

|foo=bar

{{Parameter/sandbox}}

|foo=bar

Test 11
{{Parameter|foo|bar|green=y}}

{{Parameter}}

|foo=bar

{{Parameter/sandbox}}

|foo=bar

Test 12
{{Parameter|foo|bar|mxt=y}}

{{Parameter}}

|foo=bar

{{Parameter/sandbox}}

|foo=bar

Test 13
{{Parameter|foo|bar|!mxt=y}}

{{Parameter}}

|foo=bar

{{Parameter/sandbox}}

|foo=bar

Other formatting

[edit]
Code Live Sandbox Notes
{{parameter|name}} |name= |name=
{{parameter|title|The Oxford English Dictionary}} |title=The Oxford English Dictionary |title=The Oxford English Dictionary
{{parameter||section}} |section |section For unnamed parameters;
note empty first
parameter in
the code
{{parameter|{{var|parameter}}|{{var|value}}}} |parameter=value |parameter=value
{{parameter|name|plain=yes}} |name= |name=
{{parameter|name|plain=yes|color=inherit}} |name= |name=