-
-
Notifications
You must be signed in to change notification settings - Fork 435
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: reorg guide and reference sidebar (#6115)
- Loading branch information
1 parent
0eb046d
commit 3a6ab05
Showing
62 changed files
with
260 additions
and
250 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,210 @@ | ||
import { DefaultTheme, defineConfig } from 'vitepress'; | ||
import wasm from 'vite-plugin-wasm'; | ||
import container from 'markdown-it-container'; | ||
import { renderSandbox } from 'vitepress-plugin-sandpack'; | ||
|
||
const guide: DefaultTheme.NavItem[] = [ | ||
{ | ||
text: 'Getting Started', | ||
items: [ | ||
{ text: 'Overview', link: 'guide/overview' }, | ||
{ text: 'Quick Start', link: 'guide/quick-start' }, | ||
], | ||
}, | ||
{ | ||
text: 'Framework Tutorial', | ||
items: [ | ||
{ text: 'Component Types', link: 'guide/component-types' }, | ||
{ | ||
text: 'Working with Block Tree', | ||
// @ts-ignore | ||
link: 'guide/working-with-block-tree', | ||
items: [ | ||
{ | ||
text: 'Block Tree Basics', | ||
link: 'guide/working-with-block-tree#block-tree-basics', | ||
}, | ||
{ | ||
text: 'Block Tree in Editor', | ||
link: 'guide/working-with-block-tree#block-tree-in-editor', | ||
}, | ||
{ | ||
text: 'Selecting Blocks', | ||
link: 'guide/working-with-block-tree#selecting-blocks', | ||
}, | ||
{ | ||
text: 'Service and Commands', | ||
link: 'guide/working-with-block-tree#service-and-commands', | ||
}, | ||
{ | ||
text: 'Defining New Blocks', | ||
link: 'guide/working-with-block-tree#defining-new-blocks', | ||
}, | ||
], | ||
}, | ||
{ text: 'Data Synchronization', link: 'guide/data-synchronization' }, | ||
], | ||
}, | ||
{ | ||
text: 'Editor In-Depth', | ||
items: [ | ||
// { text: 'Design Philosophy', link: 'guide/design-philosophy' }, | ||
{ | ||
text: 'CRDT-Native Data Flow', | ||
link: 'guide/crdt-native-data-flow', | ||
}, | ||
], | ||
}, | ||
{ | ||
text: 'API Walkthrough', | ||
items: [ | ||
{ | ||
text: '<code>block-std</code>', | ||
items: [ | ||
{ | ||
text: 'Block Spec', | ||
link: 'guide/block-spec', | ||
// @ts-ignore | ||
items: [ | ||
{ text: 'Block Schema', link: 'guide/block-schema' }, | ||
{ text: 'Block Service', link: 'guide/block-service' }, | ||
{ text: 'Block View', link: 'guide/block-view' }, | ||
{ text: 'Block Widgets', link: 'guide/block-widgets' }, | ||
], | ||
}, | ||
{ | ||
text: 'Selection', | ||
link: 'guide/selection', | ||
}, | ||
{ text: 'Event', link: 'guide/event' }, | ||
{ text: 'Command', link: 'guide/command' }, | ||
], | ||
}, | ||
{ | ||
text: '<code>store</code>', | ||
items: [ | ||
{ text: 'Page', link: 'guide/store#page' }, | ||
{ text: 'Workspace', link: 'guide/store#workspace' }, | ||
{ text: 'Slot', link: 'guide/slot' }, | ||
{ text: 'Adapter', link: 'guide/adapter' }, | ||
], | ||
}, | ||
{ | ||
text: '<code>inline</code>', | ||
link: 'guide/inline', | ||
}, | ||
{ | ||
text: '<code>lit</code>', | ||
link: 'guide/lit', | ||
}, | ||
], | ||
}, | ||
{ | ||
text: 'Developing BlockSuite', | ||
items: [ | ||
{ | ||
text: 'Building Packages', | ||
link: '//github.com/toeverything/blocksuite/blob/master/BUILDING.md', | ||
}, | ||
{ | ||
text: 'Running Tests', | ||
link: '//github.com/toeverything/blocksuite/blob/master/BUILDING.md#testing', | ||
}, | ||
], | ||
}, | ||
]; | ||
|
||
const reference: DefaultTheme.NavItem[] = [ | ||
{ | ||
text: 'API Reference', | ||
items: [ | ||
{ text: '@blocksuite/store', link: 'api/@blocksuite/store/index' }, | ||
{ | ||
text: '@blocksuite/block-std', | ||
link: 'api/@blocksuite/block-std/index', | ||
}, | ||
{ text: '@blocksuite/lit', link: 'api/@blocksuite/lit/index' }, | ||
{ text: '@blocksuite/inline', link: 'api/@blocksuite/inline/index' }, | ||
{ | ||
text: '@blocksuite/presets', | ||
link: 'api/@blocksuite/presets/index', | ||
}, | ||
{ text: '@blocksuite/blocks', link: 'api/@blocksuite/blocks/index' }, | ||
], | ||
}, | ||
]; | ||
|
||
// https://vitepress.dev/reference/site-config | ||
export default defineConfig({ | ||
vite: { | ||
build: { | ||
target: 'ES2022', | ||
}, | ||
plugins: [wasm()], | ||
}, | ||
lang: 'en-US', | ||
title: 'BlockSuite', | ||
description: 'The Editor Framework', | ||
themeConfig: { | ||
// https://vitepress.dev/reference/default-theme-config | ||
nav: [ | ||
{ | ||
text: 'Presets', | ||
items: [ | ||
{ text: '📝 DocEditor', link: '/presets/doc-editor' }, | ||
{ text: '🎨 EdgelessEditor', link: '/presets/edgeless-editor' }, | ||
], | ||
}, | ||
{ text: 'Guide', link: '/guide/overview' }, | ||
{ text: 'API', link: '/api/' }, | ||
// { text: 'Blog', link: '#' }, | ||
{ | ||
text: 'Releases', | ||
link: 'https://github.com/toeverything/blocksuite/releases', | ||
}, | ||
], | ||
|
||
sidebar: { | ||
'/guide/': { base: '/', items: guide }, | ||
'/api/': { base: '/', items: reference }, | ||
}, | ||
|
||
socialLinks: [ | ||
{ icon: 'github', link: 'https://github.com/toeverything/blocksuite' }, | ||
{ | ||
icon: { | ||
svg: '<svg role="img" xmlns="http://www.w3.org/2000/svg" height="16" width="16" viewBox="0 0 512 512"><!--!Font Awesome Free 6.5.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2023 Fonticons, Inc.--><path fill="#777777" d="M389.2 48h70.6L305.6 224.2 487 464H345L233.7 318.6 106.5 464H35.8L200.7 275.5 26.8 48H172.4L272.9 180.9 389.2 48zM364.4 421.8h39.1L151.1 88h-42L364.4 421.8z"/></svg>', | ||
}, | ||
link: 'https://twitter.com/AffineDev', | ||
}, | ||
], | ||
|
||
footer: { | ||
copyright: 'Copyright © 2022-present Toeverything', | ||
}, | ||
|
||
search: { | ||
provider: 'local', | ||
}, | ||
}, | ||
head: [ | ||
[ | ||
'link', | ||
{ | ||
rel: 'icon', | ||
type: 'image/png', | ||
sizes: '32x32', | ||
href: 'https://raw.githubusercontent.com/toeverything/blocksuite/master/assets/logo.svg', | ||
}, | ||
], | ||
], | ||
markdown: { | ||
config(md) { | ||
md.use(container, 'code-sandbox', { | ||
render(tokens, idx) { | ||
return renderSandbox(tokens, idx, 'code-sandbox'); | ||
}, | ||
}); | ||
}, | ||
}, | ||
}); |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
3a6ab05
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
blocksuite – ./packages/playground
try-blocksuite.vercel.app
blocksuite-toeverything.vercel.app
blocksuite-git-master-toeverything.vercel.app
3a6ab05
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
blocksuite-docs – ./packages/docs
blocksuite-docs-git-master-toeverything.vercel.app
blocksuite-docs-toeverything.vercel.app
blocksuite.io
blocksuite.affine.pro
blocksuite-docs.vercel.app
block-suite.com