You are browsing a read-only backup copy of Wikitech. The live site can be found at wikitech.wikimedia.org

Template:Codesample/doc

From Wikitech-static
Jump to navigation Jump to search

Lua error in Module:TNT at line 159: Missing JsonConfig extension; Cannot load https://commons.wikimedia.org/wiki/Data:I18n/Uses TemplateStyles.tab.

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

Codesample

<templatedata> { "params": { "code": { "aliases": [ "1" ], "label": "Code", "description": "Code sample to render", "type": "string", "required": true }, "lang": { "label": "Programming language", "description": "Name of lexer to use for highlighting", "example": "shell-session", "type": "string", "default": "text", "suggested": true }, "name": { "label": "Title", "description": "Title (name) of this code sample. Often a filename", "type": "string", "suggested": true }, "highlight": { "label": "Highlighted lines", "description": "Line(s) in example to highlight. Comma separated list of line numbers", "type": "string" }, "line": { "label": "Show line numbers", "description": "Enable line numbers for sample", "type": "boolean" }, "start": { "label": "Starting line number", "description": "Starting line number when line numbers are shown. Note: Does not effect line numbers used for highlights.", "type": "number", "default": "1" }, "scheme": { "label": "Color scheme", "description": "Color scheme to use. \"dark\" and \"light\" will apply solarized color schemes. Anything else will use syntaxhighlight extension defaults.", "type": "string" } }, "description": "<syntaxhighlight> with fancy colors and an optional title", "paramOrder": [ "code", "lang", "name", "highlight", "line", "start", "scheme" ], "format": "block" } </templatedata>

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