Πρότυπο:code

Από Βικιλεξικό
Μετάβαση στην πλοήγηση Πήδηση στην αναζήτηση
Πρότυπο:code = wikt:en:Template:code, 2020.06.29

This is a convenience template, which formats a short inline snippet of code with syntax highlighting of a given language. The language is specified as the first positional parameter (as understood by the <syntaxhighlight> tag, with "js" being a shorthand for javascript and "py" for python, while the second is the snippet to format. Alternatively, you can specify the snippet as a named parameter with an empty name (|2==...) in case the code contains an equal sign.

It is similar to Wikipedia's w:en:Template:code, but the argument order is opposite.

Παράδειγμα[επεξεργασία]

{{code|js|3==(65535).toString(16) === 'ffff'}}

εμφανίζει

(65535).toString(16) === 'ffff'

Δείτε επίσης[επεξεργασία]