PageSourceSearch

https://touying-typ.github.io/assets/js/a1689b3a.d6a610f7.js

js touying-typ.github.io collected 2026-10-03 10:06:00 UTC 6,586 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[476],{5935:(e,t,i)=>{i.r(t),i.d(t,{assets:()=>l,contentTitle:()=>r,default:()=>h,frontMatter:()=>o,metadata:()=>c,toc:()=>d});var s=i(85893),n=i(11151);const o={sidebar_position:1,description:"Default slide function for the presentation.",toc_max_heading_level:2},r="slide",c={id:"reference/themes/simple/slide",title:"slide",description:"Default slide function for the presentation.",source:"@site/docs/reference/themes/simple/slide.mdx",sourceDirName:"reference/themes/simple",slug:"/reference/themes/simple/slide",permalink:"/docs/reference/themes/simple/slide",draft:!1,unlisted:!1,tags:[],version:"current",sidebarPosition:1,frontMatter:{sidebar_position:1,description:"Default slide function for the presentation.",toc_max_heading_level:2},sidebar:"tutorialSidebar",previous:{title:"Simple",permalink:"/docs/category/simple"},next:{title:"centered-slide",permalink:"/docs/reference/themes/simple/centered-slide"}},l={},d=[{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 =&gt; body</code></Default>",id:"setting",level:3},{value:"composer : <TypeLink></TypeLink> <Default><code>auto</code></Default>",id:"composer",level:3},{value:"..bodies : <TypeLink></TypeLink>",id:"bodies",level:3}];function a(e){const t={a:"a",code:"code",h1:"h1",h3:"h3",p:"p",...(0,n.a)(),...e.components},{Default:i,Param:o,Parameters:r,Signature:c,SignatureName:l,SignatureParam:d,SourceLink:a,TypeLink:h}=t;return i||u("Default",!0),o||u("Param",!0),r||u("Parameters",!0),c||u("Signature",!0),l||u("SignatureName",!0),d||u("SignatureParam",!0),a||u("SourceLink",!0),h||u("TypeLink",!0),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(t.h1,{id:"slide",children:"slide"}),"\n",(0,s.jsx)(c,{children:(0,s.jsxs)("code",{children:[(0,s.jsx)(l,{children:"slide"}),"(",(0,s.jsxs)(d,{children:[(0,s.jsx)(t.a,{href:"#config",children:"config: (:)"}),", "]}),(0,s.jsxs)(d,{children:[(0,s.jsx)(t.a,{href:"#repeat",children:"repeat: auto"}),", "]}),(0,s.jsxs)(d,{children:[(0,s.jsx)(t.a,{href:"#setting",children:"setting: body => body"}),", "]}),(0,s.jsxs)(d,{children:[(0,s.jsx)(t.a,{href:"#composer",children:"composer: auto"}),", "]}),(0,s.jsx)(d,{children:(0,s.jsx)(t.a,{href:"#bodies",children:"..bodies"})}),")",(0,s.jsx)(a,{href:"https://github.com/touying-typ/touying/blob/main/themes/simple.typ#L29"})]})}),"\n",(0,s.jsx)(t.p,{children:"Default slide function for the presentation."}),"\n",(0,s.jsxs)(r,{children:[(0,s.jsxs)(t.h3,{id:"config",children:["config : ",(0,s.jsx)(h,{type:"dictionary"})," ",(0,s.jsx)(i,{children:(0,s.jsx)(t.code,{children:"(:)"})})]}),(0,s.jsx)(o,{children:(0,s.jsxs)(t.p,{children:["The configuration of the slide. You can use ",(0,s.jsx)(t.code,{children:"config-xxx"})," to set the configuration of the slide. For more several configurations, you can use ",(0,s.jsx)(t.code,{children:"utils.merge-dicts"})," to merge them."]})}),(0,s.jsxs)(t.h3,{id:"repeat",children:["repeat : ",(0,s.jsx)(h,{type:"int"})," | ",(0,s.jsx)(h,{type:"auto"})," ",(0,s.jsx)(i,{children:(0,s.jsx)(t.code,{children:"auto"})})]}),(0,s.jsx)(o,{children:(0,s.jsxs)(t.p,{children:["The number of subslides. Default is ",(0,s.jsx)(t.code,{children:"auto"}),", which means touying will automatically calculate the number of subslides. /   The ",(0,s.jsx)(t.code,{children:"repeat"})," argument is necessary when you use ",(0,s.jsx)(t.code,{children:"#slide(repeat: 3, self => [ .. ])"})," style code to create a slide. The callback-style ",(0,s.jsx)(t.code,{children:"uncover"})," and ",(0,s.jsx)(t.code,{children:"only"})," cannot be detected by touying automatically."]})}),(0,s.jsxs)(t.h3,{id:"setting",children:["setting : ",(0,s.jsx)(h,{type:"function"})," ",(0,s.jsx)(i,{children:(0,s.jsx)(t.code,{children:"body => body"})})]}),(0,s.jsx)(o,{children:(0,s.jsx)(t.p,{children:"The setting of the slide. You can use it to add some set/show rules for the slide."})}),(0,s.jsxs)(t.h3,{id:"composer",children:["composer : ",(0,s.jsx)(h,{type:"function"})," ",(0,s.jsx)(i,{children:(0,s.jsx)(t.code,{children:"auto"})})]}),(0,s.jsx)(o,{children:(0,s.jsxs)(t.p,{children:["The composer of the slide. You can use it to set the layout of the slide. For example, ",(0,s.jsx)(t.code,{children:"#slide(composer: (1fr, 2fr, 1fr))[A][B][C]"})," to split the slide into three parts. The first and the last parts will take 1/4 of the slide, and the second part will take 1/2 of the slide. If you pass a non-function value like ",(0,s.jsx)(t.code,{children:"(1fr, 2fr, 1fr)"}),", it will be assumed to be the first argument of the ",(0,s.jsx)(t.code,{children:"cols"})," function. The ",(0,s.jsx)(t.code,{children:"cols"})," function is a simple wrapper of the ",(0,s.jsx)(t.code,{children:"grid"})," function. It means you can use the ",(0,s.jsx)(t.code,{children:"grid.cell(colspan: 2, ..)"})," to make the cell take 2 columns. For example, ",(0,s.jsx)(t.code,{children:"#slide(composer: 2)[A][B][#grid.cell(colspan: 2)[Footer]]"})," will make the ",(0,s.jsx)(t.code,{children:"Footer"})," cell take 2 columns. If you want to customize the composer, you can pass a function to the ",(0,s.jsx)(t.code,{children:"composer"})," argument. The function should receive the contents of the slide and return the content of the slide, like ",(0,s.jsx)(t.code,{children:"#slide(composer: grid.with(columns: 2))[A][B]"}),"."]})}),(0,s.jsxs)(t.h3,{id:"bodies",children:["..bodies : ",(0,s.jsx)(h,{type:"array"})]}),(0,s.jsx)(o,{children:(0,s.jsxs)(t.p,{children:["The contents of the slide. You can call the ",(0,s.jsx)(t.code,{children:"slide"})," function with syntax like ",(0,s.jsx)(t.code,{children:"#slide[A][B][C]"})," to create a slide."]})})]})]})}function h(e={}){const{wrapper:t}={...(0,n.a)(),...e.components};return t?(0,s.jsx)(t,{...e,children:(0,s.jsx)(a,{...e})}):a(e)}function u(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,i)=>{i.d(t,{Z:()=>c,a:()=>r});var s=i(67294);const n={},o=s.createContext(n);function r(e){const t=s.useContext(o);return s.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function c(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(n):e.components||n:r(e.components),s.createElement(o.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.