[TOC]
請參考:Code Surfer
npm init code-surfer-deck my-code
cd my-code
npm start
Code-Surfer 是透過 Prism.js
來解析不同的語言,其中 Prism
有支援 Swift
在 deck.mdx
的開頭要加入
import "prismjs/components/prism-swift"
就可以使用
```swift
protocol Smaller {
func smaller() -> Self?
}
```
deck.mdx
的開頭可以加入這些,使用不同的內建主題
import { github, nightOwl } from "@code-surfer/themes";
export const theme = nightOwl;
或者
<CodeSurfer theme={nightOwl}>
</CodeSurfer>
my-deck/node_modules/@code-surfer/themes/dist
https://github.com/jxnblk/mdx-deck/blob/master/docs/themes.md
import { big } from "@mdx-deck/themes";
export const theme = big;
This project was generated with the npm init code-surfer-deck
command.
To run the presentation deck in development mode:
npm start
Edit the deck.mdx
file to get started.
To build the presentation deck:
npm run build
For more documentation see MDX Deck and Code Surfer