1"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[6052],{13621:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>a,contentTitle:()=>c,default:()=>d,frontMatter:()=>r,metadata:()=>s,toc:()=>l});var o=t(85893),i=t(11151);const r={sidebar_position:8,description:"Gets the current config at the point of the call.",toc_max_heading_level:2},c="touying-get-config",s={id:"reference/configs/touying-get-config",title:"touying-get-config",description:"Gets the current config at the point of the call.",source:"@site/docs/reference/configs/touying-get-config.mdx",sourceDirName:"reference/configs",slug:"/reference/configs/touying-get-config",permalink:"/docs/reference/configs/touying-get-config",draft:!1,unlisted:!1,tags:[],version:"current",sidebarPosition:8,frontMatter:{sidebar_position:8,description:"Gets the current config at the point of the call.",toc_max_heading_level:2},sidebar:"tutorialSidebar",previous:{title:"default-config",permalink:"/docs/reference/configs/default-config"},next:{title:"Core",permalink:"/docs/category/core"}},a={},l=[{value:"key : <TypeLink></TypeLink> <Default><code>none</code></Default>",id:"key",level:3},{value:"default : <TypeLink></TypeLink> <Default><code>type</code></Default>",id:"default",level:3}];function u(e){const n={a:"a",code:"code",h1:"h1",h3:"h3",p:"p",pre:"pre",strong:"strong",...(0,i.a)(),...e.components},{Default:t,Param:r,Parameters:c,Signature:s,SignatureName:a,SignatureParam:l,SourceLink:u,TypeLink:d}=n;return t||g("Default",!0),r||g("Param",!0),c||g("Parameters",!0),s||g("Signature",!0),a||g("SignatureName",!0),l||g("SignatureParam",!0),u||g("SourceLink",!0),d||g("TypeLink",!0),(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(n.h1,{id:"touying-get-config",children:"touying-get-config"}),"\n",(0,o.jsx)(s,{children:(0,o.jsxs)("code",{children:[(0,o.jsx)(a,{children:"touying-get-config"}),"(",(0,o.jsxs)(l,{children:[(0,o.jsx)(n.a,{href:"#key",children:"key: none"}),", "]}),(0,o.jsxs)(l,{children:[(0,o.jsx)(n.a,{href:"#default",children:"default: type"}),", "]}),(0,o.jsx)(l,{children:(0,o.jsx)(n.a,{href:"#args",children:"..args"})}),")",(0,o.jsx)(u,{href:"https://github.com/touying-typ/touying/blob/main/src/configs.typ#L874"})]})}),"\n",(0,o.jsx)(n.p,{children:"Gets the current config at the point of the call. Returns a dict with context evaluated values."}),"\n",(0,o.jsx)(n.p,{children:"Usage:"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-typc",children:'touying-get-config() // returns the whole config dict\ntouying-get-config().common.handout // returns the value of the "handout" config in the "common" category\ntouying-get-config().handout // same as above. common is also registered at the top level.\ntouying-get-config("commmon.handout") // same as above. You can also query with a key, and you will get the subconfig or value back.\n'})}),"\n",(0,o.jsxs)(c,{children:[(0,o.jsxs)(n.h3,{id:"key",children:["key : ",(0,o.jsx)(d,{type:"str"})," ",(0,o.jsx)(t,{children:(0,o.jsx)(n.code,{children:"none"})})]}),(0,o.jsx)(r,{children:(0,o.jsxs)(n.p,{children:["The key of the subconfiguration to retrieve. Default ",(0,o.jsx)(n.code,{children:"none"}),", returns the entire config. May also be passed in as a positional argument. Only necessary when you set custom keys into touyings' config. Theme configuration is naturally available as ",(0,o.jsx)(n.code,{children:"touying-get-config().store.long-theme-key"})]})}),(0,o.jsxs)(n.h3,{id:"default",children:["default : ",(0,o.jsx)(d,{type:"any"})," ",(0,o.jsx)(t,{children:(0,o.jsx)(n.code,{children:"type"})})]}),(0,o.jsx)(r,{children:(0,o.jsx)(n.p,{children:"The default value to return if the key is not found."})})]}),"\n",(0,o.jsxs)(n.p,{children:[(0,o.jsx)(n.strong,{children:"Returns:"})," ",(0,o.jsx)(d,{type:"dict"})]})]})}function d(e={}){const{wrapper:n}={...(0,i.a)(),...e.components};return n?(0,o.jsx)(n,{...e,children:(0,o.jsx)(u,{...e})}):u(e)}function g(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:()=>s,a:()=>c});var o=t(67294);const i={},r=o.createContext(i);function c(e){const n=o.useContext(r);return o.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function s(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:c(e.components),o.createElement(r.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.