Jump to content
Wikimedia Meta-Wiki

Template:Codesample

From Meta, a Wikimedia project coordination wiki


Template documentation
This is the TemplateData for this template used by TemplateWizard, VisualEditor and other tools.

TemplateData for Codesample

<syntaxhighlight> with fancy colors and an optional title

Template parameters[Edit template data ]

This template prefers block formatting of parameters.

ParameterDescriptionTypeStatus
Codecode 1

Code sample to render

Stringrequired
Programming languagelang

Name of lexer to use for highlighting

Default
text
Example
shell-session
Stringsuggested
Titlename

Title (name) of this code sample. Often a filename

Stringsuggested
Highlighted lineshighlight

Line(s) in example to highlight. Comma separated list of line numbers

Stringoptional
Show line numbersline

Enable line numbers for sample

Booleanoptional
Starting line numberstart

Starting line number when line numbers are shown. Note: Does not effect line numbers used for highlights.

Default
1
Numberoptional
Color schemescheme

Color scheme to use. "dark" and "light" will apply solarized color schemes. Anything else will use syntaxhighlight extension defaults.

Stringoptional


echo"hello world!"
echo "hello world!"
$ echo"hello world!"


{{Codesample}}
ingress.yaml
---
apiVersion:networking.k8s.io/v1beta1
kind:Ingress
metadata:
name:foo-redirect
namespace:tool-foo
labels:
name:foo-redirect
annotations:
kubernetes.io/ingress.class:nginx
nginx.ingress.kubernetes.io/permanent-redirect:https://bar.toolforge.org/1ドル$is_args$args
spec:
rules:
-host:foo.toolforge.org
http:
paths:
-backend:
serviceName:unused
servicePort:8000
path:/(.*)
metadata
name:foo-redirect
namespace:tool-foo
labels:
name:foo-redirect
annotations:
kubernetes.io/ingress.class:nginx
nginx.ingress.kubernetes.io/permanent-redirect:https://bar.toolforge.org/1ドル$is_args$args
The above documentation is transcluded from Template:Codesample/doc. (edit | history)
Editors can experiment in this template’s sandbox (create | mirror) and testcases (create) pages.
Please add categories to the /doc subpage. Subpages of this template.

AltStyle によって変換されたページ (->オリジナル) /