CINXE.COM
Template:Codesample - Meta
<!DOCTYPE html> <html class="client-nojs vector-feature-language-in-header-enabled vector-feature-language-in-main-page-header-disabled vector-feature-sticky-header-disabled vector-feature-page-tools-pinned-disabled vector-feature-toc-pinned-clientpref-1 vector-feature-main-menu-pinned-disabled vector-feature-limited-width-clientpref-1 vector-feature-limited-width-content-enabled vector-feature-custom-font-size-clientpref-1 vector-feature-appearance-pinned-clientpref-1 vector-feature-night-mode-disabled skin-theme-clientpref-day vector-toc-not-available" lang="en" dir="ltr"> <head> <meta charset="UTF-8"> <title>Template:Codesample - Meta</title> <script>(function(){var className="client-js vector-feature-language-in-header-enabled vector-feature-language-in-main-page-header-disabled vector-feature-sticky-header-disabled vector-feature-page-tools-pinned-disabled vector-feature-toc-pinned-clientpref-1 vector-feature-main-menu-pinned-disabled vector-feature-limited-width-clientpref-1 vector-feature-limited-width-content-enabled vector-feature-custom-font-size-clientpref-1 vector-feature-appearance-pinned-clientpref-1 vector-feature-night-mode-disabled skin-theme-clientpref-day vector-toc-not-available";var cookie=document.cookie.match(/(?:^|; )metawikimwclientpreferences=([^;]+)/);if(cookie){cookie[1].split('%2C').forEach(function(pref){className=className.replace(new RegExp('(^| )'+pref.replace(/-clientpref-\w+$|[^\w-]+/g,'')+'-clientpref-\\w+( |$)'),'$1'+pref+'$2');});}document.documentElement.className=className;}());RLCONF={"wgBreakFrames":false,"wgSeparatorTransformTable":["",""],"wgDigitTransformTable":["",""],"wgDefaultDateFormat" :"dmy","wgMonthNames":["","January","February","March","April","May","June","July","August","September","October","November","December"],"wgRequestId":"f33b6e88-debc-4cb4-8556-7d483be7e8cd","wgCanonicalNamespace":"Template","wgCanonicalSpecialPageName":false,"wgNamespaceNumber":10,"wgPageName":"Template:Codesample","wgTitle":"Codesample","wgCurRevisionId":22425622,"wgRevisionId":22425622,"wgArticleId":11622091,"wgIsArticle":true,"wgIsRedirect":false,"wgAction":"view","wgUserName":null,"wgUserGroups":["*"],"wgCategories":["Pages using the JsonConfig extension","Templates using TemplateStyles","Templates"],"wgPageViewLanguage":"en","wgPageContentLanguage":"en","wgPageContentModel":"wikitext","wgRelevantPageName":"Template:Codesample","wgRelevantArticleId":11622091,"wgIsProbablyEditable":true,"wgRelevantPageIsProbablyEditable":true,"wgRestrictionEdit":[],"wgRestrictionMove":[],"wgNoticeProject":"meta","wgCiteReferencePreviewsActive":false,"wgMediaViewerOnClick":true, "wgMediaViewerEnabledByDefault":true,"wgVisualEditor":{"pageLanguageCode":"en","pageLanguageDir":"ltr","pageVariantFallbacks":"en"},"wgMFDisplayWikibaseDescriptions":{"search":true,"watchlist":true,"tagline":false,"nearby":true},"wgWMESchemaEditAttemptStepOversample":false,"wgWMEPageLength":600,"wgCentralAuthMobileDomain":false,"wgEditSubmitButtonLabelPublish":true,"wgULSPosition":"personal","wgULSisCompactLinksEnabled":false,"wgVector2022LanguageInHeader":true,"wgULSisLanguageSelectorEmpty":false,"wgCheckUserClientHintsHeadersJsApi":["brands","architecture","bitness","fullVersionList","mobile","model","platform","platformVersion"]};RLSTATE={"ext.globalCssJs.user.styles":"ready","site.styles":"ready","user.styles":"ready","ext.globalCssJs.user":"ready","user":"ready","user.options":"loading","ext.pygments":"ready","ext.templateData":"ready","ext.templateData.images":"ready","jquery.tablesorter.styles":"ready","oojs-ui-core.styles":"ready","oojs-ui.styles.indicators":"ready", "mediawiki.widgets.styles":"ready","oojs-ui-core.icons":"ready","skins.vector.search.codex.styles":"ready","skins.vector.styles":"ready","skins.vector.icons":"ready","ext.wikimediamessages.styles":"ready","ext.visualEditor.desktopArticleTarget.noscript":"ready","ext.uls.pt":"ready","wikibase.client.init":"ready","ext.wikimediaBadges":"ready"};RLPAGEMODULES=["ext.pygments.view","jquery.tablesorter","site","mediawiki.page.ready","skins.vector.js","ext.centralNotice.geoIP","ext.centralNotice.startUp","ext.gadget.AddTopic","ext.gadget.formWizard","ext.gadget.ReferenceTooltips","ext.gadget.WishlistTranslation","ext.urlShortener.toolbar","ext.centralauth.centralautologin","mmv.bootstrap","ext.visualEditor.desktopArticleTarget.init","ext.visualEditor.targetLoader","ext.echo.centralauth","ext.eventLogging","ext.wikimediaEvents","ext.navigationTiming","ext.uls.interface","ext.checkUser.clientHints"];</script> <script>(RLQ=window.RLQ||[]).push(function(){mw.loader.impl(function(){return["user.options@12s5i",function($,jQuery,require,module){mw.user.tokens.set({"patrolToken":"+\\","watchToken":"+\\","csrfToken":"+\\"}); }];});});</script> <link rel="stylesheet" href="/w/load.php?lang=en&modules=ext.pygments%2CtemplateData%2CwikimediaBadges%7Cext.templateData.images%7Cext.uls.pt%7Cext.visualEditor.desktopArticleTarget.noscript%7Cext.wikimediamessages.styles%7Cjquery.tablesorter.styles%7Cmediawiki.widgets.styles%7Coojs-ui-core.icons%2Cstyles%7Coojs-ui.styles.indicators%7Cskins.vector.icons%2Cstyles%7Cskins.vector.search.codex.styles%7Cwikibase.client.init&only=styles&skin=vector-2022"> <script async="" src="/w/load.php?lang=en&modules=startup&only=scripts&raw=1&skin=vector-2022"></script> <meta name="ResourceLoaderDynamicStyles" content=""> <link rel="stylesheet" href="/w/load.php?lang=en&modules=site.styles&only=styles&skin=vector-2022"> <meta name="generator" content="MediaWiki 1.44.0-wmf.5"> <meta name="referrer" content="origin"> <meta name="referrer" content="origin-when-cross-origin"> <meta name="robots" content="max-image-preview:standard"> <meta name="format-detection" content="telephone=no"> <meta name="viewport" content="width=1120"> <meta property="og:title" content="Template:Codesample - Meta"> <meta property="og:type" content="website"> <link rel="preconnect" href="//upload.wikimedia.org"> <link rel="alternate" media="only screen and (max-width: 640px)" href="//meta.m.wikimedia.org/wiki/Template:Codesample"> <link rel="alternate" type="application/x-wiki" title="Edit" href="/w/index.php?title=Template:Codesample&action=edit"> <link rel="icon" href="/static/favicon/community.ico"> <link rel="search" type="application/opensearchdescription+xml" href="/w/rest.php/v1/search" title="Meta (en)"> <link rel="EditURI" type="application/rsd+xml" href="//meta.wikimedia.org/w/api.php?action=rsd"> <link rel="canonical" href="https://meta.wikimedia.org/wiki/Template:Codesample"> <link rel="license" href="https://creativecommons.org/licenses/by-sa/4.0/"> <link rel="alternate" type="application/atom+xml" title="Meta Atom feed" href="/w/index.php?title=Special:RecentChanges&feed=atom"> <link rel="dns-prefetch" href="//login.wikimedia.org"> </head> <body class="skin--responsive skin-vector skin-vector-search-vue mediawiki ltr sitedir-ltr mw-hide-empty-elt ns-10 ns-subject mw-editable page-Template_Codesample rootpage-Template_Codesample skin-vector-2022 action-view"><a class="mw-jump-link" href="#bodyContent">Jump to content</a> <div class="vector-header-container"> <header class="vector-header mw-header"> <div class="vector-header-start"> <nav class="vector-main-menu-landmark" aria-label="Site"> <div id="vector-main-menu-dropdown" class="vector-dropdown vector-main-menu-dropdown vector-button-flush-left vector-button-flush-right" > <input type="checkbox" id="vector-main-menu-dropdown-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-vector-main-menu-dropdown" class="vector-dropdown-checkbox " aria-label="Main menu" > <label id="vector-main-menu-dropdown-label" for="vector-main-menu-dropdown-checkbox" class="vector-dropdown-label cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet cdx-button--icon-only " aria-hidden="true" ><span class="vector-icon mw-ui-icon-menu mw-ui-icon-wikimedia-menu"></span> <span class="vector-dropdown-label-text">Main menu</span> </label> <div class="vector-dropdown-content"> <div id="vector-main-menu-unpinned-container" class="vector-unpinned-container"> <div id="vector-main-menu" class="vector-main-menu vector-pinnable-element"> <div class="vector-pinnable-header vector-main-menu-pinnable-header vector-pinnable-header-unpinned" data-feature-name="main-menu-pinned" data-pinnable-element-id="vector-main-menu" data-pinned-container-id="vector-main-menu-pinned-container" data-unpinned-container-id="vector-main-menu-unpinned-container" > <div class="vector-pinnable-header-label">Main menu</div> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-pin-button" data-event-name="pinnable-header.vector-main-menu.pin">move to sidebar</button> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-unpin-button" data-event-name="pinnable-header.vector-main-menu.unpin">hide</button> </div> <div id="p-navigation" class="vector-menu mw-portlet mw-portlet-navigation" > <div class="vector-menu-heading"> Navigation </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="n-mainpage-description" class="mw-list-item"><a href="/wiki/Special:MyLanguage/Main_Page" title="Visit the main page [z]" accesskey="z"><span>Main page</span></a></li><li id="n-wikimedia-news-label" class="mw-list-item"><a href="/wiki/Wikimedia_News"><span>Wikimedia News</span></a></li><li id="n-translations-text" class="mw-list-item"><a href="/wiki/Special:LanguageStats"><span>Translations</span></a></li><li id="n-recentchanges" class="mw-list-item"><a href="/wiki/Special:RecentChanges" title="A list of recent changes in the wiki [r]" accesskey="r"><span>Recent changes</span></a></li><li id="n-randompage" class="mw-list-item"><a href="/wiki/Special:Random" title="Load a random page [x]" accesskey="x"><span>Random page</span></a></li><li id="n-help" class="mw-list-item"><a href="/wiki/Special:MyLanguage/Help:Help" title="The place to find out"><span>Help</span></a></li><li id="n-Babel-text" class="mw-list-item"><a href="/wiki/Meta:Babel"><span>Babel</span></a></li> </ul> </div> </div> <div id="p-community" class="vector-menu mw-portlet mw-portlet-community" > <div class="vector-menu-heading"> Community </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="n-WikimediaResourceCenter-text" class="mw-list-item"><a href="/wiki/Special:MyLanguage/Wikimedia_Resource_Center"><span>Wikimedia Resource Center</span></a></li><li id="n-WikimediaForum-text" class="mw-list-item"><a href="/wiki/Wikimedia_Forum"><span>Wikimedia Forum</span></a></li><li id="n-mailinglists-text" class="mw-list-item"><a href="/wiki/Special:MyLanguage/Mailing_lists/Overview"><span>Mailing lists</span></a></li><li id="n-Requests-text" class="mw-list-item"><a href="/wiki/Special:MyLanguage/Meta:Requests_and_proposals"><span>Requests</span></a></li><li id="n-Babylon-text" class="mw-list-item"><a href="/wiki/Special:MyLanguage/Meta:Babylon"><span>Babylon</span></a></li><li id="n-Reports-text" class="mw-list-item"><a href="/wiki/Special:MyLanguage/Wikimedia_Affiliates_Data_Portal"><span>Reports</span></a></li><li id="n-Research-text" class="mw-list-item"><a href="/wiki/Special:MyLanguage/Research:Index"><span>Research</span></a></li><li id="n-planet" class="mw-list-item"><a href="//en.planet.wikimedia.org/" title="Weblog aggregator of Wikimedia-related posts"><span>Planet Wikimedia</span></a></li> </ul> </div> </div> <div id="p-beyond_the_web" class="vector-menu mw-portlet mw-portlet-beyond_the_web" > <div class="vector-menu-heading"> Beyond the Web </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="n-Meetup-text" class="mw-list-item"><a href="/wiki/Special:MyLanguage/Meetup"><span>Meet Wikimedians</span></a></li><li id="n-Events-text" class="mw-list-item"><a href="/wiki/Events"><span>Events</span></a></li><li id="n-wikimedia-movement-affiliates-shortlabel" class="mw-list-item"><a href="/wiki/Special:MyLanguage/Wikimedia_movement_affiliates"><span>Movement affiliates</span></a></li> </ul> </div> </div> </div> </div> </div> </div> </nav> <a href="/wiki/Special:MyLanguage/Main_Page" class="mw-logo"> <img class="mw-logo-icon" src="/static/images/icons/metawiki.svg" alt="" aria-hidden="true" height="50" width="50"> <span class="mw-logo-container skin-invert"> <img class="mw-logo-wordmark" alt="Wikimedia Meta-Wiki" src="/static/images/mobile/copyright/metawiki-wordmark.svg" style="width: 7.5em; height: 1.8125em;"> </span> </a> </div> <div class="vector-header-end"> <div id="p-search" role="search" class="vector-search-box-vue vector-search-box-collapses vector-search-box-show-thumbnail vector-search-box-auto-expand-width vector-search-box"> <a href="/wiki/Special:Search" class="cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet cdx-button--icon-only search-toggle" title="Search Meta [f]" accesskey="f"><span class="vector-icon mw-ui-icon-search mw-ui-icon-wikimedia-search"></span> <span>Search</span> </a> <div class="vector-typeahead-search-container"> <div class="cdx-typeahead-search cdx-typeahead-search--show-thumbnail cdx-typeahead-search--auto-expand-width"> <form action="/w/index.php" id="searchform" class="cdx-search-input cdx-search-input--has-end-button"> <div id="simpleSearch" class="cdx-search-input__input-wrapper" data-search-loc="header-moved"> <div class="cdx-text-input cdx-text-input--has-start-icon"> <input class="cdx-text-input__input" type="search" name="search" placeholder="Search Meta" aria-label="Search Meta" autocapitalize="sentences" title="Search Meta [f]" accesskey="f" id="searchInput" > <span class="cdx-text-input__icon cdx-text-input__start-icon"></span> </div> <input type="hidden" name="title" value="Special:Search"> </div> <button class="cdx-button cdx-search-input__end-button">Search</button> </form> </div> </div> </div> <nav class="vector-user-links vector-user-links-wide" aria-label="Personal tools"> <div class="vector-user-links-main"> <div id="p-vector-user-menu-preferences" class="vector-menu mw-portlet" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="ca-uls" class="mw-list-item active user-links-collapsible-item"><a data-mw="interface" href="#" class="uls-trigger cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet"><span class="vector-icon mw-ui-icon-wikimedia-language mw-ui-icon-wikimedia-wikimedia-language"></span> <span>English</span></a> </li> </ul> </div> </div> <div id="p-vector-user-menu-userpage" class="vector-menu mw-portlet emptyPortlet" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> </ul> </div> </div> <nav class="vector-appearance-landmark" aria-label="Appearance"> <div id="vector-appearance-dropdown" class="vector-dropdown " title="Change the appearance of the page's font size, width, and color" > <input type="checkbox" id="vector-appearance-dropdown-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-vector-appearance-dropdown" class="vector-dropdown-checkbox " aria-label="Appearance" > <label id="vector-appearance-dropdown-label" for="vector-appearance-dropdown-checkbox" class="vector-dropdown-label cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet cdx-button--icon-only " aria-hidden="true" ><span class="vector-icon mw-ui-icon-appearance mw-ui-icon-wikimedia-appearance"></span> <span class="vector-dropdown-label-text">Appearance</span> </label> <div class="vector-dropdown-content"> <div id="vector-appearance-unpinned-container" class="vector-unpinned-container"> </div> </div> </div> </nav> <div id="p-vector-user-menu-notifications" class="vector-menu mw-portlet emptyPortlet" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> </ul> </div> </div> <div id="p-vector-user-menu-overflow" class="vector-menu mw-portlet" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="pt-sitesupport-2" class="user-links-collapsible-item mw-list-item user-links-collapsible-item"><a data-mw="interface" href="//donate.wikimedia.org/wiki/Special:FundraiserRedirector?utm_source=donate&utm_medium=sidebar&utm_campaign=C13_meta.wikimedia.org&uselang=en" class=""><span>Donate</span></a> </li> <li id="pt-createaccount-2" class="user-links-collapsible-item mw-list-item user-links-collapsible-item"><a data-mw="interface" href="/w/index.php?title=Special:CreateAccount&returnto=Template%3ACodesample" title="You are encouraged to create an account and log in; however, it is not mandatory" class=""><span>Create account</span></a> </li> <li id="pt-login-2" class="user-links-collapsible-item mw-list-item user-links-collapsible-item"><a data-mw="interface" href="/w/index.php?title=Special:UserLogin&returnto=Template%3ACodesample" title="You are encouraged to log in; however, it is not mandatory [o]" accesskey="o" class=""><span>Log in</span></a> </li> </ul> </div> </div> </div> <div id="vector-user-links-dropdown" class="vector-dropdown vector-user-menu vector-button-flush-right vector-user-menu-logged-out user-links-collapsible-item" title="More options" > <input type="checkbox" id="vector-user-links-dropdown-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-vector-user-links-dropdown" class="vector-dropdown-checkbox " aria-label="Personal tools" > <label id="vector-user-links-dropdown-label" for="vector-user-links-dropdown-checkbox" class="vector-dropdown-label cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet cdx-button--icon-only " aria-hidden="true" ><span class="vector-icon mw-ui-icon-ellipsis mw-ui-icon-wikimedia-ellipsis"></span> <span class="vector-dropdown-label-text">Personal tools</span> </label> <div class="vector-dropdown-content"> <div id="p-personal" class="vector-menu mw-portlet mw-portlet-personal user-links-collapsible-item" title="User menu" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="pt-sitesupport" class="user-links-collapsible-item mw-list-item"><a href="//donate.wikimedia.org/wiki/Special:FundraiserRedirector?utm_source=donate&utm_medium=sidebar&utm_campaign=C13_meta.wikimedia.org&uselang=en"><span>Donate</span></a></li><li id="pt-createaccount" class="user-links-collapsible-item mw-list-item"><a href="/w/index.php?title=Special:CreateAccount&returnto=Template%3ACodesample" title="You are encouraged to create an account and log in; however, it is not mandatory"><span class="vector-icon mw-ui-icon-userAdd mw-ui-icon-wikimedia-userAdd"></span> <span>Create account</span></a></li><li id="pt-login" class="user-links-collapsible-item mw-list-item"><a href="/w/index.php?title=Special:UserLogin&returnto=Template%3ACodesample" title="You are encouraged to log in; however, it is not mandatory [o]" accesskey="o"><span class="vector-icon mw-ui-icon-logIn mw-ui-icon-wikimedia-logIn"></span> <span>Log in</span></a></li> </ul> </div> </div> </div> </div> </nav> </div> </header> </div> <div class="mw-page-container"> <div class="mw-page-container-inner"> <div class="vector-sitenotice-container"> <div id="siteNotice"><!-- CentralNotice --></div> </div> <div class="vector-column-start"> <div class="vector-main-menu-container"> <div id="mw-navigation"> <nav id="mw-panel" class="vector-main-menu-landmark" aria-label="Site"> <div id="vector-main-menu-pinned-container" class="vector-pinned-container"> </div> </nav> </div> </div> </div> <div class="mw-content-container"> <main id="content" class="mw-body"> <header class="mw-body-header vector-page-titlebar"> <h1 id="firstHeading" class="firstHeading mw-first-heading"><span class="mw-page-title-namespace">Template</span><span class="mw-page-title-separator">:</span><span class="mw-page-title-main">Codesample</span></h1> <div id="p-lang-btn" class="vector-dropdown mw-portlet mw-portlet-lang" > <input type="checkbox" id="p-lang-btn-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-p-lang-btn" class="vector-dropdown-checkbox mw-interlanguage-selector" aria-label="This article exist only in this language. Add the article for other languages" > <label id="p-lang-btn-label" for="p-lang-btn-checkbox" class="vector-dropdown-label cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet cdx-button--action-progressive mw-portlet-lang-heading-0" aria-hidden="true" ><span class="vector-icon mw-ui-icon-language-progressive mw-ui-icon-wikimedia-language-progressive"></span> <span class="vector-dropdown-label-text">Add languages</span> </label> <div class="vector-dropdown-content"> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> </ul> <div class="after-portlet after-portlet-lang"><span class="wb-langlinks-add wb-langlinks-link"><a href="https://www.wikidata.org/wiki/Special:NewItem?site=metawiki&page=Template%3ACodesample" title="Add interlanguage links" class="wbc-editpage">Add links</a></span></div> </div> </div> </div> </header> <div class="vector-page-toolbar"> <div class="vector-page-toolbar-container"> <div id="left-navigation"> <nav aria-label="Namespaces"> <div id="p-associated-pages" class="vector-menu vector-menu-tabs mw-portlet mw-portlet-associated-pages" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="ca-nstab-template" class="selected vector-tab-noicon mw-list-item"><a href="/wiki/Template:Codesample" title="View the template [c]" accesskey="c"><span>Template</span></a></li><li id="ca-talk" class="new vector-tab-noicon mw-list-item"><a href="/w/index.php?title=Template_talk:Codesample&action=edit&redlink=1" rel="discussion" class="new" title="Discussion about the content page (page does not exist) [t]" accesskey="t"><span>Discussion</span></a></li> </ul> </div> </div> <div id="vector-variants-dropdown" class="vector-dropdown emptyPortlet" > <input type="checkbox" id="vector-variants-dropdown-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-vector-variants-dropdown" class="vector-dropdown-checkbox " aria-label="Change language variant" > <label id="vector-variants-dropdown-label" for="vector-variants-dropdown-checkbox" class="vector-dropdown-label cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet" aria-hidden="true" ><span class="vector-dropdown-label-text">English</span> </label> <div class="vector-dropdown-content"> <div id="p-variants" class="vector-menu mw-portlet mw-portlet-variants emptyPortlet" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> </ul> </div> </div> </div> </div> </nav> </div> <div id="right-navigation" class="vector-collapsible"> <nav aria-label="Views"> <div id="p-views" class="vector-menu vector-menu-tabs mw-portlet mw-portlet-views" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="ca-view" class="selected vector-tab-noicon mw-list-item"><a href="/wiki/Template:Codesample"><span>Read</span></a></li><li id="ca-edit" class="vector-tab-noicon mw-list-item"><a href="/w/index.php?title=Template:Codesample&action=edit" title="Edit this page [e]" accesskey="e"><span>Edit</span></a></li><li id="ca-history" class="vector-tab-noicon mw-list-item"><a href="/w/index.php?title=Template:Codesample&action=history" title="Past revisions of this page [h]" accesskey="h"><span>View history</span></a></li> </ul> </div> </div> </nav> <nav class="vector-page-tools-landmark" aria-label="Page tools"> <div id="vector-page-tools-dropdown" class="vector-dropdown vector-page-tools-dropdown" > <input type="checkbox" id="vector-page-tools-dropdown-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-vector-page-tools-dropdown" class="vector-dropdown-checkbox " aria-label="Tools" > <label id="vector-page-tools-dropdown-label" for="vector-page-tools-dropdown-checkbox" class="vector-dropdown-label cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet" aria-hidden="true" ><span class="vector-dropdown-label-text">Tools</span> </label> <div class="vector-dropdown-content"> <div id="vector-page-tools-unpinned-container" class="vector-unpinned-container"> <div id="vector-page-tools" class="vector-page-tools vector-pinnable-element"> <div class="vector-pinnable-header vector-page-tools-pinnable-header vector-pinnable-header-unpinned" data-feature-name="page-tools-pinned" data-pinnable-element-id="vector-page-tools" data-pinned-container-id="vector-page-tools-pinned-container" data-unpinned-container-id="vector-page-tools-unpinned-container" > <div class="vector-pinnable-header-label">Tools</div> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-pin-button" data-event-name="pinnable-header.vector-page-tools.pin">move to sidebar</button> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-unpin-button" data-event-name="pinnable-header.vector-page-tools.unpin">hide</button> </div> <div id="p-cactions" class="vector-menu mw-portlet mw-portlet-cactions emptyPortlet vector-has-collapsible-items" title="More options" > <div class="vector-menu-heading"> Actions </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="ca-more-view" class="selected vector-more-collapsible-item mw-list-item"><a href="/wiki/Template:Codesample"><span>Read</span></a></li><li id="ca-more-edit" class="vector-more-collapsible-item mw-list-item"><a href="/w/index.php?title=Template:Codesample&action=edit" title="Edit this page [e]" accesskey="e"><span>Edit</span></a></li><li id="ca-more-history" class="vector-more-collapsible-item mw-list-item"><a href="/w/index.php?title=Template:Codesample&action=history"><span>View history</span></a></li> </ul> </div> </div> <div id="p-tb" class="vector-menu mw-portlet mw-portlet-tb" > <div class="vector-menu-heading"> General </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="t-whatlinkshere" class="mw-list-item"><a href="/wiki/Special:WhatLinksHere/Template:Codesample" title="A list of all wiki pages that link here [j]" accesskey="j"><span>What links here</span></a></li><li id="t-recentchangeslinked" class="mw-list-item"><a href="/wiki/Special:RecentChangesLinked/Template:Codesample" rel="nofollow" title="Recent changes in pages linked from this page [k]" accesskey="k"><span>Related changes</span></a></li><li id="t-specialpages" class="mw-list-item"><a href="/wiki/Special:SpecialPages" title="A list of all special pages [q]" accesskey="q"><span>Special pages</span></a></li><li id="t-permalink" class="mw-list-item"><a href="/w/index.php?title=Template:Codesample&oldid=22425622" title="Permanent link to this revision of this page"><span>Permanent link</span></a></li><li id="t-info" class="mw-list-item"><a href="/w/index.php?title=Template:Codesample&action=info" title="More information about this page"><span>Page information</span></a></li><li id="t-urlshortener" class="mw-list-item"><a href="/w/index.php?title=Special:UrlShortener&url=https%3A%2F%2Fmeta.wikimedia.org%2Fwiki%2FTemplate%3ACodesample"><span>Get shortened URL</span></a></li><li id="t-urlshortener-qrcode" class="mw-list-item"><a href="/w/index.php?title=Special:QrCode&url=https%3A%2F%2Fmeta.wikimedia.org%2Fwiki%2FTemplate%3ACodesample"><span>Download QR code</span></a></li> </ul> </div> </div> <div id="p-electronpdfservice-sidebar-portlet-heading" class="vector-menu mw-portlet mw-portlet-electronpdfservice-sidebar-portlet-heading" > <div class="vector-menu-heading"> Print/export </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="electron-print_pdf" class="mw-list-item"><a href="/w/index.php?title=Special:DownloadAsPdf&page=Template%3ACodesample&action=show-download-screen"><span>Download as PDF</span></a></li><li id="t-print" class="mw-list-item"><a href="javascript:print();" rel="alternate" title="Printable version of this page [p]" accesskey="p"><span>Printable version</span></a></li> </ul> </div> </div> <div id="p-wikibase-otherprojects" class="vector-menu mw-portlet mw-portlet-wikibase-otherprojects emptyPortlet" > <div class="vector-menu-heading"> In other projects </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> </ul> </div> </div> </div> </div> </div> </div> </nav> </div> </div> </div> <div class="vector-column-end"> <div class="vector-sticky-pinned-container"> <nav class="vector-page-tools-landmark" aria-label="Page tools"> <div id="vector-page-tools-pinned-container" class="vector-pinned-container"> </div> </nav> <nav class="vector-appearance-landmark" aria-label="Appearance"> <div id="vector-appearance-pinned-container" class="vector-pinned-container"> <div id="vector-appearance" class="vector-appearance vector-pinnable-element"> <div class="vector-pinnable-header vector-appearance-pinnable-header vector-pinnable-header-pinned" data-feature-name="appearance-pinned" data-pinnable-element-id="vector-appearance" data-pinned-container-id="vector-appearance-pinned-container" data-unpinned-container-id="vector-appearance-unpinned-container" > <div class="vector-pinnable-header-label">Appearance</div> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-pin-button" data-event-name="pinnable-header.vector-appearance.pin">move to sidebar</button> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-unpin-button" data-event-name="pinnable-header.vector-appearance.unpin">hide</button> </div> </div> </div> </nav> </div> </div> <div id="bodyContent" class="vector-body" aria-labelledby="firstHeading" data-mw-ve-target-container> <div class="vector-body-before-content"> <div class="mw-indicators"> </div> <div id="siteSub" class="noprint">From Meta, a Wikimedia project coordination wiki</div> </div> <div id="contentSub"><div id="mw-content-subtitle"></div></div> <div id="mw-content-text" class="mw-body-content"><div class="mw-content-ltr mw-parser-output" lang="en" dir="ltr"><div class="wt-codesample-wrapper wt-codesample-noscheme"> <style data-mw-deduplicate="TemplateStyles:r22425594">.mw-parser-output .wt-codesample-wrapper{margin:1em 0}.mw-parser-output .wt-codesample-header{display:flex}.mw-parser-output .wt-codesample-header div{border-color:#c8ccd1;border-style:solid;border-width:0}.mw-parser-output .wt-codesample-header .wt-codesample-title{font-weight:bold;padding:.5em 1em;border-width:1px 1px 0 1px;border-radius:.5em .5em 0 0}.mw-parser-output .wt-codesample-header .wt-codesample-fill{border-width:0 0 1px 0;flex:2}.mw-parser-output .wt-codesample-wrapper pre{font-family:"Source Code Pro",Menlo,Consolas,Monaco,"Lucida Console","Liberation Mono","DejaVu Sans Mono","Bitstream Vera Sans Mono","Courier New",monospace,monspace;margin:0}.mw-parser-output .wt-codesample-header+.mw-highlight pre{border-top:none}</style> <p><br /> </p> <div class="mw-highlight mw-highlight-lang-bash mw-content-ltr" dir="ltr"></div> </div><style data-mw-deduplicate="TemplateStyles:r27252648">.mw-parser-output .ts-doc-sandbox .mbox-image{padding:.75em 0 .75em .75em}.mw-parser-output .ts-doc-doc{clear:both;background-color:#ecfcf4;border:1px solid #a2a9b1;margin-top:1em;padding:5px}.mw-parser-output .ts-doc-header{padding-bottom:3px;border-bottom:1px solid #a2a9b1;margin-bottom:1ex}.mw-parser-output .ts-doc-header .ts-tlinks-tlinks{display:inline-block;line-height:24px;margin-left:1em}.mw-parser-output .ts-doc-header .ts-tlinks-tlinks a.external{color:#0645ad}.mw-parser-output .ts-doc-header .ts-tlinks-tlinks a.external:visited{color:#0b0080}.mw-parser-output .ts-doc-header .ts-tlinks-tlinks a.external:active{color:#faa700}.mw-parser-output .ts-doc-content:after{content:"";clear:both;display:block}.mw-parser-output .ts-doc-heading{display:inline-block;padding-left:55px;background:center left/50px no-repeat;background-image:url("https://upload.wikimedia.org/wikipedia/commons/thumb/4/43/Test_Template_Info-Icon_-_Version_%282%29.svg/50px-Test_Template_Info-Icon_-_Version_%282%29.svg.png");background-image:url("https://upload.wikimedia.org/wikipedia/commons/4/43/Test_Template_Info-Icon_-_Version_%282%29.svg");font-size:1.5em}.mw-parser-output .ts-doc-content>*:first-child,.mw-parser-output .ts-doc-footer>*:first-child{margin-top:.5em}.mw-parser-output .ts-doc-content>*:last-child,.mw-parser-output .ts-doc-footer>*:last-child{margin-bottom:.5em}.mw-parser-output .ts-doc-footer{background-color:#ecfcf4;border:1px solid #a2a9b1;padding:.25em 1em;margin-top:.2em;font-style:italic}.mw-parser-output .ts-doc-footer small{font-style:normal}.mw-parser-output .ts-doc-sandbox{clear:both}@media screen{html.skin-theme-clientpref-night .mw-parser-output .ts-doc-footer,html.skin-theme-clientpref-night .mw-parser-output .ts-doc-doc{background-color:transparent}}@media screen and (prefers-color-scheme:dark){html.skin-theme-clientpref-os .mw-parser-output .ts-doc-footer,html.skin-theme-clientpref-os .mw-parser-output .ts-doc-doc{background-color:transparent}}.mw-parser-output .ts-doc-content .mw-headline{color:#222}.mw-parser-output .mw-templatedata-caption,.mw-parser-output .mw-templatedata-format{color:#222}.mw-parser-output .mw-templatedata-doc-params .oo-ui-widget{filter:unset!important}</style><div id="template-documentation" class="ts-doc-doc"><div class="ts-doc-header"><div class="ts-doc-heading">Template documentation</div><div class="ts-tlinks-tlinks mw-editsection-like plainlinks" id="doc_editlinks">[<a href="/wiki/Template:Codesample/doc" title="Template:Codesample/doc">view</a>] [<a class="external text" href="https://meta.wikimedia.org/w/index.php?title=Template:Codesample/doc&action=edit">edit</a>] [<a class="external text" href="https://meta.wikimedia.org/w/index.php?title=Template:Codesample/doc&action=history">history</a>] [<a class="external text" href="https://meta.wikimedia.org/w/index.php?title=Template:Codesample&action=purge">purge</a>]</div></div><div class="ts-doc-content"> <style data-mw-deduplicate="TemplateStyles:r27362704">.mw-parser-output .ombox{margin:4px 0;border-collapse:collapse;border:1px solid #a2a9b1;background-color:var(--background-color-neutral-subtle,#f8f9fa);box-sizing:border-box;color:var(--color-base,#202122)}.mw-parser-output .ombox.mbox-small{font-size:88%;line-height:1.25em}.mw-parser-output .ombox-speedy{border:2px solid #b32424;background-color:#fee7e6}.mw-parser-output .ombox-delete{border:2px solid #b32424}.mw-parser-output .ombox-content{border:1px solid #f28500}.mw-parser-output .ombox-style{border:1px solid #fc3}.mw-parser-output .ombox-move{border:1px solid #9932cc}.mw-parser-output .ombox-protection{border:2px solid #a2a9b1}.mw-parser-output .ombox .mbox-text{border:none;padding:0.25em 0.9em;width:100%}.mw-parser-output .ombox .mbox-image{border:none;padding:2px 0 2px 0.9em;text-align:center}.mw-parser-output .ombox .mbox-imageright{border:none;padding:2px 0.9em 2px 0;text-align:center}.mw-parser-output .ombox .mbox-empty-cell{border:none;padding:0;width:1px}.mw-parser-output .ombox .mbox-invalid-type{text-align:center}@media(min-width:720px){.mw-parser-output .ombox{margin:4px 10%}.mw-parser-output .ombox.mbox-small{clear:right;float:right;margin:4px 0 4px 1em;width:238px}}body.skin--responsive .mw-parser-output table.ombox img{max-width:none!important}@media screen{html.skin-theme-clientpref-night .mw-parser-output .ombox-speedy{background-color:#310402}}@media screen and (prefers-color-scheme:dark){html.skin-theme-clientpref-os .mw-parser-output .ombox-speedy{background-color:#310402}}</style><table class="plainlinks ombox mbox-small ombox-notice" role="presentation"><tbody><tr><td class="mbox-image"><span typeof="mw:File"><a href="/wiki/File:Farm-Fresh_css_add.svg" class="mw-file-description"><img alt="CSS" src="//upload.wikimedia.org/wikipedia/commons/thumb/a/a6/Farm-Fresh_css_add.svg/32px-Farm-Fresh_css_add.svg.png" decoding="async" width="32" height="27" class="mw-file-element" srcset="//upload.wikimedia.org/wikipedia/commons/thumb/a/a6/Farm-Fresh_css_add.svg/48px-Farm-Fresh_css_add.svg.png 1.5x, //upload.wikimedia.org/wikipedia/commons/thumb/a/a6/Farm-Fresh_css_add.svg/64px-Farm-Fresh_css_add.svg.png 2x" data-file-width="142" data-file-height="121" /></a></span></td><td class="mbox-text">This template uses <a href="https://www.mediawiki.org/wiki/Help:TemplateStyles" class="extiw" title="mw:Help:TemplateStyles">TemplateStyles</a>: <div><ul><li><a href="/wiki/Template:Codesample/style.css" title="Template:Codesample/style.css">Template:Codesample/style.css</a></li><li><a href="/wiki/Template:Codesample/light.css" title="Template:Codesample/light.css">Template:Codesample/light.css</a></li><li><a href="/wiki/Template:Codesample/dark.css" title="Template:Codesample/dark.css">Template:Codesample/dark.css</a></li></ul></div></td></tr></tbody></table> <div class="templatedata-header">This is the <a href="https://en.wikipedia.org/wiki/TemplateData" class="extiw" title="wikipedia:TemplateData">TemplateData</a> for this template used by <a href="https://www.mediawiki.org/wiki/Extension:TemplateWizard" class="extiw" title="mw:Extension:TemplateWizard">TemplateWizard</a>, <a href="https://en.wikipedia.org/wiki/VisualEditor" class="extiw" title="wikipedia:VisualEditor">VisualEditor</a> and other tools. <p><b>TemplateData for Codesample</b> </p> </div> <section class="mw-templatedata-doc-wrap"><header><p class="mw-templatedata-doc-desc"><syntaxhighlight> with fancy colors and an optional title</p></header><table class="wikitable mw-templatedata-doc-params sortable"><caption><p class="mw-templatedata-caption">Template parameters<span class="mw-editsection-like"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Template:Codesample/doc&action=edit&templatedata=edit" title="Template:Codesample/doc">Edit template data</a><span class="mw-editsection-bracket">]</span></span></p><p><span class="oo-ui-widget oo-ui-widget-enabled oo-ui-iconElement-icon oo-ui-icon-template-format-block oo-ui-iconElement oo-ui-labelElement-invisible oo-ui-iconWidget"></span><span class="mw-templatedata-format">This template prefers block formatting of parameters.</span></p></caption><thead><tr><th colspan="2">Parameter</th><th>Description</th><th>Type</th><th>Status</th></tr></thead><tbody><tr><th>Code</th><td class="mw-templatedata-doc-param-name"><code>code</code> <code class="mw-templatedata-doc-param-alias">1</code></td><td><p>Code sample to render</p><dl></dl></td><td class="mw-templatedata-doc-param-type">String</td><td class="mw-templatedata-doc-param-status-required" data-sort-value="2">required</td></tr><tr><th>Programming language</th><td class="mw-templatedata-doc-param-name"><code>lang</code></td><td><p>Name of lexer to use for highlighting</p><dl><dt>Default</dt><dd>text</dd><dt>Example</dt><dd>shell-session</dd></dl></td><td class="mw-templatedata-doc-param-type">String</td><td class="mw-templatedata-doc-param-status-suggested" data-sort-value="1">suggested</td></tr><tr><th>Title</th><td class="mw-templatedata-doc-param-name"><code>name</code></td><td><p>Title (name) of this code sample. Often a filename</p><dl></dl></td><td class="mw-templatedata-doc-param-type">String</td><td class="mw-templatedata-doc-param-status-suggested" data-sort-value="1">suggested</td></tr><tr><th>Highlighted lines</th><td class="mw-templatedata-doc-param-name"><code>highlight</code></td><td><p>Line(s) in example to highlight. Comma separated list of line numbers</p><dl></dl></td><td class="mw-templatedata-doc-param-type">String</td><td class="mw-templatedata-doc-param-status-optional" data-sort-value="0">optional</td></tr><tr><th>Show line numbers</th><td class="mw-templatedata-doc-param-name"><code>line</code></td><td><p>Enable line numbers for sample</p><dl></dl></td><td class="mw-templatedata-doc-param-type">Boolean</td><td class="mw-templatedata-doc-param-status-optional" data-sort-value="0">optional</td></tr><tr><th>Starting line number</th><td class="mw-templatedata-doc-param-name"><code>start</code></td><td><p>Starting line number when line numbers are shown. Note: Does not effect line numbers used for highlights.</p><dl><dt>Default</dt><dd>1</dd></dl></td><td class="mw-templatedata-doc-param-type">Number</td><td class="mw-templatedata-doc-param-status-optional" data-sort-value="0">optional</td></tr><tr><th>Color scheme</th><td class="mw-templatedata-doc-param-name"><code>scheme</code></td><td><p>Color scheme to use. "dark" and "light" will apply solarized color schemes. Anything else will use syntaxhighlight extension defaults.</p><dl></dl></td><td class="mw-templatedata-doc-param-type">String</td><td class="mw-templatedata-doc-param-status-optional" data-sort-value="0">optional</td></tr></tbody></table></section> <div class="wt-codesample-wrapper wt-codesample-noscheme"> <link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r22425594"> <p><br /> </p> <div class="mw-highlight mw-highlight-lang-bash mw-content-ltr" dir="ltr"><pre><span></span><span class="nb">echo</span><span class="w"> </span><span class="s2">"hello world!"</span> </pre></div> </div> <div class="wt-codesample-wrapper wt-codesample-light"> <link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r22425594"> <style data-mw-deduplicate="TemplateStyles:r22425608">.mw-parser-output .wt-codesample-light .wt-codesample-title{color:#586e75;background:#eee8d5}.mw-parser-output .wt-codesample-light .wt-codesample-header div{border-color:#657b83}.mw-parser-output .wt-codesample-light pre{color:#657b83;background-color:#fdf6e3;border-color:#657b83}.mw-parser-output .wt-codesample-light .lineno{color:#586e75}.mw-parser-output .wt-codesample-light .hll{background-color:#ffffcc}.mw-parser-output .wt-codesample-light .c{color:#93a1a1;font-style:italic}.mw-parser-output .wt-codesample-light .err{color:#dc322f}.mw-parser-output .wt-codesample-light .g{color:#657b83}.mw-parser-output .wt-codesample-light .k{color:#859900}.mw-parser-output .wt-codesample-light .l{color:#657b83}.mw-parser-output .wt-codesample-light .n{color:#586e75}.mw-parser-output .wt-codesample-light .o{color:#657b83}.mw-parser-output .wt-codesample-light .x{color:#657b83}.mw-parser-output .wt-codesample-light .p{color:#657b83}.mw-parser-output .wt-codesample-light .ch{color:#93a1a1;font-style:italic}.mw-parser-output .wt-codesample-light .cm{color:#93a1a1;font-style:italic}.mw-parser-output .wt-codesample-light .cp{color:#93a1a1;font-style:italic}.mw-parser-output .wt-codesample-light .cpf{color:#93a1a1;font-style:italic}.mw-parser-output .wt-codesample-light .c1{color:#93a1a1;font-style:italic}.mw-parser-output .wt-codesample-light .cs{color:#93a1a1;font-style:italic}.mw-parser-output .wt-codesample-light .gd{color:#657b83}.mw-parser-output .wt-codesample-light .ge{color:#657b83}.mw-parser-output .wt-codesample-light .gr{color:#657b83}.mw-parser-output .wt-codesample-light .gh{color:#657b83}.mw-parser-output .wt-codesample-light .gi{color:#657b83}.mw-parser-output .wt-codesample-light .go{color:#657b83}.mw-parser-output .wt-codesample-light .gp{color:#657b83}.mw-parser-output .wt-codesample-light .gs{color:#657b83}.mw-parser-output .wt-codesample-light .gu{color:#657b83}.mw-parser-output .wt-codesample-light .gt{color:#657b83}.mw-parser-output .wt-codesample-light .kc{color:#859900}.mw-parser-output .wt-codesample-light .kd{color:#859900}.mw-parser-output .wt-codesample-light .kn{color:#cb4b16}.mw-parser-output .wt-codesample-light .kp{color:#cb4b16}.mw-parser-output .wt-codesample-light .kr{color:#859900}.mw-parser-output .wt-codesample-light .kt{color:#859900}.mw-parser-output .wt-codesample-light .ld{color:#657b83}.mw-parser-output .wt-codesample-light .m{color:#2aa198}.mw-parser-output .wt-codesample-light .s{color:#2aa198}.mw-parser-output .wt-codesample-light .na{color:#657b83}.mw-parser-output .wt-codesample-light .nb{color:#268bd2}.mw-parser-output .wt-codesample-light .nc{color:#268bd2}.mw-parser-output .wt-codesample-light .no{color:#b58900}.mw-parser-output .wt-codesample-light .nd{color:#cb4b16}.mw-parser-output .wt-codesample-light .ni{color:#cb4b16}.mw-parser-output .wt-codesample-light .ne{color:#cb4b16}.mw-parser-output .wt-codesample-light .nf{color:#268bd2}.mw-parser-output .wt-codesample-light .nl{color:#657b83}.mw-parser-output .wt-codesample-light .nn{color:#b58900}.mw-parser-output .wt-codesample-light .nx{color:#657b83}.mw-parser-output .wt-codesample-light .py{color:#268bd2}.mw-parser-output .wt-codesample-light .nt{color:#859900}.mw-parser-output .wt-codesample-light .nv{color:#cb4b16}.mw-parser-output .wt-codesample-light .ow{color:#859900}.mw-parser-output .wt-codesample-light .w{color:#fdf6e3}.mw-parser-output .wt-codesample-light .mb{color:#2aa198}.mw-parser-output .wt-codesample-light .mf{color:#2aa198}.mw-parser-output .wt-codesample-light .mh{color:#2aa198}.mw-parser-output .wt-codesample-light .mi{color:#2aa198}.mw-parser-output .wt-codesample-light .mo{color:#2aa198}.mw-parser-output .wt-codesample-light .sa{color:#2aa198}.mw-parser-output .wt-codesample-light .sb{color:#2aa198}.mw-parser-output .wt-codesample-light .sc{color:#2aa198}.mw-parser-output .wt-codesample-light .dl{color:#2aa198}.mw-parser-output .wt-codesample-light .sd{color:#2aa198}.mw-parser-output .wt-codesample-light .s2{color:#2aa198}.mw-parser-output .wt-codesample-light .se{color:#cb4b16}.mw-parser-output .wt-codesample-light .sh{color:#2aa198}.mw-parser-output .wt-codesample-light .si{color:#cb4b16}.mw-parser-output .wt-codesample-light .sx{color:#2aa198}.mw-parser-output .wt-codesample-light .sr{color:#2aa198}.mw-parser-output .wt-codesample-light .s1{color:#2aa198}.mw-parser-output .wt-codesample-light .ss{color:#2aa198}.mw-parser-output .wt-codesample-light .bp{color:#268bd2;font-weight:bold}.mw-parser-output .wt-codesample-light .fm{color:#268bd2}.mw-parser-output .wt-codesample-light .vc{color:#268bd2}.mw-parser-output .wt-codesample-light .vg{color:#268bd2}.mw-parser-output .wt-codesample-light .vi{color:#268bd2}.mw-parser-output .wt-codesample-light .vm{color:#cb4b16}.mw-parser-output .wt-codesample-light .il{color:#2aa198}</style> <div class="mw-highlight mw-highlight-lang-text mw-content-ltr" dir="ltr"><pre><span></span>echo "hello world!" </pre></div> </div> <div class="wt-codesample-wrapper wt-codesample-dark"> <link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r22425594"> <style data-mw-deduplicate="TemplateStyles:r22425617">.mw-parser-output .wt-codesample-dark .wt-codesample-title{color:#93a1a1;background:#073642}.mw-parser-output .wt-codesample-dark .wt-codesample-header div{border-color:#839496}.mw-parser-output .wt-codesample-dark pre{color:#839496;background-color:#002b36;border-color:#839496}.mw-parser-output .wt-codesample-dark .lineno{color:#93a1a1}.mw-parser-output .wt-codesample-dark .hll{background-color:#ffffcc}.mw-parser-output .wt-codesample-dark .c{color:#586e75;font-style:italic}.mw-parser-output .wt-codesample-dark .err{color:#dc322f}.mw-parser-output .wt-codesample-dark .g{color:#839496}.mw-parser-output .wt-codesample-dark .k{color:#859900}.mw-parser-output .wt-codesample-dark .l{color:#839496}.mw-parser-output .wt-codesample-dark .n{color:#93a1a1}.mw-parser-output .wt-codesample-dark .o{color:#839496}.mw-parser-output .wt-codesample-dark .x{color:#839496}.mw-parser-output .wt-codesample-dark .p{color:#839496}.mw-parser-output .wt-codesample-dark .ch{color:#586e75;font-style:italic}.mw-parser-output .wt-codesample-dark .cm{color:#586e75;font-style:italic}.mw-parser-output .wt-codesample-dark .cp{color:#586e75;font-style:italic}.mw-parser-output .wt-codesample-dark .cpf{color:#586e75;font-style:italic}.mw-parser-output .wt-codesample-dark .c1{color:#586e75;font-style:italic}.mw-parser-output .wt-codesample-dark .cs{color:#586e75;font-style:italic}.mw-parser-output .wt-codesample-dark .gd{color:#839496}.mw-parser-output .wt-codesample-dark .ge{color:#839496}.mw-parser-output .wt-codesample-dark .gr{color:#839496}.mw-parser-output .wt-codesample-dark .gh{color:#839496}.mw-parser-output .wt-codesample-dark .gi{color:#839496}.mw-parser-output .wt-codesample-dark .go{color:#839496}.mw-parser-output .wt-codesample-dark .gp{color:#839496}.mw-parser-output .wt-codesample-dark .gs{color:#839496}.mw-parser-output .wt-codesample-dark .gu{color:#839496}.mw-parser-output .wt-codesample-dark .gt{color:#839496}.mw-parser-output .wt-codesample-dark .kc{color:#859900}.mw-parser-output .wt-codesample-dark .kd{color:#859900}.mw-parser-output .wt-codesample-dark .kn{color:#cb4b16}.mw-parser-output .wt-codesample-dark .kp{color:#cb4b16}.mw-parser-output .wt-codesample-dark .kr{color:#859900}.mw-parser-output .wt-codesample-dark .kt{color:#859900}.mw-parser-output .wt-codesample-dark .ld{color:#839496}.mw-parser-output .wt-codesample-dark .m{color:#2aa198}.mw-parser-output .wt-codesample-dark .s{color:#2aa198}.mw-parser-output .wt-codesample-dark .na{color:#839496}.mw-parser-output .wt-codesample-dark .nb{color:#268bd2}.mw-parser-output .wt-codesample-dark .nc{color:#268bd2}.mw-parser-output .wt-codesample-dark .no{color:#b58900}.mw-parser-output .wt-codesample-dark .nd{color:#cb4b16}.mw-parser-output .wt-codesample-dark .ni{color:#cb4b16}.mw-parser-output .wt-codesample-dark .ne{color:#cb4b16}.mw-parser-output .wt-codesample-dark .nf{color:#268bd2}.mw-parser-output .wt-codesample-dark .nl{color:#839496}.mw-parser-output .wt-codesample-dark .nn{color:#b58900}.mw-parser-output .wt-codesample-dark .nx{color:#839496}.mw-parser-output .wt-codesample-dark .py{color:#268bd2}.mw-parser-output .wt-codesample-dark .nt{color:#859900}.mw-parser-output .wt-codesample-dark .nv{color:#cb4b16}.mw-parser-output .wt-codesample-dark .ow{color:#859900}.mw-parser-output .wt-codesample-dark .w{color:#002b36}.mw-parser-output .wt-codesample-dark .mb{color:#2aa198}.mw-parser-output .wt-codesample-dark .mf{color:#2aa198}.mw-parser-output .wt-codesample-dark .mh{color:#2aa198}.mw-parser-output .wt-codesample-dark .mi{color:#2aa198}.mw-parser-output .wt-codesample-dark .mo{color:#2aa198}.mw-parser-output .wt-codesample-dark .sa{color:#2aa198}.mw-parser-output .wt-codesample-dark .sb{color:#2aa198}.mw-parser-output .wt-codesample-dark .sc{color:#2aa198}.mw-parser-output .wt-codesample-dark .dl{color:#2aa198}.mw-parser-output .wt-codesample-dark .sd{color:#2aa198}.mw-parser-output .wt-codesample-dark .s2{color:#2aa198}.mw-parser-output .wt-codesample-dark .se{color:#cb4b16}.mw-parser-output .wt-codesample-dark .sh{color:#2aa198}.mw-parser-output .wt-codesample-dark .si{color:#cb4b16}.mw-parser-output .wt-codesample-dark .sx{color:#2aa198}.mw-parser-output .wt-codesample-dark .sr{color:#2aa198}.mw-parser-output .wt-codesample-dark .s1{color:#2aa198}.mw-parser-output .wt-codesample-dark .ss{color:#2aa198}.mw-parser-output .wt-codesample-dark .bp{color:#268bd2;font-weight:bold}.mw-parser-output .wt-codesample-dark .fm{color:#268bd2}.mw-parser-output .wt-codesample-dark .vc{color:#268bd2}.mw-parser-output .wt-codesample-dark .vg{color:#268bd2}.mw-parser-output .wt-codesample-dark .vi{color:#268bd2}.mw-parser-output .wt-codesample-dark .vm{color:#cb4b16}.mw-parser-output .wt-codesample-dark .il{color:#2aa198}</style> <div class="mw-highlight mw-highlight-lang-shell-session mw-content-ltr" dir="ltr"><pre><span></span><span class="gp">$ </span><span class="nb">echo</span><span class="w"> </span><span class="s2">"hello world!"</span> </pre></div> </div> <div class="wt-codesample-wrapper wt-codesample-noscheme"> <link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r22425594"> <p><br /> </p> <div class="mw-highlight mw-highlight-lang-moin mw-content-ltr" dir="ltr"><pre><span></span>{{Codesample}} </pre></div> </div> <div class="wt-codesample-wrapper wt-codesample-dark"> <link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r22425594"> <link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r22425617"> <div class="wt-codesample-header"><div class="wt-codesample-title">ingress.yaml</div><div class="wt-codesample-fill"></div></div> <div class="mw-highlight mw-highlight-lang-yaml mw-content-ltr mw-highlight-lines" dir="ltr"><pre><span></span><span class="linenos" data-line="1"></span><span class="nn">---</span> <span class="linenos" data-line="2"></span><span class="nt">apiVersion</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">networking.k8s.io/v1beta1</span> <span class="linenos" data-line="3"></span><span class="nt">kind</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Ingress</span> <span class="linenos" data-line="4"></span><span class="nt">metadata</span><span class="p">:</span> <span class="hll"><span class="linenos" data-line="5"></span><span class="w"> </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">foo-redirect</span> </span><span class="linenos" data-line="6"></span><span class="w"> </span><span class="nt">namespace</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">tool-foo</span> <span class="linenos" data-line="7"></span><span class="w"> </span><span class="nt">labels</span><span class="p">:</span> <span class="hll"><span class="linenos" data-line="8"></span><span class="w"> </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">foo-redirect</span> </span><span class="linenos" data-line="9"></span><span class="w"> </span><span class="nt">annotations</span><span class="p">:</span> <span class="linenos" data-line="10"></span><span class="w"> </span><span class="nt">kubernetes.io/ingress.class</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">nginx</span> <span class="linenos" data-line="11"></span><span class="w"> </span><span class="nt">nginx.ingress.kubernetes.io/permanent-redirect</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">https://bar.toolforge.org/$1$is_args$args</span> <span class="linenos" data-line="12"></span><span class="nt">spec</span><span class="p">:</span> <span class="linenos" data-line="13"></span><span class="w"> </span><span class="nt">rules</span><span class="p">:</span> <span class="linenos" data-line="14"></span><span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">host</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">foo.toolforge.org</span> <span class="linenos" data-line="15"></span><span class="w"> </span><span class="nt">http</span><span class="p">:</span> <span class="linenos" data-line="16"></span><span class="w"> </span><span class="nt">paths</span><span class="p">:</span> <span class="linenos" data-line="17"></span><span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">backend</span><span class="p">:</span> <span class="linenos" data-line="18"></span><span class="w"> </span><span class="nt">serviceName</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">unused</span> <span class="linenos" data-line="19"></span><span class="w"> </span><span class="nt">servicePort</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">8000</span> <span class="linenos" data-line="20"></span><span class="w"> </span><span class="nt">path</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">/(.*)</span> </pre></div> </div> <div class="wt-codesample-wrapper wt-codesample-light"> <link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r22425594"> <link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r22425608"> <div class="wt-codesample-header"><div class="wt-codesample-title">metadata</div><div class="wt-codesample-fill"></div></div> <div class="mw-highlight mw-highlight-lang-yaml mw-content-ltr mw-highlight-lines" dir="ltr"><pre><span></span><span class="hll"><span class="linenos" data-line="5"></span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">foo-redirect</span> </span><span class="linenos" data-line="6"></span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">namespace</span><span class="p p-Indicator">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">tool-foo</span> <span class="linenos" data-line="7"></span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">labels</span><span class="p p-Indicator">:</span> <span class="hll"><span class="linenos" data-line="8"></span><span class="w"> </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">foo-redirect</span> </span><span class="linenos" data-line="9"></span><span class="w w-Error"> </span><span class="nt">annotations</span><span class="p">:</span> <span class="linenos" data-line="10"></span><span class="w"> </span><span class="nt">kubernetes.io/ingress.class</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">nginx</span> <span class="linenos" data-line="11"></span><span class="w"> </span><span class="nt">nginx.ingress.kubernetes.io/permanent-redirect</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">https://bar.toolforge.org/$1$is_args$args</span> </pre></div> </div> </div></div><div class="ts-doc-footer plainlinks">The above <a href="https://en.wikipedia.org/wiki/Wikipedia:Template_documentation" class="extiw" title="wikipedia:Wikipedia:Template documentation">documentation</a> is <a href="https://en.wikipedia.org/wiki/Wikipedia:Transclusion" class="extiw" title="wikipedia:Wikipedia:Transclusion">transcluded</a> from <a href="/wiki/Template:Codesample/doc" title="Template:Codesample/doc">Template:Codesample/doc</a>. <small>(<a class="external text" href="https://meta.wikimedia.org/w/index.php?title=Template:Codesample/doc&action=edit">edit</a> | <a class="external text" href="https://meta.wikimedia.org/w/index.php?title=Template:Codesample/doc&action=history">history</a>)</small><br />Editors can experiment in this template’s sandbox <small>(<a class="external text" href="https://meta.wikimedia.org/w/index.php?title=Template:Codesample/sandbox&action=edit&preload=Template%3ADocumentation%2Fpreload-sandbox">create</a> | <a class="external text" href="https://meta.wikimedia.org/w/index.php?title=Template:Codesample/sandbox&preload=Template%3ADocumentation%2Fmirror&action=edit&summary=Create+sandbox+version+of+%5B%5BTemplate%3ACodesample%5D%5D">mirror</a>)</small> and testcases <small>(<a class="external text" href="https://meta.wikimedia.org/w/index.php?title=Template:Codesample/testcases&action=edit&preload=Template%3ADocumentation%2Fpreload-testcases">create</a>)</small> pages.<br />Please add categories to the <a href="/wiki/Template:Codesample/doc" title="Template:Codesample/doc">/doc</a> subpage. <a href="/wiki/Special:PrefixIndex/Template:Codesample/" title="Special:PrefixIndex/Template:Codesample/">Subpages of this template</a>.</div> <!-- NewPP limit report Parsed by mw‐web.eqiad.main‐68b5f87cfc‐zcn96 Cached time: 20241118151424 Cache expiry: 2592000 Reduced expiry: false Complications: [vary‐revision‐sha1] CPU time usage: 0.255 seconds Real time usage: 0.825 seconds Preprocessor visited node count: 410/1000000 Post‐expand include size: 11864/2097152 bytes Template argument size: 1037/2097152 bytes Highest expansion depth: 11/100 Expensive parser function count: 18/500 Unstrip recursion depth: 0/20 Unstrip post‐expand size: 39013/5000000 bytes Lua time usage: 0.203/10.000 seconds Lua memory usage: 1325939/52428800 bytes Number of Wikibase entities loaded: 0/400 --> <!-- Transclusion expansion time report (%,ms,calls,template) 100.00% 654.587 1 Template:Documentation 100.00% 654.587 1 -total 73.63% 481.967 6 Template:Codesample 7.71% 50.480 1 Template:Uses_TemplateStyles 1.36% 8.931 1 Template:Documentation_subpage 1.29% 8.425 1 Template:TemplateData_header 1.20% 7.834 1 Template:Sandbox_other 0.92% 6.039 1 Template:IsDocSubpage 0.43% 2.792 1 Template:Template_other 0.26% 1.670 1 Template:Str_left --> <!-- Saved in parser cache with key metawiki:pcache:idhash:11622091-0!canonical and timestamp 20241118151424 and revision id 22425622. Rendering was triggered because: page-view --> </div><!--esi <esi:include src="/esitest-fa8a495983347898/content" /> --><noscript><img src="https://login.wikimedia.org/wiki/Special:CentralAutoLogin/start?type=1x1" alt="" width="1" height="1" style="border: none; position: absolute;"></noscript> <div class="printfooter" data-nosnippet="">Retrieved from "<a dir="ltr" href="https://meta.wikimedia.org/w/index.php?title=Template:Codesample&oldid=22425622">https://meta.wikimedia.org/w/index.php?title=Template:Codesample&oldid=22425622</a>"</div></div> <div id="catlinks" class="catlinks" data-mw="interface"><div id="mw-normal-catlinks" class="mw-normal-catlinks"><a href="/wiki/Special:Categories" title="Special:Categories">Categories</a>: <ul><li><a href="/wiki/Category:Templates_using_TemplateStyles" title="Category:Templates using TemplateStyles">Templates using TemplateStyles</a></li><li><a href="/wiki/Category:Templates" title="Category:Templates">Templates</a></li></ul></div><div id="mw-hidden-catlinks" class="mw-hidden-catlinks mw-hidden-cats-hidden">Hidden category: <ul><li><a href="/wiki/Category:Pages_using_the_JsonConfig_extension" title="Category:Pages using the JsonConfig extension">Pages using the JsonConfig extension</a></li></ul></div></div> </div> </main> </div> <div class="mw-footer-container"> <footer id="footer" class="mw-footer" > <ul id="footer-info"> <li id="footer-info-lastmod"> This page was last edited on 8 December 2021, at 12:26.</li> <li id="footer-info-copyright">Text is available under the <a rel="nofollow" class="external text" href="https://creativecommons.org/licenses/by-sa/4.0/deed.en">Creative Commons Attribution-ShareAlike License</a>; additional terms may apply. See <a class="external text" href="https://foundation.wikimedia.org/wiki/Special:MyLanguage/Policy:Terms_of_Use">Terms of Use</a> for details.</li> </ul> <ul id="footer-places"> <li id="footer-places-privacy"><a href="https://foundation.wikimedia.org/wiki/Special:MyLanguage/Policy:Privacy_policy">Privacy policy</a></li> <li id="footer-places-about"><a href="/wiki/Meta:About">About Meta</a></li> <li id="footer-places-disclaimers"><a href="https://foundation.wikimedia.org/wiki/Special:MyLanguage/Policy:General_disclaimer">Disclaimers</a></li> <li id="footer-places-wm-codeofconduct"><a href="https://foundation.wikimedia.org/wiki/Special:MyLanguage/Policy:Universal_Code_of_Conduct">Code of Conduct</a></li> <li id="footer-places-developers"><a href="https://developer.wikimedia.org">Developers</a></li> <li id="footer-places-statslink"><a href="https://stats.wikimedia.org/#/meta.wikimedia.org">Statistics</a></li> <li id="footer-places-cookiestatement"><a href="https://foundation.wikimedia.org/wiki/Special:MyLanguage/Policy:Cookie_statement">Cookie statement</a></li> <li id="footer-places-mobileview"><a href="//meta.m.wikimedia.org/w/index.php?title=Template:Codesample&mobileaction=toggle_view_mobile" class="noprint stopMobileRedirectToggle">Mobile view</a></li> </ul> <ul id="footer-icons" class="noprint"> <li id="footer-copyrightico"><a href="https://wikimediafoundation.org/" class="cdx-button cdx-button--fake-button cdx-button--size-large cdx-button--fake-button--enabled"><img src="/static/images/footer/wikimedia-button.svg" width="84" height="29" alt="Wikimedia Foundation" loading="lazy"></a></li> <li id="footer-poweredbyico"><a href="https://www.mediawiki.org/" class="cdx-button cdx-button--fake-button cdx-button--size-large cdx-button--fake-button--enabled"><img src="/w/resources/assets/poweredby_mediawiki.svg" alt="Powered by MediaWiki" width="88" height="31" loading="lazy"></a></li> </ul> </footer> </div> </div> </div> <div class="vector-settings" id="p-dock-bottom"> <ul></ul> </div><script>(RLQ=window.RLQ||[]).push(function(){mw.config.set({"wgHostname":"mw-web.codfw.main-57488d5c7d-tqdc7","wgBackendResponseTime":100,"wgPageParseReport":{"limitreport":{"cputime":"0.255","walltime":"0.825","ppvisitednodes":{"value":410,"limit":1000000},"postexpandincludesize":{"value":11864,"limit":2097152},"templateargumentsize":{"value":1037,"limit":2097152},"expansiondepth":{"value":11,"limit":100},"expensivefunctioncount":{"value":18,"limit":500},"unstrip-depth":{"value":0,"limit":20},"unstrip-size":{"value":39013,"limit":5000000},"entityaccesscount":{"value":0,"limit":400},"timingprofile":["100.00% 654.587 1 Template:Documentation","100.00% 654.587 1 -total"," 73.63% 481.967 6 Template:Codesample"," 7.71% 50.480 1 Template:Uses_TemplateStyles"," 1.36% 8.931 1 Template:Documentation_subpage"," 1.29% 8.425 1 Template:TemplateData_header"," 1.20% 7.834 1 Template:Sandbox_other"," 0.92% 6.039 1 Template:IsDocSubpage"," 0.43% 2.792 1 Template:Template_other"," 0.26% 1.670 1 Template:Str_left"]},"scribunto":{"limitreport-timeusage":{"value":"0.203","limit":"10.000"},"limitreport-memusage":{"value":1325939,"limit":52428800}},"cachereport":{"origin":"mw-web.eqiad.main-68b5f87cfc-zcn96","timestamp":"20241118151424","ttl":2592000,"transientcontent":false}}});});</script> </body> </html>