This repo contains the website configuration and documentation powering the Towhee docs website.
cd towhee-docs
to go into the project root.yarn
to install the website's workspace dependencies.
yarn start
to start the development server (powered by Docusaurus).open http://localhost:3000/
to open the site in your favorite browser.
-
All our documentation is generated from markdown files you can find in the
docs
directory. If the program is already running locally, everytime you change the file, you can visithttp://localhost:3000/YOUR-DOCS-PAGE
to see your work. -
Add a new doc
- Create a new markdown file and put it under the
docs
directory - At the top of file, specify
id
andtitle
in the front matter.title
will be default sidebar label, you can setsidebar_label
to overwrite it.
--- id: first-pipeline title: Running your first pipeline sidebar_label: Hello pipeline ---
- Create a new markdown file and put it under the
-
Update sidebar
- Take a look at the
sidebar.js
file - In
sidebars
object,doc
represents menus on the left which is listed in order, you can switch item's position to change order. - If you want to add a new nested menu, just push a new key-value pair to
doc
list. If you just want to add a new link, you only need to insert that markdown'sid
to the list.
Attention: If your markdown isn't placed in the root directory, you should add the name of the folder it is in before id, like 'folder-name/markdown-id'.
docs: [ // add new nested menu in sidebar example { 'parent-menu-label': [ 'parent-folder/child-content-id-1', 'parent-folder/child-content-id-2', ], }, // add new link in sidebar example 'quick-start', ];
- Take a look at the
-
In most cases, you needn't use custom components in markdown, but if you do, change the file extension from
md
tomdx
so you can write JSX in markdown files and render them as React components easily. For more, please refer to https://docusaurus.io/docs/markdown-features/react. -
If you want to use code block, please specify language, otherwise the code highlighting will not take effect.
```javascript
doc: [{
key: value
}]
```
Our doc website is a static site generated using Docusaurus. Please make sure you have been familiar with it before contributing.