1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-31 19:01:54 +02:00

docs: convert examples to typescript (#3766)

* docs: convert examples to typescript

* docs: convert remaining examples

* docs: update next.js

* ci: fix lint

* docs: fix next.js path

* docs: cleanup

* update

Co-authored-by: wendellhu <wendellhu@tencent.com>
This commit is contained in:
Wendell Hu
2020-08-20 00:14:51 +08:00
committed by GitHub
parent 7b2b6df215
commit 912d4b79da
30 changed files with 1598 additions and 1028 deletions

11
site/pages/api/index.ts Normal file
View File

@@ -0,0 +1,11 @@
import { readdirSync } from 'fs'
import { join } from 'path'
const examplePath = join(process.cwd(), 'examples')
export function getAllExamples() {
const slugs = readdirSync(examplePath)
return slugs
.filter(name => name.match(/.tsx$/))
.map(n => n.replace(/.tsx$/, ''))
}