1"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[6781],{85070:(e,i,n)=>{n.r(i),n.d(i,{assets:()=>d,contentTitle:()=>r,default:()=>u,frontMatter:()=>t,metadata:()=>c,toc:()=>l});var s=n(85893),o=n(11151);const t={sidebar_position:41,description:"Touying slide function.",toc_max_heading_level:2},r="slide",c={id:"reference/core/slide",title:"slide",description:"Touying slide function.",source:"@site/docs/reference/core/slide.mdx",sourceDirName:"reference/core",slug:"/reference/core/slide",permalink:"/docs/reference/core/slide",draft:!1,unlisted:!1,tags:[],version:"current",sidebarPosition:41,frontMatter:{sidebar_position:41,description:"Touying slide function.",toc_max_heading_level:2},sidebar:"tutorialSidebar",previous:{title:"touying-diagram",permalink:"/docs/reference/core/touying-diagram"},next:{title:"empty-slide",permalink:"/docs/reference/core/empty-slide"}},d={},l=[{value:"config : <TypeLink></TypeLink> <Default><code>(:)</code></Default>",id:"config",level:3},{value:"repeat : <TypeLink></TypeLink> | <TypeLink></TypeLink> <Default><code>auto</code></Default>",id:"repeat",level:3},{value:"setting : <TypeLink></TypeLink> <Default><code>body => body</code></Default>",id:"setting",level:3},{value:"composer : <TypeLink></TypeLink> | <TypeLink></TypeLink> | <TypeLink></TypeLink> | <TypeLink></TypeLink> <Default><code>auto</code></Default>",id:"composer",level:3},{value:"..bodies : <TypeLink></TypeLink>",id:"bodies",level:3}];function a(e){const i={a:"a",code:"code",h1:"h1",h3:"h3",p:"p",strong:"strong",...(0,o.a)(),...e.components},{Default:n,Param:t,Parameters:r,Signature:c,SignatureName:d,SignatureParam:l,SourceLink:a,TypeLink:u}=i;return n||h("Default",!0),t||h("Param",!0),r||h("Parameters",!0),c||h("Signature",!0),d||h("SignatureName",!0),l||h("SignatureParam",!0),a||h("SourceLink",!0),u||h("TypeLink",!0),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(i.h1,{id:"slide",children:"slide"}),"\n",(0,s.jsx)(c,{children:(0,s.jsxs)("code",{children:[(0,s.jsx)(d,{children:"slide"}),"(",(0,s.jsxs)(l,{children:[(0,s.jsx)(i.a,{href:"#config",children:"config: (:)"}),", "]}),(0,s.jsxs)(l,{children:[(0,s.jsx)(i.a,{href:"#repeat",children:"repeat: auto"}),", "]}),(0,s.jsxs)(l,{children:[(0,s.jsx)(i.a,{href:"#setting",children:"setting: body => body"}),", "]}),(0,s.jsxs)(l,{children:[(0,s.jsx)(i.a,{href:"#composer",children:"composer: auto"}),", "]}),(0,s.jsx)(l,{children:(0,s.jsx)(i.a,{href:"#bodies",children:"..bodies"})}),")",(0,s.jsx)(a,{href:"https://github.com/touying-typ/touying/blob/main/src/core.typ#L6121"})]})}),"\n",(0,s.jsx)(i.p,{children:"Touying slide function."}),"\n",(0,s.jsxs)(r,{children:[(0,s.jsxs)(i.h3,{id:"config",children:["config : ",(0,s.jsx)(u,{type:"dictionary"})," ",(0,s.jsx)(n,{children:(0,s.jsx)(i.code,{children:"(:)"})})]}),(0,s.jsx)(t,{children:(0,s.jsxs)(i.p,{children:["The configuration of the slide. You can use ",(0,s.jsx)(i.code,{children:"config-xxx"})," to set the configuration of the slide. For more configurations, you can use ",(0,s.jsx)(i.code,{children:"utils.merge-dicts"})," to merge them."]})}),(0,s.jsxs)(i.h3,{id:"repeat",children:["repeat : ",(0,s.jsx)(u,{type:"auto"})," | ",(0,s.jsx)(u,{type:"int"})," ",(0,s.jsx)(n,{children:(0,s.jsx)(i.code,{children:"auto"})})]}),(0,s.jsx)(t,{children:(0,s.jsxs)(i.p,{children:["The number of subslides. Default is ",(0,s.jsx)(i.code,{children:"auto"}),", which means touying will automatically calculate the number of subslides. The ",(0,s.jsx)(i.code,{children:"repeat"})," argument is necessary when you use ",(0,s.jsx)(i.code,{children:"#slide(repeat: 3, self => [ .. ])"})," style code to create a slide. The callback-style ",(0,s.jsx)(i.code,{children:"uncover"})," and ",(0,s.jsx)(i.code,{children:"only"})," cannot be detected by touying automatically."]})}),(0,s.jsxs)(i.h3,{id:"setting",children:["setting : ",(0,s.jsx)(u,{type:"function"})," ",(0,s.jsx)(n,{children:(0,s.jsx)(i.code,{children:"body => body"})})]}),(0,s.jsx)(t,{children:(0,s.jsx)(i.p,{children:"The setting of the slide. You can use it to add some set/show rules for the slide."})}),(0,s.jsxs)(i.h3,{id:"composer",children:["composer : ",(0,s.jsx)(u,{type:"function"})," | ",(0,s.jsx)(u,{type:"array"})," | ",(0,s.jsx)(u,{type:"int"})," | ",(0,s.jsx)(u,{type:"auto"}
1)," ",(0,s.jsx)(n,{children:(0,s.jsx)(i.code,{children:"auto"})})]}),(0,s.jsx)(t,{children:(0,s.jsxs)(i.p,{children:["The composer arranges multiple content bodies side by side. - ",(0,s.jsx)(i.code,{children:"auto"}),": use the theme default (",(0,s.jsx)(i.code,{children:"cols.with(lazy-layout: false)"}),") - array, e.g. ",(0,s.jsx)(i.code,{children:"(1fr, 2fr, 1fr)"}),": column widths for ",(0,s.jsx)(i.code,{children:"cols"})," - int: equal columns shorthand - function: fully custom layout, e.g. ",(0,s.jsx)(i.code,{children:"grid.with(columns: 2)"})," For example, ",(0,s.jsx)(i.code,{children:"#slide(composer: (1fr, 2fr, 1fr))[A][B][C]"})," splits the slide into three columns. If you want to customize the composer, you can pass a function like ",(0,s.jsx)(i.code,{children:"#slide(composer: grid.with(columns: 2))[A][B]"}),"."]})}),(0,s.jsxs)(i.h3,{id:"bodies",children:["..bodies : ",(0,s.jsx)(u,{type:"array"})]}),(0,s.jsx)(t,{children:(0,s.jsxs)(i.p,{children:["The contents of the slide. You can call the ",(0,s.jsx)(i.code,{children:"slide"})," function with syntax like ",(0,s.jsx)(i.code,{children:"#slide[A][B][C]"})," to create a slide."]})})]}),"\n",(0,s.jsxs)(i.p,{children:[(0,s.jsx)(i.strong,{children:"Returns:"})," ",(0,s.jsx)(u,{type:"content"})]})]})}function u(e={}){const{wrapper:i}={...(0,o.a)(),...e.components};return i?(0,s.jsx)(i,{...e,children:(0,s.jsx)(a,{...e})}):a(e)}function h(e,i){throw new Error("Expected "+(i?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}},11151:(e,i,n)=>{n.d(i,{Z:()=>c,a:()=>r});var s=n(67294);const o={},t=s.createContext(o);function r(e){const i=s.useContext(t);return s.useMemo((function(){return"function"==typeof e?e(i):{...i,...e}}),[i,e])}function c(e){let i;return i=e.disableParentContext?"function"==typeof e.components?e.components(o):e.components||o:r(e.components),s.createElement(t.Provider,{value:i},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.