docs theme
打印项目设置的所有外观选项。没有草稿:命令返回后,更改就会立即显示在你的文档网站上,与在 API Studio 中保存的效果相同。参见外观。
bash
octri docs theme [show | set key=value …]octri docs theme set key=value …
更改一个或多个设置,并保留其余设置。值均为文本,只有 true 和 false 用于开启或关闭某项功能。@ 从文件读取值,例如 css=@docs.css。带点的键可设置另一个字段中的字段,例如 defaultAuth.type=bearer。
如果遇到未知键,API 会忽略它,而不会报错。因此,命令会比较发送的内容和保存的内容,并指出被丢弃的键。拼写错误不会被误当成保存成功。
参数
key=valuestring必填一个或多个设置。
| 值 | 含义 |
|---|---|
primaryColor logoUrl logoUrlDark logoHref showLogo faviconUrl | 品牌 |
colorScheme showThemeToggle | 浅色和深色 |
layout contentWidth borderRadius | 布局 |
fontFamily headingFont codeFont googleFontFamily googleHeadingFont googleCodeFont | 字体 |
sidebarTextSize contentTextSize codeTextSize | 文字大小 |
navbarLayout navbarSurface navbarColor navbarColorDark searchPlacement | 顶栏 |
sidebarStyle sidebarWidth sidebarResizable showSidebarLines showSidebarIcons | 侧边栏 |
codeTheme codeThemeDark showToc showGuideToc | 代码和大纲 |
repoUrl repoStarsEnabled | 代码仓库链接 |
示例
显示外观
bash
octri docs themeOutput
✔ Loading theme
Docs appearance
borderRadius default
codeFont jetbrains-mono
codeTextSize smaller
codeTheme octri
colorScheme system
contentTextSize large
contentWidth default
customCss not set
faviconRasterUrl not set
faviconUrl not set
fontFamily manrope
googleCodeFont not set
googleFontFamily not set
…更改多个设置
bash
octri docs theme set primaryColor=#ff6a00 colorScheme=dark codeTheme=nord相关内容
octri docs buttons:添加或移除顶栏右侧的按钮。octri docs socials:设置显示在每个页面底部的社交链接。octri docs custom-code:在每个文档页面加载你自己的 CSS 和 HTML。