PageSourceSearch

https://touying-typ.github.io/assets/js/41fb2674.889c89eb.js

js touying-typ.github.io collected 2026-10-03 10:09:02 UTC 7,285 bytes, 1 lines download raw bytes

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