document solution: three steps to build your own documents site.
web
search | String | /api/v1/search |
search route |
noHeader | bool | true | header |
onlyDoc | bool | true | header |
view | String | '/help.html' |
|
prefix | String | '/documents' |
|
title | String | title | |
logo | String | https://gw.alipayobjects.com/mdn/prod_resou/afts/img/A*OwZWQ68zSTMAAAAAAAAAAABkARQnAQ | logo |
showSearch | String | true | |
lazyLoad | bool | false | |
showEditor | bool | false | icon |
token | String | '' | token |
darkMode | bool | true | header dark/light |
lightColor | String | '#ffffff00' | header light |
blackColor | String | 'black' | header dark |
exports.yuqueViewer = {
enable: true,
package: '@ablula/egg-yuque-viewer',
};
config.yuqueViewer = {
npm: '@ablula/[email protected]',
namespace: 'ant-design/course',
search: '/documents/search',
title: 'Ant Design ',
prefix: '/documents',
onlyDoc: false,
noHeader: false,
showSearch: true,
showEditor: false,
view: '/documents',
token: '',
darkMode: true,
lightColor: '#ffffff00',
blackColor: 'black',
logo: 'https://gw.alipayobjects.com/mdn/prod_resou/afts/img/A*OwZWQ68zSTMAAAAAAAAAAABkARQnAQ',
};
view http://localhost:3333
view /documents
url http://localhost:3333/documents
await app.yuqueViewer.search('let');
// return
{
data: [
{
category: "",
content: "<p>asdf</p>",
locator: "/design/doc/7",
siteId: 1,
title: ""
},
{
category: "",
content: "<pre><code>let a=b;</code></pre>",
locator: "/component/doc/12",
siteId: 1,
title: "newdocs"
}
],
total: 2
}