[{"data":1,"prerenderedAt":353},["ShallowReactive",2],{"quirekit-doc:\u002Fplugins\u002Freference\u002Fcode":3},{"id":4,"title":5,"body":6,"description":12,"extension":340,"keywords":341,"locale":344,"meta":345,"navigation":346,"order":347,"path":348,"section":349,"seo":350,"stem":351,"__hash__":352},"docs\u002Fplugins\u002Freference\u002Fcode.zh-CN.md","Code · 行内代码",{"type":7,"value":8,"toc":327},"minimark",[9,13,24,28,34,87,95,98,114,126,136,160,167,170,181,185,188,195,200,203,209,215,218,225,275,283,286,297,300,311,323],[10,11,12],"p",{},"将段落中的一段文字标记为行内代码。多行代码应使用 CodeBlock，二者的结构和命令不同。",[10,14,15,19,20],{},[16,17,18],"code",{},"@quirekit\u002Fextension-code"," · ",[21,22,23],"strong",{},"MIT",[25,26,27],"h2",{"id":27},"编辑器适用范围",[10,29,30,31],{},"层次：",[21,32,33],{},"共享文档能力",[35,36,37,53],"table",{},[38,39,40],"thead",{},[41,42,43,47,50],"tr",{},[44,45,46],"th",{},"编辑器",[44,48,49],{},"状态",[44,51,52],{},"所需装配与边界",[54,55,56,73],"tbody",{},[41,57,58,62,65],{},[59,60,61],"td",{},"Classic",[59,63,64],{},"直接支持",[59,66,67,72],{},[68,69,71],"a",{"href":70},"\u002Fplugins\u002Freference\u002Fclassic-editor-preset","classicEditorPreset"," — 使用产品中立的 classicEditorPreset；已有能力由预设装配，不要重复追加。Word 预设会替换段落、标题和容器列表，不能把通用结构直接叠加到 Word 模型。",[41,74,75,78,80],{},[59,76,77],{},"Block",[59,79,64],{},[59,81,82,86],{},[68,83,85],{"href":84},"\u002Fplugins\u002Freference\u002Fcreate-block-editor-preset","createBlockEditorPreset"," — createBlockEditor 默认预设已装配此能力。通过 preset 中对应子项配置；图形编辑使用预设注入的工作区，宿主仍负责保存和资源。不要重复安装同名扩展。",[10,88,89,90,94],{},"“直接支持”指已有上述产品装配；具体交互、宿主服务和格式支持仍有各自条件。",[68,91,93],{"href":92},"\u002Fplugins\u002Fcompatibility","状态与接入规则","。许可独立显示。",[25,96,97],{"id":97},"接入",[99,100,105],"pre",{"className":101,"code":102,"language":103,"meta":104,"style":104},"language-sh shiki shiki-themes github-light github-light github-dark","pnpm add @quirekit\u002Fextension-code@alpha\n","sh","",[16,106,107],{"__ignoreMap":104},[108,109,112],"span",{"class":110,"line":111},"line",1,[108,113,102],{},[10,115,116,117,120,121,125],{},"在创建 Editor 时放入 ",[16,118,119],{},"extensions","。挂载容器、视图和保存由宿主提供，见",[68,122,124],{"href":123},"\u002Fguide\u002Fquick-start","快速开始","。",[10,127,128,129,132,133,135],{},"StarterKit 已包含此能力，在 ",[16,130,131],{},"StarterKit.configure()"," 的 ",[16,134,16],{}," 子项中配置；设为 false 后才能单独安装同名替代。",[99,137,141],{"className":138,"code":139,"language":140,"meta":104,"style":104},"language-ts shiki shiki-themes github-light github-light github-dark","import { Code } from '@quirekit\u002Fextension-code'\n","ts",[16,142,143],{"__ignoreMap":104},[108,144,145,149,153,156],{"class":110,"line":111},[108,146,148],{"class":147},"sDD9d","import",[108,150,152],{"class":151},"sVPnS"," { Code } ",[108,154,155],{"class":147},"from",[108,157,159],{"class":158},"s-HEn"," '@quirekit\u002Fextension-code'\n",[10,161,162,163,125],{},"安装时按包声明选择兼容版本，外部可用版本以分发源为准。本站使用工作区 Alpha；许可标签来自入口所属包，使用条件见",[68,164,166],{"href":165},"\u002Fsupport","支持与许可",[25,168,169],{"id":169},"按编辑器接入",[10,171,172,173,176,177,180],{},"以下片段沿用已挂载的宿主元素 ",[16,174,175],{},"element","，宿主负责容器尺寸与保存；退出页面时调用 ",[16,178,179],{},"instance.destroy()","。已有预设装配的能力不要再重复追加；需要宿主端口的入口应先完成下方配置。",[182,183],"plugin-integration",{"name":184},"Code",[25,186,187],{"id":187},"配置",[10,189,190,191,125],{},"下面是扩展自身的默认选项。预设可以覆盖这些值；它们不等于当前文档属性。配置方法见",[68,192,194],{"href":193},"\u002Fplugins\u002Fconfiguration","配置插件",[196,197,199],"h3",{"id":198},"htmlattributes","HTMLAttributes",[10,201,202],{},"序列化 HTML 时合并的属性，例如 class。它不修改 Canvas 排版，也不是文档中节点属性的默认值。",[10,204,205,206],{},"类型：",[16,207,208],{},"Record\u003Cstring, unknown>",[10,210,211,212],{},"默认：",[16,213,214],{},"{}",[25,216,217],{"id":217},"命令与运行方式",[10,219,220,221,224],{},"以下命令由此扩展直接提供，均在当前 Editor 上调用。命令是否可用由已安装 schema、当前选区与保护策略决定；可以先用 ",[16,222,223],{},"editor.can()"," 查询。",[35,226,227,237],{},[38,228,229],{},[41,230,231,234],{},[44,232,233],{},"命令",[44,235,236],{},"参数签名",[54,238,239,251,263],{},[41,240,241,246],{},[59,242,243],{},[16,244,245],{},"setCode",[59,247,248],{},[16,249,250],{},"setCode()",[41,252,253,258],{},[59,254,255],{},[16,256,257],{},"toggleCode",[59,259,260],{},[16,261,262],{},"toggleCode()",[41,264,265,270],{},[59,266,267],{},[16,268,269],{},"unsetCode",[59,271,272],{},[16,273,274],{},"unsetCode()",[10,276,277,278,282],{},"这里只展示参数签名。接界面时见",[68,279,281],{"href":280},"\u002Fbuild\u002Fcommands","命令与控件","，正文变更继续经过同一事务与历史。",[25,284,285],{"id":285},"其他公开入口",[287,288,289],"ul",{},[290,291,292,19,294],"li",{},[16,293,184],{},[16,295,296],{},"@quirekit\u002Fstarter-kit",[25,298,299],{"id":299},"下一步",[10,301,302,303,307,308,310],{},"返回",[68,304,306],{"href":305},"\u002Fplugins","全部插件","，或阅读",[68,309,194],{"href":193},"区分配置、文档属性与命令。",[10,312,313,314,318,319,125],{},"自己定义能力时见",[68,315,317],{"href":316},"\u002Fbuild\u002Fextension","扩展开发","；搭建完整宿主时见",[68,320,322],{"href":321},"\u002Fbuild","构建产品",[324,325,326],"style",{},"html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .sDD9d, html code.shiki .sDD9d{--shiki-default:#D73A49;--shiki-light:#D73A49;--shiki-dark:#F97583}html pre.shiki code .sVPnS, html code.shiki .sVPnS{--shiki-default:#24292E;--shiki-light:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .s-HEn, html code.shiki .s-HEn{--shiki-default:#032F62;--shiki-light:#032F62;--shiki-dark:#9ECBFF}",{"title":104,"searchDepth":328,"depth":328,"links":329},2,[330,331,332,333,337,338,339],{"id":27,"depth":328,"text":27},{"id":97,"depth":328,"text":97},{"id":169,"depth":328,"text":169},{"id":187,"depth":328,"text":187,"children":334},[335],{"id":198,"depth":336,"text":199},3,{"id":217,"depth":328,"text":217},{"id":285,"depth":328,"text":285},{"id":299,"depth":328,"text":299},"md",[184,18,342,343,199,245,257,269,184,184],"行内代码","marks","zh-CN",{"navigationTitle":184,"license":23},true,69,"\u002Fplugins\u002Freference\u002Fcode","文字与样式",{"title":5,"description":12},"plugins\u002Freference\u002Fcode.zh-CN","LchusIJxkAs23Xt107inh_ik_Ww8-4vRjjlwwqJZVWM",1793045212006]