Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
# Conflicts:
#	.github/CONTRIBUTING.md
#	.github/CONTRIBUTING_zh_CN.md
#	.github/workflows/dockerimage.yml
#	app/src/sync/syncGuide.ts
#	app/src/util/needSubscribe.ts
#	kernel/go.mod
#	kernel/go.sum
#	kernel/model/conf.go
  • Loading branch information
appdev committed Jan 16, 2024
2 parents 9a1e2f6 + f6651fb commit 6a629f1
Show file tree
Hide file tree
Showing 299 changed files with 16,366 additions and 6,635 deletions.
63 changes: 63 additions & 0 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
[中文](CONTRIBUTING_zh_CN.md)

## Get the source code

* `git clone --depth=1 [email protected]:siyuan-note/siyuan.git`
* switch to dev branch `git checkout dev`

Note: `app/stage/protyle/**` is managed by git lfs, and you don't need to pay attention to it under normal circumstances, related to [#9253](https://github.com/siyuan-note/siyuan/issues/9253).

## User Interface

Install pnpm: `npm install -g pnpm`

<details>
<summary>For China mainland</summary>

Set the Electron mirror environment variable and install Electron:

* macOS/Linux: `ELECTRON_MIRROR=https://cnpmjs.org/mirrors/electron/ pnpm install [email protected] -D`
* Windows:
* `SET ELECTRON_MIRROR=https://cnpmjs.org/mirrors/electron/`
* `pnpm install [email protected] -D`

NPM mirror:

* Use npmmirror China mirror repository `pnpm --registry https://r.cnpmjs.org/ i`
* Revert to using official repository `pnpm --registry https://registry.npmjs.org i`

</details>

On the desktop, go to the app folder to run:

* `pnpm install [email protected] -D`
* `pnpm run dev`
* `pnpm run start`

Note: In the development environment, the kernel process will not be automatically started, and you need to manually start the kernel process first.

## Kernel

