optimize readme.md

This commit is contained in:
wanxp 2022-10-31 22:54:38 +08:00
parent 62d140d380
commit 95147b3ee7
8 changed files with 104 additions and 55 deletions

141
README.md

@ -19,15 +19,65 @@
</a> </a>
</p> </p>
Import Movies, Books, Music, Teleplay, Note, Game even Broadcast Data from Douban in [Obsidian](https://obsidian.md/) Import Movie, Book, Music, Teleplay, Note, Game even Broadcast Data from Douban in [Obsidian](https://obsidian.md/)
在[Obsidian](https://obsidian.md/)使用并导入豆瓣中的电影/书籍/音乐/电视剧/日记/游戏甚至是广播, 包含评分/发布日期/演员表等信息
If you want some features or have any questions about this plugin, create issues or join the development is welcome. If you want some features or have any questions about this plugin, create issues or join the development is welcome.
关于当前的插件如果有任何疑问或者想要什么功能, 欢迎提issues或加入到开发当中.
---
在[Obsidian](https://obsidian.md/)使用并导入豆瓣中的电影/书籍/音乐/电视剧/日记/游戏甚至是广播, 包含评分/发布日期/演员表等信息
关于当前的插件如果有任何疑问, 缺少想要的导入内容或者想要什么功能, 欢迎提issues或加入到开发当中.
- [Bugs, Issues, & Feature Requests](https://github.com/Wanxp/obsidian-douban/issues) - [Bugs, Issues, & Feature Requests](https://github.com/Wanxp/obsidian-douban/issues)
- [Development Roadmap](https://github.com/users/Wanxp/projects/1) - [Development Roadmap](https://github.com/users/Wanxp/projects/1)
## Support Field/支持的字段
(若有字段缺失, 欢迎提issues反馈)
---
| 字段 | 电影 | 电视剧 | 书籍 | 音乐 | 日记 | 游戏 | 广播 |
| ------------- | -------------------- | -------------------- | -------------------- | ------------------ | -------- | ---------------- | ---- |
| id | 豆瓣ID | 豆瓣ID | 豆瓣ID | 豆瓣ID | 豆瓣ID | 豆瓣ID | - |
| title | 电影名称 | 电视剧名称 | 书名 | 音乐名 | 日记标题 | 游戏名称 | - |
| type | 类型 | 类型 | 类型 | 类型 | 类型 | 类型 | - |
| score | 评分 | 评分 | 评分 | 评分 | 评分 | 评分 | - |
| image | 封面 | 封面 | 封面 | 封面 | 图片 | 封面 | - |
| url | 豆瓣网址 | 豆瓣网址 | 豆瓣网址 | 豆瓣网址 | 豆瓣网址 | 豆瓣网址 | - |
| desc | 简介 | 简介 | 内容简介 | 简介 | 简介 | 简介 | - |
| publisher | - | - | 出版社 | 出版者 | 发布者 | 发行商 | - |
| datePublished | 上映日期 | 上映日期 | 出版年 | 发行时间 | 发布时间 | 发行日期 | - |
| genre | 类型 | 类型 | - | 流派 | - | 类型 | - |
| 扩展1 | director:导演 | director:导演 | author:原作者 | actor: 表演者 | author:作者 | aliases:别名 | |
| 扩展2 | author:编剧 | author:编剧 | translator:译者 | albumType:专辑类型 | authorUrl:作者网址 | developer:开发商 | |
| 扩展3 | actor:主演 | actor:主演 | isbn:isbn | medium:介质 | content:日记内容 | platform:平台 | |
| 扩展4 | originalTitle:原作名 | originalTitle:原作名 | originalTitle:原作名 | records:唱片数 | | | |
| 扩展5 | | | subTitle:副标题 | barcode:条形码 | | | |
| 扩展6 | | | totalPage:页数 | | | | |
| 扩展7 | | | series:丛书 | | | | |
| 扩展8 | | | menu:目录 | | | | |
| 扩展9 | | | price:定价 | | | | |
| 扩展7 | | | binding:装帧 | | | | |
## How to use
### Search
- Search Data By File Name
通过当前文件名搜索
![Search Movie By File Name](./doc/search_by_file_name.gif)
- Search Movie By Input Text
通过输入文本搜索
![Search Movie By Input Text](./doc/search_by_input.gif)
## Settings
- Setting Example1(Custom Template)
设置案例1(自定义模板)
![Setting Example1](./doc/setting_zh.gif)
- Setting Example2(Other Settings)
设置案例2(其它配置)
![Setting Example2](./doc/setting_en.gif)
## Target ## Target
- [x] Movie/电影 - [x] Movie/电影
@ -38,47 +88,50 @@ If you want some features or have any questions about this plugin, create issues
- [x] Game/游戏 - [x] Game/游戏
- [ ] Broadcast/广播 - [ ] Broadcast/广播
## How to use ## How to install
### Search ### From Obsidian
- Search Movie By File Name/通过文件名搜索 1. Go to Obsidian plugin center
![Search Movie By File Name](./doc/search_by_file_name.gif) 2. Search obsidian-douban
3. Click install
4. Enable plugin
---
### 从Obsidian插件中心
1. 进入Obsidian插件中心
2. 搜索obsidian-douban
3. 安装
4. 开启插件
- Search Movie By Input Text/通过输入文本搜索
![Search Movie By Input Text](./doc/search_by_input.gif)
## Settings
- Setting Example1/设置案例1
![Setting Example1](./doc/setting_zh.gif)
- Setting Example2/设置案例2
![Setting Example2](./doc/setting_en.gif)
## How to install
### From Obsidian
1. Go to Obsidian plugin center/进入Obsidian插件中心
2. Search obsidian-douban/搜索obsidian-douban
3. Click install/安装
4. Enable plugin/开启插件
### Manmel ### Manmel
1. Download `main.js`, `manifest.json`, `styles.css` from GitHub release page 1. Download `main.js`, `manifest.json`, `styles.css` from GitHub release page
从Github release 页面下载 `main.js`, `manifest.json`, `styles.css` 2. Copy step1 downloaded file to your vault folder `/.obsidian/plugins/obsidian-douban/`
2. Copy step1 downloaded file to your vault folder `/.obsidian/plugins/obsidian-douban/` 3. Enable plugin in Obsidian
将下载的文件复制到你的Obsidian文档根目录下的`/.obsidian/plugins/obsidian-douban`路径,若不存在则新建文件夹(注意.obsidian文件夹可能是个隐藏为文件夹) ----
3. Enable plugin in Obsidian ### 手动安装
在obsidian插件中心开启当前插件功能 1. 从Github release 页面下载 `main.js`, `manifest.json`, `styles.css`
2. 将下载的文件复制到你的Obsidian文档根目录下的`/.obsidian/plugins/obsidian-douban`路径,若不存在则新建文件夹(注意.obsidian文件夹可能是个隐藏为文件夹)
3. 在obsidian插件中心开启当前插件功能
## How to Develop ## How to Develop
1. Enter your test vault folder `/.obsidian/plugins/` 1. Enter your test vault folder `/.obsidian/plugins/`
进入你的Obsidian测试文档文件夹下的`/.obsidian/plugins/` 2. Clone Code
2. Clone Code/克隆代码 `git clone git@github.com:Wanxp/obsidian-douban.git`
`git clone git@github.com:Wanxp/obsidian-douban.git` 3. Enter folder
3. Enter folder/进入代码文件夹 `cd obsidian-douban`
`cd obsidian-douban` 4. Build
4. Build/构建 `npm run build`
`npm run build` 5. Run and Watch code chang
5. Run and Watch code change/运行 `npm run dev`
`npm run dev` 6. Go to your Obsidian plugin center reload this plugin
6. Go to your Obsidian plugin center reload this plugin 7. Enjoy your develop
进入Obsidian插件中心重新加载当前插件 ---
7. Enjoy your develop 1. 进入你的Obsidian测试文档文件夹下的`/.obsidian/plugins/`
享受开发吧 2. 克隆代码
`git clone git@github.com:Wanxp/obsidian-douban.git`
3. 进入代码文件夹
`cd obsidian-douban`
4. 构建
`npm run build`
5. 运行
`npm run dev`
6. 进入Obsidian插件中心重新加载当前插件
7. 享受开发吧

@ -81,7 +81,7 @@ datePublished: {{datePublished}}
publisher: {{publisher}} publisher: {{publisher}}
barcode: {{barcode}} barcode: {{barcode}}
url: {{url}} url: {{url}}
numberOfRecords: {{numberOfRecords}} records: {{records}}
tags: Music tags: Music
desc: {{desc}} desc: {{desc}}
--- ---

@ -21,7 +21,7 @@ export default class DoubanMusicLoadHandler extends DoubanAbstractLoadHandler<Do
.replaceAll("{{barcode}}", extract.barcode ? extract.barcode : "") .replaceAll("{{barcode}}", extract.barcode ? extract.barcode : "")
.replaceAll("{{medium}}", extract.medium ? extract.medium : "") .replaceAll("{{medium}}", extract.medium ? extract.medium : "")
.replaceAll("{{albumType}}", extract.albumType ? extract.albumType : "") .replaceAll("{{albumType}}", extract.albumType ? extract.albumType : "")
.replaceAll("{{numberOfRecords}}", extract.numberOfRecords ? extract.numberOfRecords + "" : "") .replaceAll("{{records}}", extract.records ? extract.records + "" : "")
; ;
} }
@ -62,7 +62,7 @@ export default class DoubanMusicLoadHandler extends DoubanAbstractLoadHandler<Do
datePublished: valueMap.has('datePublished') ? new Date(valueMap.get('datePublished')) : undefined, datePublished: valueMap.has('datePublished') ? new Date(valueMap.get('datePublished')) : undefined,
publisher: valueMap.has('publisher') ? valueMap.get('publisher') : "", publisher: valueMap.has('publisher') ? valueMap.get('publisher') : "",
score: Number(score), score: Number(score),
numberOfRecords: valueMap.has('numberOfRecords') ? Number(valueMap.get('numberOfRecords')) : null, records: valueMap.has('records') ? Number(valueMap.get('records')) : null,
id: id ? id[0] : "", id: id ? id[0] : "",
type: "Music", type: "Music",
title: title, title: title,
@ -88,6 +88,6 @@ const MusicKeyValueMap: Map<string, string> = new Map(
['专辑类型:', 'albumType'], ['专辑类型:', 'albumType'],
['介质:', 'medium'], ['介质:', 'medium'],
['出版者:', 'publisher'], ['出版者:', 'publisher'],
['唱片数:', 'numberOfRecords'], ['唱片数:', 'records'],
['条形码:', 'barcode']] ['条形码:', 'barcode']]
); );

