@uni-docs/utils
v1.0.8
Published
Utils for docs
Downloads
4
Readme
doc-utils
Description
Utils for the docs of the web:
- Batch Create Docs: auto create docs, such as Yuque
- Docs Convert: Convert data from Diary & Book to Standard, such as Mini Diary/eDiary
Installation
Using npm:
$ npm i --save @uni-docs/utils
Usage
In Node.js:
import { getDataFromMiniDiary } from '@uni-docs/utils'
// Data export from Mini Diary
const miniDiaryData = {
"metadata": {
"application": "Mini Diary",
"version": "3.3.0",
"dateUpdated": "Tue Jan 23 2024 16:52:04 GMT+0800"
},
"entries": {
"2022-03-17": {
"dateUpdated": "Thu Mar 17 2022 16:54:10 GMT+0800",
"title": "",
"text": "This is the content"
}
}
}
const data = getDataFromMiniDiary(miniDiaryData);
console.info(data);
/**
{
version: 'v1',
from: 'Mini Diary',
lastModified: 1705999924000,
data: {
'2022-03-17': {
content: 'This is the content',
createdTime: 1647507250000,
updatedTime: 1647507250000,
title: ''
}
}
}*/
API
| Name | Params | Description | |--|--|--| | getDataFromMiniDiary | miniDiaryData, { version = 'v1' } = {} | Convert Mini Diary data to Standard |
References
- Mini Diary: https://minidiary.app/
- eDiary: http://www.haoxg.net/ediary/index.html