1. Install the latest version of [golang](https://go.dev/)
2. Open CGO support, that is, configure the environment variable `CGO_ENABLED=1`

### Desktop

* `cd kernel`
* `go build --tags "fts5" -o "../app/kernel/SiYuan-Kernel.exe"`
* `cd ../app/kernel`
* `./SiYuan-Kernel.exe --wd=.. --mode=dev`

### iOS

* `cd kernel`
* `gomobile bind --tags fts5 -ldflags '-s -w' -v -o ./ios/iosk.xcframework -target=ios ./mobile/`
* https://github.com/siyuan-note/siyuan-ios

### Android

* `cd kernel`
* `gomobile bind --tags fts5 -ldflags '-s -w' -v -o kernel.aar -target='android/arm64' -androidapi 24 ./mobile/`
* https://github.com/siyuan-note/siyuan-android

For the mobile-end, please refer to the corresponding project repository.
65 changes: 65 additions & 0 deletions .github/CONTRIBUTING_zh_CN.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
[English](CONTRIBUTING.md)

## 获取源码

* `git clone --depth=1 [email protected]:siyuan-note/siyuan.git`
* 切换到 dev 分支 `git checkout dev`

备注:`app/stage/protyle/**` 使用 git lfs 管理,正常情况下无需关注,关联 [#9253](https://github.com/siyuan-note/siyuan/issues/9253)

## NPM 依赖

安装 pnpm:`npm install -g pnpm`

<details>
<summary>适用于中国大陆</summary>

设置 Electron 镜像环境变量并安装 Electron:

* macOS/Linux:
```
ELECTRON_MIRROR=https://cnpmjs.org/mirrors/electron/ pnpm install [email protected] -D
```
* Windows:
* `SET ELECTRON_MIRROR=https://cnpmjs.org/mirrors/electron/`
* `pnpm install [email protected] -D`

NPM 镜像:

* 使用 npmmirror 中国镜像仓库 `pnpm --registry https://r.cnpmjs.org/ i`
* 恢复使用官方仓库 `pnpm --registry https://registry.npmjs.org i`
</details>

桌面端进入 app 文件夹运行:

* `pnpm install [email protected] -D`
* `pnpm run dev`
* `pnpm run start`

注意:在开发环境下不会自动拉起内核进程,需要先手动拉起内核进程。

## 内核

1. 安装最新版 [golang](https://go.dev/)
2. 打开 CGO 支持,即配置环境变量 `CGO_ENABLED=1`

### 桌面端

* `cd kernel`
* `go build --tags "fts5" -o "../app/kernel/SiYuan-Kernel.exe"`
* `cd ../app/kernel`
* `./SiYuan-Kernel.exe --wd=.. --mode=dev`

### iOS

* `cd kernel`
* `gomobile bind --tags fts5 -ldflags '-s -w' -v -o ./ios/iosk.xcframework -target=ios ./mobile/`
* https://github.com/siyuan-note/siyuan-ios

### Android

* `cd kernel`
* `gomobile bind --tags fts5 -ldflags '-s -w' -v -o kernel.aar -target='android/arm64' -androidapi 24 ./mobile/`
* https://github.com/siyuan-note/siyuan-android

移动端请参考对应项目仓库。
52 changes: 52 additions & 0 deletions .github/workflows/dockerimage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Release Docker Image

on:
workflow_dispatch:
push:
branches:
- master

jobs:
build:
name: build
runs-on: ubuntu-latest

permissions:
packages: write
contents: read

steps:
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
with:
# this might remove tools that are actually needed,
# if set to "true" but frees about 6 GB
tool-cache: false

# all of these default to true, but feel free to set to
# "false" if necessary for your workflow
android: true
dotnet: true
haskell: true
large-packages: true
docker-images: true
swap-storage: true

- name: Check out the repo
uses: actions/checkout@v3

- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Setup Docker buildx
uses: docker/setup-buildx-action@v2

- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_HUB_USER }}
password: ${{ secrets.DOCKER_HUB_PWD }}

- name: Build the Docker image
run: |
docker buildx build --push --platform linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v8 -t b3log/siyuan:latest -t b3log/siyuan:v2.11.2 .
46 changes: 46 additions & 0 deletions API.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
* [Update a block](#Update-a-block)
* [Delete a block](#Delete-a-block)
* [Move a block](#Move-a-block)
* [Fold a block](#Fold-a-block)
* [Unfold a block](#Unfold-a-block)
* [Get a block kramdown](#Get-a-block-kramdown)
* [Get child blocks](#get-child-blocks)
* [Transfer block ref](#transfer-block-ref)
Expand Down Expand Up @@ -783,6 +785,50 @@ View API token in <kbd>Settings - About</kbd>, request header: `Authorization: T
}
```

### Fold a block

* `/api/block/foldBlock`
* Parameters

```json
{
"id": "20231224160424-2f5680o"
}
```

* `id`: Block ID to fold
* Return value

```json
{
"code": 0,
"msg": "",
"data": null
}
```

### Unfold a block

* `/api/block/unfoldBlock`
* Parameters

```json
{
"id": "20231224160424-2f5680o"
}
```

* `id`: Block ID to unfold
* Return value

```json
{
"code": 0,
"msg": "",
"data": null
}
```

### Get a block kramdown

* `/api/block/getBlockKramdown`
Expand Down
46 changes: 46 additions & 0 deletions API_zh_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
* [更新块](#更新块)
* [删除块](#删除块)
* [移动块](#移动块)
* [折叠块](#折叠块)
* [展开块](#展开块)
* [获取块 kramdown 源码](#获取块-kramdown-源码)
* [获取子块](#获取子块)
* [转移块引用](#转移块引用)
Expand Down Expand Up @@ -776,6 +778,50 @@
}
```

### 折叠块

* `/api/block/foldBlock`
* 参数

```json
{
"id": "20231224160424-2f5680o"
}
```

* `id`:待折叠块的 ID
* 返回值

```json
{
"code": 0,
"msg": "",
"data": null
}
```

### 展开块

* `/api/block/unfoldBlock`
* 参数

```json
{
"id": "20231224160424-2f5680o"
}
```

* `id`:待展开块的 ID
* 返回值

```json
{
"code": 0,
"msg": "",
"data": null
}
```

### 获取块 kramdown 源码

* `/api/block/getBlockKramdown`
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ apkdv/siyuan-unlock \ # 使用的镜像源名称

思源笔记是一款隐私优先的个人知识管理系统,支持细粒度块级引用和 Markdown 所见即所得。

![feature0.png](screenshots/feature0.png)
![feature0.png](https://b3logfile.com/file/2024/01/feature0-1orBRlI.png)

欢迎到[思源笔记官方讨论区](https://ld246.com/domain/siyuan)了解更多。同时也欢迎关注 B3log 开源社区微信公众号 `B3log开源`

Expand Down
2 changes: 1 addition & 1 deletion README_zh_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

思源笔记是一款隐私优先的个人知识管理系统,支持细粒度块级引用和 Markdown 所见即所得。

![feature0.png](screenshots/feature0.png)
![feature0.png](https://b3logfile.com/file/2024/01/feature0-1orBRlI.png)

欢迎到[思源笔记官方讨论区](https://ld246.com/domain/siyuan)了解更多。同时也欢迎关注 B3log 开源社区微信公众号 `B3log开源`

Expand Down
Loading

0 comments on commit 6a629f1

Please sign in to comment.