Template:Codesample
Appearance
From Meta, a Wikimedia project coordination wiki
CSS This template uses TemplateStyles:
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
| Parameter | Description | Type | Status | |
|---|---|---|---|---|
| Code | code 1 | Code sample to render | String | required |
| Programming language | lang | Name of lexer to use for highlighting
| String | suggested |
| Title | name | Title (name) of this code sample. Often a filename | String | suggested |
| Highlighted lines | highlight | Line(s) in example to highlight. Comma separated list of line numbers | String | optional |
| Show line numbers | line | Enable line numbers for sample | Boolean | optional |
| Starting line number | start | Starting line number when line numbers are shown. Note: Does not effect line numbers used for highlights.
| Number | optional |
| Color scheme | scheme | Color scheme to use. "dark" and "light" will apply solarized color schemes. Anything else will use syntaxhighlight extension defaults. | String | optional |
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.
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.