1"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[6298],{4747:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>o,contentTitle:()=>a,default:()=>u,frontMatter:()=>l,metadata:()=>s,toc:()=>c});var i=n(85893),r=n(11151);const l={sidebar_position:6,description:"Add a label to a content.",toc_max_heading_level:2},a="label-it",s={id:"reference/utils/label-it",title:"label-it",description:"Add a label to a content.",source:"@site/docs/reference/utils/label-it.mdx",sourceDirName:"reference/utils",slug:"/reference/utils/label-it",permalink:"/docs/reference/utils/label-it",draft:!1,unlisted:!1,tags:[],version:"current",sidebarPosition:6,frontMatter:{sidebar_position:6,description:"Add a label to a content.",toc_max_heading_level:2},sidebar:"tutorialSidebar",previous:{title:"trim",permalink:"/docs/reference/utils/trim"},next:{title:"reconstruct",permalink:"/docs/reference/utils/reconstruct"}},o={},c=[{value:"it : <TypeLink></TypeLink>",id:"it",level:3},{value:"label-name : <TypeLink></TypeLink> | <TypeLink></TypeLink>",id:"label-name",level:3}];function d(e){const t={a:"a",code:"code",h1:"h1",h3:"h3",p:"p",strong:"strong",...(0,r.a)(),...e.components},{Param:n,Parameters:l,Signature:a,SignatureName:s,SignatureParam:o,SourceLink:c,TypeLink:d}=t;return n||p("Param",!0),l||p("Parameters",!0),a||p("Signature",!0),s||p("SignatureName",!0),o||p("SignatureParam",!0),c||p("SourceLink",!0),d||p("TypeLink",!0),(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(t.h1,{id:"label-it",children:"label-it"}),"\n",(0,i.jsx)(a,{children:(0,i.jsxs)("code",{children:[(0,i.jsx)(s,{children:"label-it"}),"(",(0,i.jsxs)(o,{children:[(0,i.jsx)(t.a,{href:"#it",children:"it"}),", "]}),(0,i.jsx)(o,{children:(0,i.jsx)(t.a,{href:"#label-name",children:"label-name"})}),")",(0,i.jsx)(c,{href:"https://github.com/touying-typ/touying/blob/main/src/utils.typ#L169"})]})}),"\n",(0,i.jsx)(t.p,{children:"Add a label to a content."}),"\n",(0,i.jsxs)(t.p,{children:["Example: ",(0,i.jsx)(t.code,{children:'label-it("key", [a])'})," is equivalent to ",(0,i.jsx)(t.code,{children:"[a <key>]"})]}),"\n",(0,i.jsxs)(l,{children:[(0,i.jsxs)(t.h3,{id:"it",children:["it : ",(0,i.jsx)(d,{type:"content"})]}),(0,i.jsx)(n,{children:(0,i.jsx)(t.p,{children:"The content to label."})}),(0,i.jsxs)(t.h3,{id:"label-name",children:["label-name : ",(0,i.jsx)(d,{type:"str"})," | ",(0,i.jsx)(d,{type:"label"})]}),(0,i.jsx)(n,{children:(0,i.jsx)(t.p,{children:"The name of the label, or a label."})})]}),"\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.strong,{children:"Returns:"})," ",(0,i.jsx)(d,{type:"content"})]})]})}function u(e={}){const{wrapper:t}={...(0,r.a)(),...e.components};return t?(0,i.jsx)(t,{...e,children:(0,i.jsx)(d,{...e})}):d(e)}function p(e,t){throw new Error("Expected "+(t?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}},11151:(e,t,n)=>{n.d(t,{Z:()=>s,a:()=>a});var i=n(67294);const r={},l=i.createContext(r);function a(e){const t=i.useContext(l);return i.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function s(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:a(e.components),i.createElement(l.Provider,{value:t},e.children)}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.