1"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[6042],{69765:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>a,contentTitle:()=>s,default:()=>p,frontMatter:()=>i,metadata:()=>c,toc:()=>d});var r=n(85893),o=n(11151);const i={sidebar_position:28,description:"Convert content to markup text, partly from typst-examples-book.",toc_max_heading_level:2},s="markup-text",c={id:"reference/utils/markup-text",title:"markup-text",description:"Convert content to markup text, partly from typst-examples-book.",source:"@site/docs/reference/utils/markup-text.mdx",sourceDirName:"reference/utils",slug:"/reference/utils/markup-text",permalink:"/docs/reference/utils/markup-text",draft:!1,unlisted:!1,tags:[],version:"current",sidebarPosition:28,frontMatter:{sidebar_position:28,description:"Convert content to markup text, partly from typst-examples-book.",toc_max_heading_level:2},sidebar:"tutorialSidebar",previous:{title:"display-info-date",permalink:"/docs/reference/utils/display-info-date"},next:{title:"fit-to-height",permalink:"/docs/reference/utils/fit-to-height"}},a={},d=[{value:"it : <TypeLink></TypeLink> | <TypeLink></TypeLink>",id:"it",level:3},{value:"mode : <TypeLink></TypeLink> <Default><code>"typ"</code></Default>",id:"mode",level:3},{value:"indent : <TypeLink></TypeLink> <Default><code>0</code></Default>",id:"indent",level:3}];function l(e){const t={a:"a",code:"code",h1:"h1",h3:"h3",p:"p",strong:"strong",...(0,o.a)(),...e.components},{Default:n,Param:i,Parameters:s,Signature:c,SignatureName:a,SignatureParam:d,SourceLink:l,TypeLink:p}=t;return n||u("Default",!0),i||u("Param",!0),s||u("Parameters",!0),c||u("Signature",!0),a||u("SignatureName",!0),d||u("SignatureParam",!0),l||u("SourceLink",!0),p||u("TypeLink",!0),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(t.h1,{id:"markup-text",children:"markup-text"}),"\n",(0,r.jsx)(c,{children:(0,r.jsxs)("code",{children:[(0,r.jsx)(a,{children:"markup-text"}),"(",(0,r.jsxs)(d,{children:[(0,r.jsx)(t.a,{href:"#it",children:"it"}),", "]}),(0,r.jsxs)(d,{children:[(0,r.jsx)(t.a,{href:"#mode",children:'mode: "typ"'}),", "]}),(0,r.jsx)(d,{children:(0,r.jsx)(t.a,{href:"#indent",children:"indent: 0"})}),")",(0,r.jsx)(l,{href:"https://github.com/touying-typ/touying/blob/main/src/utils.typ#L874"})]})}),"\n",(0,r.jsxs)(t.p,{children:["Convert content to markup text, partly from\n",(0,r.jsx)(t.a,{href:"https://sitandr.github.io/typst-examples-book/book/typstonomicon/extract_markup_text.html",children:"typst-examples-book"}),"."]}),"\n",(0,r.jsxs)(s,{children:[(0,r.jsxs)(t.h3,{id:"it",children:["it : ",(0,r.jsx)(p,{type:"content"})," | ",(0,r.jsx)(p,{type:"str"})]}),(0,r.jsx)(i,{children:(0,r.jsx)(t.p,{children:"The content to convert."})}),(0,r.jsxs)(t.h3,{id:"mode",children:["mode : ",(0,r.jsx)(p,{type:"str"})," ",(0,r.jsx)(n,{children:(0,r.jsx)(t.code,{children:'"typ"'})})]}),(0,r.jsx)(i,{children:(0,r.jsxs)(t.p,{children:["The output mode: ",(0,r.jsx)(t.code,{children:'"typ"'})," for Typst markup or ",(0,r.jsx)(t.code,{children:'"md"'})," for Markdown."]})}),(0,r.jsxs)(t.h3,{id:"indent",children:["indent : ",(0,r.jsx)(p,{type:"int"})," ",(0,r.jsx)(n,{children:(0,r.jsx)(t.code,{children:"0"})})]}),(0,r.jsx)(i,{children:(0,r.jsxs)(t.p,{children:["The number of spaces to indent. Default is ",(0,r.jsx)(t.code,{children:"0"}),"."]})})]}),"\n",(0,r.jsxs)(t.p,{children:[(0,r.jsx)(t.strong,{children:"Returns:"})," ",(0,r.jsx)(p,{type:"str"})]})]})}function p(e={}){const{wrapper:t}={...(0,o.a)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(l,{...e})}):l(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,n)=>{n.d(t,{Z:()=>c,a:()=>s});var r=n(67294);const o={},i=r.createContext(o);function s(e){const t=r.useContext(i);return r.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(o):e.components||o:s(e.components),r.createElement(i.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.