@ -7,7 +7,6 @@ export default class DoubanMovieSubject extends DoubanSubject {
author: Person[]; author: Person[];
actor: Person[]; actor: Person[];
aggregateRating: AggregateRating; aggregateRating: AggregateRating;
genre: string[];
originalTitle: string; originalTitle: string;
} }

@ -4,6 +4,6 @@ export default class DoubanMusicSubject extends DoubanSubject {
actor: string[]; actor: string[];
albumType: string; albumType: string;
medium: string; medium: string;
numberOfRecords: number; records: number;
barcode: string; barcode: string;
} }

@ -7,8 +7,5 @@ export default class DoubanTeleplaySubject extends DoubanSubject {
author: Person[]; author: Person[];
actor: Person[]; actor: Person[];
aggregateRating: AggregateRating; aggregateRating: AggregateRating;
datePublished: Date;
image: string;
genre: string[];
originalTitle: string; originalTitle: string;
} }

@ -40,7 +40,7 @@ export default {
'120304': `{{id}}, {{title}}, {{type}}, {{score}}, {{image}},`, '120304': `{{id}}, {{title}}, {{type}}, {{score}}, {{image}},`,
'120305': `{{url}}, {{desc}}, {{datePublished}}, {{genre}},`, '120305': `{{url}}, {{desc}}, {{datePublished}}, {{genre}},`,
'120306': `{{actor}}, {{medium}}, {{albumType}},`, '120306': `{{actor}}, {{medium}}, {{albumType}},`,
'120307': `{{barcode}}, {{numberOfRecords}}`, '120307': `{{barcode}}, {{records}}`,
'120401': `Article Content Template`, '120401': `Article Content Template`,
'120402': `Set markdown Article template for extract to be inserted.`, '120402': `Set markdown Article template for extract to be inserted.`,

@ -42,7 +42,7 @@ export default {
'120304': `{{id}}, {{title}}, {{type}}, {{image}},`, '120304': `{{id}}, {{title}}, {{type}}, {{image}},`,
'120305': `{{url}}, {{desc}}, {{datePublished}}`, '120305': `{{url}}, {{desc}}, {{datePublished}}`,
'120306': `{{genre}}, {{actor}}, {{medium}}, {{albumType}},`, '120306': `{{genre}}, {{actor}}, {{medium}}, {{albumType}},`,
'120307': `{{barcode}}, {{numberOfRecords}}`, '120307': `{{barcode}}, {{records}}`,
'120401': `日记文本模板`, '120401': `日记文本模板`,
'120402': `设置选择日记后导入的文本内容模板,`, '120402': `设置选择日记后导入的文本内容模板,`,