Skip to content

Commit

Permalink
docs: 修改了文档,添加教程
Browse files Browse the repository at this point in the history
- 更新了项目的README文件,增加了详细的使用说明。
- 添加了一个新的教程部分。
- 修正了一些文档中的错别字和格式问题。
  • Loading branch information
Sorceresssis committed Jul 6, 2024
1 parent cbefc70 commit 4991b12
Show file tree
Hide file tree
Showing 19 changed files with 449 additions and 624 deletions.
26 changes: 5 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
<h1 align="center">Echo</h1>

#### 介绍
## 介绍

**Echo** 是一款强大的信息记录软件,为用户提供了便捷的方式来管理他们的数据和信息。用户可以为每个记录添加网络链接和指向本地资源的路径,使信息的组织和访问更加高效。

#### 特点
## 特点

1. **不依赖本地数据资源:** Echo 不要求用户将记录绑定到本地路径,而是允许用户在互联网上搜索记录的标题或者添加一个网络链接,将整个互联网作为您的数据库。
1. **不依赖本地数据资源:** Jellyfin、emby 这些个人媒体工具都需要本地有媒体文件才构建库。Echo 不要求用户将记录绑定到本地路径,而是允许用户在互联网上搜索记录的标题或者添加一个网络链接,将整个互联网作为您的数据库。
2. **多维度信息管理:** 每个记录都可以添加标签和作者信息,使用户能够进行高效的数据检索。此外,您还可以为记录添加封面,提供更直观和可视化的展示效果。
3. **集中管理分散的数据:** Echo 能够将分散在不同路径下的数据整合在一起,使用户更方便地访问数据。即使这些文件被移动到不同的位置,只需更新文件所在目录即可。
4. **自由导入和导出数据:** 您可以自由导入和导出数据,以便与他人分享、备份或迁移数据。

#### 使用案例
## 使用案例

1. **建立个人媒体库和收藏夹:** 利用 Echo,您可以轻松创建个人媒体库和收藏夹,集中管理您喜欢的内容,无论是漫画、电影或其他媒体。
2. **管理喜欢的网页内容:** 在浏览网站时,您可能会发现有趣的内容,但某些网站可能不提供强大的收藏功能,或者您的喜欢的内容分散在多个网站上。Echo 可帮助您记录网页链接、添加封面和标签,以便更轻松地找到所需内容。此外,考虑到网络上的内容可能会被删除,Echo 还可以帮助您有效地管理下载的内容,确保随时访问。

#### 注意事项
## 注意事项

1. **记录数量建议在 20 万以内:** 因为 Echo 搜索的实现原理是去遍历所有的数据,记录量越多,搜索的就越慢。如果记录实在太多,可以创建一个新库。这是因为 Echo 面向个人用户,数据量通常不会很大。个人用户通常更看重搜索结果的精确性,而高效的查找方法会降低精确度。

Expand All @@ -36,22 +36,6 @@
<img src="./screenshots/6.png" style="border: 1px solid #999;" />
</div>

#### 编译 better-sqlite3

```
npm install
npm install -g node-gyp
node_modules/.bin/electron-rebuild -f -w better-sqlite3
```

#### 添加功能

1. 添加暴露给搜索的文本
2. translate title

#### 使用教程

要注意 同一文件夹下的 同名文件和文件夹的冲突,因为数据库无法判断时文件夹还是文件。

[普通用户](./docs/user-guide/index.md)
45 changes: 0 additions & 45 deletions SQL/library/DQL.sql

This file was deleted.

103 changes: 103 additions & 0 deletions docs/dev/electron.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
# Electron

## Better-sqlite3

### 注意事项

1. Select 字句的字段名不能用 `''` 包裹
2. get()空结果为 undefined 不是 null

### 编译

better-sqlite3 是 Node.js 包,不是 Electron 包。所以需要使用 [@electron/rebuild](https://github.com/electron/rebuild) 来编译成 Electron 可以使用的包。

> **注意**
>
> 原来的 electron-rebuild 已经弃用。现在由 @electron/rebuild 代替
安装依赖

```powershell
# 安装依赖
# @electron/rebuild 依赖 node-gyp
npm install -g node-gyp
npm install --save-dev @electron/rebuild
```

windows 终端直接编译

```powershell
node_modules/.bin/electron-rebuild -f -w better-sqlite3
```

可以可以用 npm 编译
先再 package.json 中添加

```json
"scripts": {
"rebuild": "electron-rebuild -f -w yourmodule"
}
```

然后再终端运行

```powershell
npm run rebuild
```

## 路径处理

### 路径保存

保存的路径要统一去除最外的分隔符

```powershell
# 正确
C:\
C:\bar\foor
# 错误
C:.
C:\bar\boor\
```

### node:path 的 resolve, join, normalize

#### windows 盘符

```js
const p1 = "C";
const p2 = "C:";
const p3 = "C:.";
const p4 = "C:\\";

// resolve
// ${__dirname}\C
// C:\
// C:\
// C:\

// join 、normalize
// C
// C:.
// C:.
// C:\
```

#### 最外层分隔符

> C:\
>
> C:\user\
>
> C:\user
path.resolve() 不会保留最外部的分隔符

path.normalize() 会保留最外的分隔符

#### 结论

对要保存的路径做 resolve 处理, 因为盘符处理是一致的,路径统一去除最外的分隔符

对路径截取操作适合使用 normlize,对分隔符的保留使得路径比对更方便。
9 changes: 9 additions & 0 deletions docs/dev/render.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Render

## z-index 表

| 组件 | z-index | 使用次数 |
| --------------- | ------- | -------- |
| 右键菜单 | 3000 | 2 |
| backtop | 1000 | 1 |
| check-container | 100 | 1 |
4 changes: 3 additions & 1 deletion docs/import_from_metadata.md
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
echo metadata json 格式如下

[echo metadata echema](../src/main/constant/echo_metadata_schema.ts)
34 changes: 0 additions & 34 deletions docs/metajson.md

This file was deleted.

Binary file removed docs/user-guide/image/index/1699727410446.png
Binary file not shown.
Binary file removed docs/user-guide/image/index/1699727757969.png
Binary file not shown.
Binary file removed docs/user-guide/image/index/1699727789007.png
Binary file not shown.
73 changes: 0 additions & 73 deletions docs/user-guide/index.md

This file was deleted.

41 changes: 0 additions & 41 deletions note/main.md

This file was deleted.

Loading

0 comments on commit 4991b12

Please sign in to comment.