1"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[7364],{50032:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>c,contentTitle:()=>l,default:()=>o,frontMatter:()=>s,metadata:()=>d,toc:()=>h});var i=t(85893),r=t(11151);const s={sidebar_position:23,description:"Display the current heading on the page.",toc_max_heading_level:2},l="display-current-heading",d={id:"reference/utils/display-current-heading",title:"display-current-heading",description:"Display the current heading on the page.",source:"@site/docs/reference/utils/display-current-heading.mdx",sourceDirName:"reference/utils",slug:"/reference/utils/display-current-heading",permalink:"/docs/reference/utils/display-current-heading",draft:!1,unlisted:!1,tags:[],version:"current",sidebarPosition:23,frontMatter:{sidebar_position:23,description:"Display the current heading on the page.",toc_max_heading_level:2},sidebar:"tutorialSidebar",previous:{title:"current-heading",permalink:"/docs/reference/utils/current-heading"},next:{title:"display-current-heading-number",permalink:"/docs/reference/utils/display-current-heading-number"}},c={},h=[{value:"level : <TypeLink></TypeLink> | <TypeLink></TypeLink> <Default><code>auto</code></Default>",id:"level",level:3},{value:"numbered : <TypeLink></TypeLink>",id:"numbered",level:3},{value:"hierachical : <TypeLink></TypeLink> <Default><code>true</code></Default>",id:"hierachical",level:3},{value:"depth : <TypeLink></TypeLink> <Default><code>9999</code></Default>",id:"depth",level:3},{value:"setting : <TypeLink></TypeLink>",id:"setting",level:3},{value:"style : <TypeLink></TypeLink>",id:"style",level:3}];function a(e){const n={a:"a",code:"code",h1:"h1",h3:"h3",p:"p",strong:"strong",...(0,r.a)(),...e.components},{Default:t,Param:s,Parameters:l,Signature:d,SignatureName:c,SignatureParam:h,SourceLink:a,TypeLink:o}=n;return t||u("Default",!0),s||u("Param",!0),l||u("Parameters",!0),d||u("Signature",!0),c||u("SignatureName",!0),h||u("SignatureParam",!0),a||u("SourceLink",!0),o||u("TypeLink",!0),(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.h1,{id:"display-current-heading",children:"display-current-heading"}),"\n",(0,i.jsx)(d,{children:(0,i.jsxs)("code",{children:[(0,i.jsx)(c,{children:"display-current-heading"}),"(",(0,i.jsxs)(h,{children:[(0,i.jsx)(n.a,{href:"#self",children:"self: none"}),", "]}),(0,i.jsxs)(h,{children:[(0,i.jsx)(n.a,{href:"#level",children:"level: auto"}),", "]}),(0,i.jsxs)(h,{children:[(0,i.jsx)(n.a,{href:"#hierachical",children:"hierachical: true"}),", "]}),(0,i.jsxs)(h,{children:[(0,i.jsx)(n.a,{href:"#depth",children:"depth: 9999"}),", "]}),(0,i.jsxs)(h,{children:[(0,i.jsx)(n.a,{href:"#style",children:"style"}),", "]}),(0,i.jsx)(h,{children:(0,i.jsx)(n.a,{href:"#setting-args",children:"..setting-args"})}),")",(0,i.jsx)(a,{href:"https://github.com/touying-typ/touying/blob/main/src/utils.typ#L621"})]})}),"\n",(0,i.jsx)(n.p,{children:"Display the current heading on the page."}),"\n",(0,i.jsxs)(l,{children:[(0,i.jsxs)(n.h3,{id:"level",children:["level : ",(0,i.jsx)(o,{type:"int"})," | ",(0,i.jsx)(o,{type:"auto"})," ",(0,i.jsx)(t,{children:(0,i.jsx)(n.code,{children:"auto"})})]}),(0,i.jsx)(s,{children:(0,i.jsxs)(n.p,{children:["The level of the heading. If ",(0,i.jsx)(n.code,{children:"level"})," is ",(0,i.jsx)(n.code,{children:"auto"}),", it will return the last heading on or before the current page. If ",(0,i.jsx)(n.code,{children:"level"})," is a number, it will return the last heading on or before the current page with the same level."]})}),(0,i.jsxs)(n.h3,{id:"numbered",children:["numbered : ",(0,i.jsx)(o,{type:"bool"})]}),(0,i.jsx)(s,{children:(0,i.jsxs)(n.p,{children:["Whether to display the heading numbering. Default is ",(0,i.jsx)(n.code,{children:"true"}),"."]})}),(0,i.jsxs)(n.h3,{id:"hierachical",children:["hierachical : ",(0,i.jsx)(o,{type:"bool"})," ",(0,i.jsx)(t,{children:(0,i.jsx)(n.code,{children:"true"})})]}),(0,i.jsx)(s,{children:(0,i.jsxs)(n.p,{children:["Whether to return the heading hierarchically. If ",(0,i.jsx)(n.code,{children:"true"}),", returns the last heading according to the hierarchical structure. If ",(0,i.jsx)(n.code,{children:"false"}),", returns the last heading on or before the current page with the same level."]})}),(0,i.jsxs)(n.h3,{id:"depth",children:["depth : ",(0,i.jsx)(o,{type:"int"})," ",(0,i.jsx)(t,{children:(0,i.jsx)(n.code,{children:"9999"})})]}),(0,i.jsx)(s,{children:(0,i.jsx)(n.p,{children:"The maximum depth of the heading to search. Usually, it should be set as slide-level."})}),(0,i.jsxs)(n.h3,{id:"setting",children:["setting : ",(0,i.jsx)(o,{type:"function"})]}),(0,i.jsx)(s,{children:(0,i.jsxs)(n.p,{children:["The setting of the heading. Default is ",(0,i.jsx)(n.code,{children:"body => body"}),"."]})}),(0,i.jsxs)(n.h3,{id:"style",children:["style : ",(0,i.jsx)(o,{type:"function"})]}),(0,i.jsx)(s,{children:(0,i.jsxs)(n.p,{children:["The style of the heading. If ",(0,i.jsx)(n.code,{children:"style"})," is a function, it will use the function to style the heading. For example, ",(0,i.jsx)(n.code,{children:"style: current-heading => current-heading.body"}),". If you set it to ",(0,i.jsx)(n.code,{children:"style: auto"}),", it will be controlled by ",(0,i.jsx)(n.code,{children:"show heading"})," rules."]})})]}),"\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.strong,{children:"Returns:"})," ",(0,i.jsx)(o,{type:"content"})]})]})}function o(e={}){const{wrapper:n}={...(0,r.a)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(a,{...e})}):a(e)}function u(e,n){throw new Error("Expected "+(n?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}},11151:(e,n,t)=>{t.d(n,{Z:()=>d,a:()=>l});var i=t(67294);const r={},s=i.createContext(r);function l(e){const n=i.useContext(s);return i.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function d(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:l(e.components),i.createElement(s.Provider,{value:n},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.