rdyl-tools
v0.0.6
Published
- `DocsHelper.read` 读取内容并返回 html内容 ```ts import { DocsHelper } from 'rdyl-tools/docs' const content = 'md 文件内容' const __html__ = DocsHelper.read(content) ```
Downloads
76
Readme
docs
DocsHelper.read
读取内容并返回 html内容
import { DocsHelper } from 'rdyl-tools/docs'
const content = 'md 文件内容'
const __html__ = DocsHelper.read(content)
DocsHelper.readdirDocTitles
读取内容并返回 titles 索引
import { DocsHelper } from 'rdyl-tools/docs'
const content = 'md 文件内容'
const titles = DocsHelper.readdirDocTitles(content)
request 基于axios
CreateRequest
import { CreateRequest } from 'rdyl-tools/request';
const baseURL = '';
const { request, toRestful } = CreateRequest(baseURL, {
beforeRequest(config) {
return config;
},
fail(error) {
return Promise.reject(error);
},
success(response) {
if (response.config.responseType !== 'json') {
return response.data.data;
}
return response.data;
},
});