PageSourceSearch

https://touying-typ.github.io/assets/js/70e1f1b9.be64b1f5.js

js touying-typ.github.io collected 2026-10-03 10:09:04 UTC 3,641 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[7417],{82912:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>a,contentTitle:()=>s,default:()=>h,frontMatter:()=>i,metadata:()=>c,toc:()=>d});var r=t(85893),o=t(11151);const i={sidebar_position:1,description:"Store theme-specific private data in the presentation context.",toc_max_heading_level:2},s="config-store",c={id:"reference/configs/config-store",title:"config-store",description:"Store theme-specific private data in the presentation context.",source:"@site/docs/reference/configs/config-store.mdx",sourceDirName:"reference/configs",slug:"/reference/configs/config-store",permalink:"/docs/reference/configs/config-store",draft:!1,unlisted:!1,tags:[],version:"current",sidebarPosition:1,frontMatter:{sidebar_position:1,description:"Store theme-specific private data in the presentation context.",toc_max_heading_level:2},sidebar:"tutorialSidebar",previous:{title:"Configs",permalink:"/docs/category/configs"},next:{title:"config-common",permalink:"/docs/reference/configs/config-common"}},a={},d=[{value:"..args : <TypeLink></TypeLink>",id:"args",level:3}];function l(e){const n={a:"a",code:"code",h1:"h1",h3:"h3",p:"p",pre:"pre",strong:"strong",...(0,o.a)(),...e.components},{Param:t,Parameters:i,Signature:s,SignatureName:c,SignatureParam:a,SourceLink:d,TypeLink:l}=n;return t||p("Param",!0),i||p("Parameters",!0),s||p("Signature",!0),c||p("SignatureName",!0),a||p("SignatureParam",!0),d||p("SourceLink",!0),l||p("TypeLink",!0),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.h1,{id:"config-store",children:"config-store"}),"\n",(0,r.jsx)(s,{children:(0,r.jsxs)("code",{children:[(0,r.jsx)(c,{children:"config-store"}),"(",(0,r.jsx)(a,{children:(0,r.jsx)(n.a,{href:"#args",children:"..args"})}),")",(0,r.jsx)(d,{href:"https://github.com/touying-typ/touying/blob/main/src/configs.typ#L38"})]})}),"\n",(0,r.jsx)(n.p,{children:"Store theme-specific private data in the presentation context."}),"\n",(0,r.jsxs)(n.p,{children:["Use this in your theme's ",(0,r.jsx)(n.code,{children:"#show: my-theme.with(...)"})," to pass arbitrary key-value pairs that your theme needs internally. The stored values are accessible via ",(0,r.jsx)(n.code,{children:"self.store.<key>"})," inside any theme function."]}),"\n",(0,r.jsxs)(n.p,{children:["This also registers your theme's config to be readable by ",(0,r.jsx)(n.code,{children:"touying-get-config"}),"."]}),"\n",(0,r.jsx)(n.p,{children:"Example:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-typst",children:"config-store(\n  header-height: 2em,\n  show-logo: true,\n)\n"})}),"\n",(0,r.jsxs)(i,{children:[(0,r.jsxs)(n.h3,{id:"args",children:["..args : ",(0,r.jsx)(l,{type:"arguments"})]}),(0,r.jsx)(t,{children:(0,r.jsxs)(n.p,{children:["Named key-value pairs to store in ",(0,r.jsx)(n.code,{children:"self.store"}),"."]})})]}),"\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.strong,{children:"Returns:"})," ",(0,r.jsx)(l,{type:"dictionary"})]})]})}function h(e={}){const{wrapper:n}={...(0,o.a)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(l,{...e})}):l(e)}function p(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:()=>c,a:()=>s});var r=t(67294);const o={},i=r.createContext(o);function s(e){const n=r.useContext(i);return r.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function c(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(o):e.components||o:s(e.components),r.createElement(i.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.