Ant Design Style Dumi ThemeAnt Design Style Dumi Theme
Guide
Components
Config
Changelog
⌘ K

Table of Contents

Code Highlighters Built into the Theme Pack
shiki Highlight Examples
TSX Highlighting
Diff
Introduction
Introduction
Progress
Advanced Features
Theme
Features
Builtin Theme Components
Code Highlighting
Demo Development
ApiHeader
Page Tab
Table of Contents (TOC)
PREV
Builtin Theme Components
NEXT
Demo Development

相关资源

Ant Design
Ant Design Pro
Ant Design Pro Components
Umi-React 应用开发框架
Dumi-组件/文档研发工具
qiankun-微前端框架

社区

Medium
Twitter
yuqueAnt Design 语雀专栏
Ant Design 知乎专栏
体验科技专栏
seeconfSEE Conf-SEE Conf-蚂蚁体验科技大会

帮助

GitHub
更新日志
讨论

more products更多产品

yuque语雀-知识创作与分享工具
AntVAntV-数据可视化解决方案
EggEgg-企业级 Node.js 框架
kitchenKitchen-Sketch 工具集
xtech蚂蚁体验科技
Copyright © 2022-2024
Made with ❤️ by 蚂蚁集团 - AFX & 数字科技
‌
‌
‌
‌

SyntaxHighlighter Code Highlighting

Code Highlighters Built into the Theme Pack

This theme pack provides two built-in code highlighters for you to use:

  • Prism
  • Shiki

Prism is one of the most popular syntax highlighters. It inserts tags into the code text to wrap the elements that need to be highlighted and sets the highlight style through a CSS file. You can use the themes officially provided by Prism directly, or quickly create your own highlight theme through prism-theme-vars.

Shiki is a code highlighter based on TextMate syntax. It directly generates styled wrapping elements, so no additional CSS files are required. Because it is based on TextMate syntax, the generated highlight blocks are very accurate and similar to VS Code. At the same time, this also means that shiki can support any vscode theme pack. Shiki also provides many preset themes. However, shiki needs to customize the highlight through TextMate themes, which can be more troublesome.

You can choose which highlighter to use yourself:

  • Prism is easier to customize the style
  • Shiki generates more accurate highlight blocks

By default, this theme pack uses shiki, and you can modify the settings in frontmatter:

markdown

shiki Highlight Examples

TSX Highlighting

tsx

Diff

diff