Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
Vanessa 2024-04-26 10:22:12 +08:00
commit 53f5b08038
13 changed files with 212 additions and 112 deletions

View file

@ -6,6 +6,13 @@ on:
- '*-dev*'
workflow_dispatch:
# ref https://docs.github.com/zh/actions/learn-github-actions/variables
env:
repo_name_android: "siyuan-android"
repo_name: "siyuan"
repo_owner: "siyuan-note"
package_json: "app/package.json"
jobs:
create_release:
name: Create Release
@ -39,7 +46,7 @@ jobs:
run: |
echo "release_title=$(git show --format=%s --no-patch | head -1)" >> $GITHUB_OUTPUT
echo "release_version=$(TZ=Asia/Shanghai date +'v%Y%m%d%H%M')" >> $GITHUB_OUTPUT
changelog=$(python scripts/parse-changelog.py -t ${{ github.ref }} -b ${{ steps.thislatestR.outputs.release }} siyuan-note/siyuan)
changelog=$(python scripts/parse-changelog.py -t ${{ github.ref }} -b ${{ steps.thislatestR.outputs.release }} ${{ env.repo_owner }}/${{ env.repo_name }})
EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64)
echo "release_body<<$EOF" >> $GITHUB_ENV
echo "$changelog" >> $GITHUB_ENV
@ -51,13 +58,13 @@ jobs:
uses: sergeysova/jq-action@v2
id: version
with:
cmd: 'jq .version app/package.json -r'
cmd: 'jq .version ${{ env.package_json }} -r'
- name: Extract packageManager from package.json
uses: sergeysova/jq-action@v2
id: packageManager
with:
cmd: "jq .packageManager app/package.json -r"
cmd: "jq .packageManager ${{ env.package_json }} -r"
- name: Create Release
id: create_release
@ -80,7 +87,8 @@ jobs:
- os: ubuntu-20.04
name: ubuntu build linux.AppImage
kernel_path: "../app/kernel-linux/SiYuan-Kernel"
build_args: "-s -w -X github.com/siyuan-note/siyuan/kernel/util.Mode=prod"
build_args_prefix: "-s -w -X"
build_args_suffix: "Mode=prod"
electron_args: "dist-linux"
goos: "linux"
goarch: "amd64"
@ -88,7 +96,8 @@ jobs:
- os: ubuntu-20.04
name: ubuntu build linux.tar.gz
kernel_path: "../app/kernel-linux/SiYuan-Kernel"
build_args: "-s -w -X github.com/siyuan-note/siyuan/kernel/util.Mode=prod"
build_args_prefix: "-s -w -X"
build_args_suffix: "Mode=prod"
electron_args: "dist-linux"
goos: "linux"
goarch: "amd64"
@ -96,7 +105,8 @@ jobs:
- os: macos-latest
name: macos build mac.dmg
kernel_path: "../app/kernel-darwin/SiYuan-Kernel"
build_args: "-s -w -X github.com/siyuan-note/siyuan/kernel/util.Mode=prod"
build_args_prefix: "-s -w -X"
build_args_suffix: "Mode=prod"
electron_args: "dist-darwin"
goos: "darwin"
goarch: "amd64"
@ -104,7 +114,8 @@ jobs:
- os: macos-latest
name: macos build mac-arm64.dmg
kernel_path: "../app/kernel-darwin-arm64/SiYuan-Kernel"
build_args: "-s -w -X github.com/siyuan-note/siyuan/kernel/util.Mode=prod"
build_args_prefix: "-s -w -X"
build_args_suffix: "Mode=prod"
electron_args: "dist-darwin-arm64"
goos: "darwin"
goarch: "arm64"
@ -112,7 +123,8 @@ jobs:
- os: windows-latest
name: windows build win.exe
kernel_path: "../app/kernel/SiYuan-Kernel.exe"
build_args: "-s -w -H=windowsgui -X github.com/siyuan-note/siyuan/kernel/util.Mode=prod"
build_args_prefix: "-s -w -H=windowsgui -X"
build_args_suffix: "Mode=prod"
electron_args: "dist"
goos: "windows"
gobin: "bin"
@ -123,7 +135,7 @@ jobs:
steps:
- uses: actions/checkout@v4
with:
path: ${{ github.workspace }}/go/src/github.com/siyuan-note/siyuan
path: ${{ github.workspace }}/go/src/github.com/${{ env.repo_owner }}/${{ env.repo_name }}
- name: Set up MingGW
uses: msys2/setup-msys2@v2
@ -132,20 +144,20 @@ jobs:
install: p7zip mingw-w64-x86_64-lua
- name: Set up TDM-GCC
run: msys2 -c "bash go/src/github.com/siyuan-note/siyuan/scripts/get-tdm-gcc.sh tdm https://github.com/jmeubank/tdm-gcc/releases/download/v10.3.0-tdm-1/tdm-gcc-10.3.0.exe" && echo "CC=${{ github.workspace }}/tdm/bin/gcc.exe" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
run: msys2 -c "bash go/src/github.com/${{ env.repo_owner }}/${{ env.repo_name }}/scripts/get-tdm-gcc.sh tdm https://github.com/jmeubank/tdm-gcc/releases/download/v10.3.0-tdm-1/tdm-gcc-10.3.0.exe" && echo "CC=${{ github.workspace }}/tdm/bin/gcc.exe" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
if: "contains( matrix.config.goarch, '386')"
working-directory: ${{ github.workspace }}
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: ${{ github.workspace }}/go/src/github.com/siyuan-note/siyuan/kernel/go.mod
go-version-file: ${{ github.workspace }}/go/src/github.com/${{ env.repo_owner }}/${{ env.repo_name }}/kernel/go.mod
- run: go version
- name: Set up goversioninfo
run: go get github.com/josephspurrier/goversioninfo/cmd/goversioninfo && go install github.com/josephspurrier/goversioninfo/cmd/goversioninfo
if: "contains( matrix.config.goos, 'windows')"
working-directory: ${{ github.workspace }}/go/src/github.com/siyuan-note/siyuan/kernel
working-directory: ${{ github.workspace }}/go/src/github.com/${{ env.repo_owner }}/${{ env.repo_name }}/kernel
env:
GO111MODULE: on
CGO_ENABLED: 1
@ -160,49 +172,49 @@ jobs:
- name: Install Node pnpm
run: npm install -g ${{ needs.create_release.outputs.packageManager }}
working-directory: ${{ github.workspace }}/go/src/github.com/siyuan-note/siyuan/app
working-directory: ${{ github.workspace }}/go/src/github.com/${{ env.repo_owner }}/${{ env.repo_name }}/app
- name: Install Node Dependencies
run: pnpm install --no-frozen-lockfile
working-directory: ${{ github.workspace }}/go/src/github.com/siyuan-note/siyuan/app
working-directory: ${{ github.workspace }}/go/src/github.com/${{ env.repo_owner }}/${{ env.repo_name }}/app
- name: Building UI
run: pnpm run build
working-directory: ${{ github.workspace }}/go/src/github.com/siyuan-note/siyuan/app
working-directory: ${{ github.workspace }}/go/src/github.com/${{ env.repo_owner }}/${{ env.repo_name }}/app
- name: Remove Build Directory
uses: JesseTG/rm@v1.0.2
with:
path: ${{ github.workspace }}/go/src/github.com/siyuan-note/siyuan/app/build
path: ${{ github.workspace }}/go/src/github.com/${{ env.repo_owner }}/${{ env.repo_name }}/app/build
- name: Remove Kernel Directory for Linux
uses: JesseTG/rm@v1.0.2
with:
path: ${{ github.workspace }}/go/src/github.com/siyuan-note/siyuan/app/kernel-linux
path: ${{ github.workspace }}/go/src/github.com/${{ env.repo_owner }}/${{ env.repo_name }}/app/kernel-linux
- name: Remove Kernel Directory for Windows
uses: JesseTG/rm@v1.0.2
with:
path: ${{ github.workspace }}/go/src/github.com/siyuan-note/siyuan/app/kernel
path: ${{ github.workspace }}/go/src/github.com/${{ env.repo_owner }}/${{ env.repo_name }}/app/kernel
- name: Remove Kernel Directory for macOS
uses: JesseTG/rm@v1.0.2
with:
path: ${{ github.workspace }}/go/src/github.com/siyuan-note/siyuan/app/kernel-darwin
path: ${{ github.workspace }}/go/src/github.com/${{ env.repo_owner }}/${{ env.repo_name }}/app/kernel-darwin
- name: Remove Kernel Directory for macOS ARM64
uses: JesseTG/rm@v1.0.2
with:
path: ${{ github.workspace }}/go/src/github.com/siyuan-note/siyuan/app/kernel-darwin-arm64
path: ${{ github.workspace }}/go/src/github.com/${{ env.repo_owner }}/${{ env.repo_name }}/app/kernel-darwin-arm64
- name: Generate Icon Resource and Properties/Version Info For Windows
run: ${{ github.workspace }}\go\${{ matrix.config.gobin }}\goversioninfo -platform-specific=true -icon="resource\icon.ico" -manifest="resource\goversioninfo.exe.manifest"
if: "contains( matrix.config.goos, 'windows')"
working-directory: ${{ github.workspace }}/go/src/github.com/siyuan-note/siyuan/kernel
working-directory: ${{ github.workspace }}/go/src/github.com/${{ env.repo_owner }}/${{ env.repo_name }}/kernel
- name: Building Kernel
run: go build --tags fts5 -o "${{ matrix.config.kernel_path }}" -v -ldflags "${{ matrix.config.build_args }}"
working-directory: ${{ github.workspace }}/go/src/github.com/siyuan-note/siyuan/kernel
run: go build --tags fts5 -o "${{ matrix.config.kernel_path }}" -v -ldflags "${{ matrix.config.build_args_prefix }} github.com/${{ env.repo_owner }}/${{ env.repo_name }}/kernel/util.${{ matrix.config.build_args_suffix }}"
working-directory: ${{ github.workspace }}/go/src/github.com/${{ env.repo_owner }}/${{ env.repo_name }}/kernel
env:
GO111MODULE: on
CGO_ENABLED: 1
@ -212,7 +224,7 @@ jobs:
- name: Building Electron
run: pnpm run ${{ matrix.config.electron_args }}
working-directory: ${{ github.workspace }}/go/src/github.com/siyuan-note/siyuan/app
working-directory: ${{ github.workspace }}/go/src/github.com/${{ env.repo_owner }}/${{ env.repo_name }}/app
- name: Upload Release
uses: actions/upload-release-asset@v1
@ -221,5 +233,5 @@ jobs:
with:
upload_url: ${{ needs.create_release.outputs.upload_url }}
asset_name: siyuan-${{ needs.create_release.outputs.release_version }}-${{ matrix.config.suffix }}
asset_path: ${{ github.workspace }}/go/src/github.com/siyuan-note/siyuan/app/build/siyuan-${{ needs.create_release.outputs.version }}-${{ matrix.config.suffix }}
asset_path: ${{ github.workspace }}/go/src/github.com/${{ env.repo_owner }}/${{ env.repo_name }}/app/build/siyuan-${{ needs.create_release.outputs.version }}-${{ matrix.config.suffix }}
asset_content_type: application/octet-stream

View file

@ -11,14 +11,19 @@ on:
branches:
- master
# ref https://docs.github.com/zh/actions/learn-github-actions/variables
env:
repo_name_android: "siyuan-android"
repo_name: "siyuan"
repo_owner: "siyuan-note"
package_json: "app/package.json"
docker_hub_owner: "b3log"
docker_hub_repo: "siyuan"
jobs:
build:
name: build
runs-on: ubuntu-latest
strategy:
matrix:
string:
- package_json: "app/package.json"
permissions:
packages: write
contents: read
@ -34,7 +39,7 @@ jobs:
uses: sergeysova/jq-action@v2
id: version
with:
cmd: "jq .version ${{ matrix.string.package_json }} -r"
cmd: "jq .version ${{ env.package_json }} -r"
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
@ -67,9 +72,9 @@ jobs:
- name: Build the Docker image use Workflow Dispatch inputs' version
if: ${{ github.event_name == 'workflow_dispatch' && !github.event.inputs.image_tag == '' }}
run: |
docker buildx build --push --platform linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v8 -t b3log/siyuan:latest -t b3log/siyuan:v${{ github.event.inputs.image_tag }} .
docker buildx build --push --platform linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v8 -t ${{ env.docker_hub_owner }}/${{ env.docker_hub_repo }}:latest -t ${{ env.docker_hub_owner }}/${{ env.docker_hub_repo }}:v${{ github.event.inputs.image_tag }} .
- name: Build the Docker image use package_json version
if: ${{ github.event_name == 'push' || github.event.inputs.image_tag == '' }}
run: |
docker buildx build --push --platform linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v8 -t b3log/siyuan:latest -t b3log/siyuan:v${{ steps.version.outputs.value }} .
docker buildx build --push --platform linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v8 -t ${{ env.docker_hub_owner }}/${{ env.docker_hub_repo }}:latest -t ${{ env.docker_hub_owner }}/${{ env.docker_hub_repo }}:v${{ steps.version.outputs.value }} .

View file

@ -3,7 +3,9 @@
"sort": 3,
"icon": "1f4d4",
"closed": false,
"refCreateSaveBox": "",
"refCreateSavePath": "",
"docCreateSaveBox": "",
"docCreateSavePath": "",
"dailyNoteSavePath": "/daily note/{{now | date \"2006/01\"}}/{{now | date \"2006-01-02\"}}",
"dailyNoteTemplatePath": "",

View file

@ -7,7 +7,7 @@
"id": "20200924100950-9op5xi1",
"title": "Shortcuts",
"type": "doc",
"updated": "20240416115710"
"updated": "20240426101110"
},
"Children": [
{
@ -40,7 +40,7 @@
"Properties": {
"colgroup": "||",
"id": "20210106154101-qrojg1b",
"updated": "20240308232956"
"updated": "20240426100644"
},
"Children": [
{
@ -502,7 +502,7 @@
"Children": [
{
"Type": "NodeText",
"Data": "Select next edit tab"
"Data": "Jump to next edit tab"
}
]
},
@ -550,7 +550,7 @@
"Children": [
{
"Type": "NodeText",
"Data": "Select previous edit tab"
"Data": "Jump to previous edit tab"
}
]
},
@ -598,7 +598,7 @@
"Children": [
{
"Type": "NodeText",
"Data": "Select the first tab"
"Data": "Jump to the first tab"
}
]
},
@ -646,7 +646,7 @@
"Children": [
{
"Type": "NodeText",
"Data": "Select the second tab"
"Data": "Jump to the second tab"
}
]
},
@ -661,7 +661,7 @@
{
"Type": "NodeTextMark",
"TextMarkType": "kbd",
"TextMarkTextContent": "Ctrl+1"
"TextMarkTextContent": "Ctrl+2"
},
{
"Type": "NodeText",
@ -694,7 +694,7 @@
"Children": [
{
"Type": "NodeText",
"Data": "Select the third tab"
"Data": "Jump to the third tab"
}
]
},
@ -709,7 +709,7 @@
{
"Type": "NodeTextMark",
"TextMarkType": "kbd",
"TextMarkTextContent": "Ctrl+1"
"TextMarkTextContent": "Ctrl+3"
},
{
"Type": "NodeText",
@ -742,7 +742,7 @@
"Children": [
{
"Type": "NodeText",
"Data": "Select the fourth tab"
"Data": "Jump to the fourth tab"
}
]
},
@ -757,7 +757,7 @@
{
"Type": "NodeTextMark",
"TextMarkType": "kbd",
"TextMarkTextContent": "Ctrl+1"
"TextMarkTextContent": "Ctrl+4"
},
{
"Type": "NodeText",
@ -790,7 +790,7 @@
"Children": [
{
"Type": "NodeText",
"Data": "Select the fifth tab"
"Data": "Jump to the fifth tab"
}
]
},
@ -805,7 +805,7 @@
{
"Type": "NodeTextMark",
"TextMarkType": "kbd",
"TextMarkTextContent": "Ctrl+1"
"TextMarkTextContent": "Ctrl+5"
},
{
"Type": "NodeText",
@ -838,7 +838,7 @@
"Children": [
{
"Type": "NodeText",
"Data": "Select the sixth tab"
"Data": "Jump to the sixth tab"
}
]
},
@ -853,7 +853,7 @@
{
"Type": "NodeTextMark",
"TextMarkType": "kbd",
"TextMarkTextContent": "Ctrl+1"
"TextMarkTextContent": "Ctrl+6"
},
{
"Type": "NodeText",
@ -886,7 +886,7 @@
"Children": [
{
"Type": "NodeText",
"Data": "Select the seventh tab"
"Data": "Jump to the seventh tab"
}
]
},
@ -901,7 +901,7 @@
{
"Type": "NodeTextMark",
"TextMarkType": "kbd",
"TextMarkTextContent": "Ctrl+1"
"TextMarkTextContent": "Ctrl+7"
},
{
"Type": "NodeText",
@ -934,7 +934,7 @@
"Children": [
{
"Type": "NodeText",
"Data": "Select the eighth tab"
"Data": "Jump to the eighth tab"
}
]
},
@ -949,7 +949,7 @@
{
"Type": "NodeTextMark",
"TextMarkType": "kbd",
"TextMarkTextContent": "Ctrl+1"
"TextMarkTextContent": "Ctrl+8"
},
{
"Type": "NodeText",
@ -982,7 +982,7 @@
"Children": [
{
"Type": "NodeText",
"Data": "Select the ninth tab"
"Data": "Jump to the ninth/last tab"
}
]
},
@ -997,7 +997,7 @@
{
"Type": "NodeTextMark",
"TextMarkType": "kbd",
"TextMarkTextContent": "Ctrl+1"
"TextMarkTextContent": "Ctrl+9"
},
{
"Type": "NodeText",
@ -2326,7 +2326,7 @@
"Properties": {
"colgroup": "||",
"id": "20210826183314-axmylf4",
"updated": "20240416115710"
"updated": "20240426101110"
},
"Children": [
{
@ -2398,6 +2398,15 @@
"TextMarkType": "kbd",
"TextMarkTextContent": "Ctrl+/"
},
{
"Type": "NodeText",
"Data": " / "
},
{
"Type": "NodeTextMark",
"TextMarkType": "kbd",
"TextMarkTextContent": "⌘/"
},
{
"Type": "NodeText",
"Data": ""

View file

@ -3,7 +3,9 @@
"sort": 1,
"icon": "1f4d4",
"closed": false,
"refCreateSaveBox": "",
"refCreateSavePath": "",
"docCreateSaveBox": "",
"docCreateSavePath": "",
"dailyNoteSavePath": "/daily note/{{now | date \"2006/01\"}}/{{now | date \"2006-01-02\"}}",
"dailyNoteTemplatePath": "",

View file

@ -7,7 +7,7 @@
"id": "20200813004551-gm0pbn1",
"title": "快捷键",
"type": "doc",
"updated": "20240416105908"
"updated": "20240426101023"
},
"Children": [
{
@ -36,7 +36,7 @@
"Properties": {
"colgroup": "||",
"id": "20201227133317-ovwnk1y",
"updated": "20240308232815"
"updated": "20240426100731"
},
"Children": [
{
@ -494,7 +494,7 @@
"Children": [
{
"Type": "NodeText",
"Data": "选中下一个编辑页签"
"Data": "跳转到下一个编辑页签"
}
]
},
@ -542,7 +542,7 @@
"Children": [
{
"Type": "NodeText",
"Data": "选中上一个编辑页签"
"Data": "跳转到上一个编辑页签"
}
]
},
@ -596,7 +596,7 @@
"Children": [
{
"Type": "NodeText",
"Data": "选中第一个页签"
"Data": "跳转到第一个页签"
}
]
},
@ -644,7 +644,7 @@
"Children": [
{
"Type": "NodeText",
"Data": "选中第二个页签"
"Data": "跳转到第二个页签"
}
]
},
@ -659,7 +659,7 @@
{
"Type": "NodeTextMark",
"TextMarkType": "kbd",
"TextMarkTextContent": "Ctrl+1"
"TextMarkTextContent": "Ctrl+2"
},
{
"Type": "NodeText",
@ -692,7 +692,7 @@
"Children": [
{
"Type": "NodeText",
"Data": "选中第三个页签"
"Data": "跳转到第三个页签"
}
]
},
@ -707,7 +707,7 @@
{
"Type": "NodeTextMark",
"TextMarkType": "kbd",
"TextMarkTextContent": "Ctrl+1"
"TextMarkTextContent": "Ctrl+3"
},
{
"Type": "NodeText",
@ -740,7 +740,7 @@
"Children": [
{
"Type": "NodeText",
"Data": "选中第四个页签"
"Data": "跳转到第四个页签"
}
]
},
@ -755,7 +755,7 @@
{
"Type": "NodeTextMark",
"TextMarkType": "kbd",
"TextMarkTextContent": "Ctrl+1"
"TextMarkTextContent": "Ctrl+4"
},
{
"Type": "NodeText",
@ -788,7 +788,7 @@
"Children": [
{
"Type": "NodeText",
"Data": "选中第五个页签"
"Data": "跳转到第五个页签"
}
]
},
@ -803,7 +803,7 @@
{
"Type": "NodeTextMark",
"TextMarkType": "kbd",
"TextMarkTextContent": "Ctrl+1"
"TextMarkTextContent": "Ctrl+5"
},
{
"Type": "NodeText",
@ -836,7 +836,7 @@
"Children": [
{
"Type": "NodeText",
"Data": "选中第六个页签"
"Data": "跳转到第六个页签"
}
]
},
@ -851,7 +851,7 @@
{
"Type": "NodeTextMark",
"TextMarkType": "kbd",
"TextMarkTextContent": "Ctrl+1"
"TextMarkTextContent": "Ctrl+6"
},
{
"Type": "NodeText",
@ -884,7 +884,7 @@
"Children": [
{
"Type": "NodeText",
"Data": "选中第七个页签"
"Data": "跳转到第七个页签"
}
]
},
@ -899,7 +899,7 @@
{
"Type": "NodeTextMark",
"TextMarkType": "kbd",
"TextMarkTextContent": "Ctrl+1"
"TextMarkTextContent": "Ctrl+7"
},
{
"Type": "NodeText",
@ -932,7 +932,7 @@
"Children": [
{
"Type": "NodeText",
"Data": "选中第八个页签"
"Data": "跳转到第八个页签"
}
]
},
@ -947,7 +947,7 @@
{
"Type": "NodeTextMark",
"TextMarkType": "kbd",
"TextMarkTextContent": "Ctrl+1"
"TextMarkTextContent": "Ctrl+8"
},
{
"Type": "NodeText",
@ -980,7 +980,7 @@
"Children": [
{
"Type": "NodeText",
"Data": "选中第九个页签"
"Data": "跳转到第九个/最后一个页签"
}
]
},
@ -995,7 +995,7 @@
{
"Type": "NodeTextMark",
"TextMarkType": "kbd",
"TextMarkTextContent": "Ctrl+1"
"TextMarkTextContent": "Ctrl+9"
},
{
"Type": "NodeText",
@ -1028,7 +1028,7 @@
"Children": [
{
"Type": "NodeText",
"Data": "选中下一个页签"
"Data": "跳转到下一个页签"
}
]
},
@ -1076,7 +1076,7 @@
"Children": [
{
"Type": "NodeText",
"Data": "选中上一个页签"
"Data": "跳转到上一个页签"
}
]
},
@ -2324,7 +2324,7 @@
"Properties": {
"colgroup": "||",
"id": "20210826183308-gok25ug",
"updated": "20240416105908"
"updated": "20240426101023"
},
"Children": [
{
@ -2396,6 +2396,15 @@
"TextMarkType": "kbd",
"TextMarkTextContent": "Ctrl+/"
},
{
"Type": "NodeText",
"Data": " / "
},
{
"Type": "NodeTextMark",
"TextMarkType": "kbd",
"TextMarkTextContent": "⌘/"
},
{
"Type": "NodeText",
"Data": ""

View file

@ -3,7 +3,9 @@
"sort": 2,
"icon": "1f4d4",
"closed": false,
"refCreateSaveBox": "",
"refCreateSavePath": "",
"docCreateSaveBox": "",
"docCreateSavePath": "",
"dailyNoteSavePath": "/daily note/{{now | date \"2006/01\"}}/{{now | date \"2006-01-02\"}}",
"dailyNoteTemplatePath": "",

View file

@ -7,7 +7,7 @@
"id": "20211226122549-jktxego",
"title": "快捷鍵",
"type": "doc",
"updated": "20240416113937"
"updated": "20240426101104"
},
"Children": [
{
@ -36,7 +36,7 @@
"Properties": {
"colgroup": "||",
"id": "20211226122652-4e9hm9i",
"updated": "20240308232846"
"updated": "20240426100801"
},
"Children": [
{
@ -494,7 +494,7 @@
"Children": [
{
"Type": "NodeText",
"Data": "選取上一個編輯分頁"
"Data": "跳到上一個編輯分頁"
}
]
},
@ -542,7 +542,7 @@
"Children": [
{
"Type": "NodeText",
"Data": "選中上一個編輯分頁"
"Data": "跳到上一個編輯分頁"
}
]
},
@ -590,7 +590,7 @@
"Children": [
{
"Type": "NodeText",
"Data": "選取第一個分頁"
"Data": "跳到第一個分頁"
}
]
},
@ -638,7 +638,7 @@
"Children": [
{
"Type": "NodeText",
"Data": "選取第二個分頁"
"Data": "跳到第二個分頁"
}
]
},
@ -653,7 +653,7 @@
{
"Type": "NodeTextMark",
"TextMarkType": "kbd",
"TextMarkTextContent": "Ctrl+1"
"TextMarkTextContent": "Ctrl+2"
},
{
"Type": "NodeText",
@ -686,7 +686,7 @@
"Children": [
{
"Type": "NodeText",
"Data": "選取第三個分頁"
"Data": "跳到第三個分頁"
}
]
},
@ -701,7 +701,7 @@
{
"Type": "NodeTextMark",
"TextMarkType": "kbd",
"TextMarkTextContent": "Ctrl+1"
"TextMarkTextContent": "Ctrl+3"
},
{
"Type": "NodeText",
@ -734,7 +734,7 @@
"Children": [
{
"Type": "NodeText",
"Data": "選取第四個分頁"
"Data": "跳到第四個分頁"
}
]
},
@ -749,7 +749,7 @@
{
"Type": "NodeTextMark",
"TextMarkType": "kbd",
"TextMarkTextContent": "Ctrl+1"
"TextMarkTextContent": "Ctrl+4"
},
{
"Type": "NodeText",
@ -782,7 +782,7 @@
"Children": [
{
"Type": "NodeText",
"Data": "選取第五個分頁"
"Data": "跳到第五個分頁"
}
]
},
@ -797,7 +797,7 @@
{
"Type": "NodeTextMark",
"TextMarkType": "kbd",
"TextMarkTextContent": "Ctrl+1"
"TextMarkTextContent": "Ctrl+5"
},
{
"Type": "NodeText",
@ -830,7 +830,7 @@
"Children": [
{
"Type": "NodeText",
"Data": "選取第六個分頁"
"Data": "跳到第六個分頁"
}
]
},
@ -845,7 +845,7 @@
{
"Type": "NodeTextMark",
"TextMarkType": "kbd",
"TextMarkTextContent": "Ctrl+1"
"TextMarkTextContent": "Ctrl+6"
},
{
"Type": "NodeText",
@ -878,7 +878,7 @@
"Children": [
{
"Type": "NodeText",
"Data": "選取第七個分頁"
"Data": "跳到第七個分頁"
}
]
},
@ -893,7 +893,7 @@
{
"Type": "NodeTextMark",
"TextMarkType": "kbd",
"TextMarkTextContent": "Ctrl+1"
"TextMarkTextContent": "Ctrl+7"
},
{
"Type": "NodeText",
@ -926,7 +926,7 @@
"Children": [
{
"Type": "NodeText",
"Data": "選取第八個分頁"
"Data": "跳到第八個分頁"
}
]
},
@ -941,7 +941,7 @@
{
"Type": "NodeTextMark",
"TextMarkType": "kbd",
"TextMarkTextContent": "Ctrl+1"
"TextMarkTextContent": "Ctrl+8"
},
{
"Type": "NodeText",
@ -974,7 +974,7 @@
"Children": [
{
"Type": "NodeText",
"Data": "選取第九個分頁"
"Data": "跳到第九個/最後一個分頁"
}
]
},
@ -989,7 +989,7 @@
{
"Type": "NodeTextMark",
"TextMarkType": "kbd",
"TextMarkTextContent": "Ctrl+1"
"TextMarkTextContent": "Ctrl+9"
},
{
"Type": "NodeText",
@ -2318,7 +2318,7 @@
"Properties": {
"colgroup": "||",
"id": "20211226122652-eu9085n",
"updated": "20240416113937"
"updated": "20240426101104"
},
"Children": [
{
@ -2390,6 +2390,15 @@
"TextMarkType": "kbd",
"TextMarkTextContent": "Ctrl+/"
},
{
"Type": "NodeText",
"Data": " / "
},
{
"Type": "NodeTextMark",
"TextMarkType": "kbd",
"TextMarkTextContent": "⌘/"
},
{
"Type": "NodeText",
"Data": ""

View file

@ -284,6 +284,7 @@ export const progressStatus = (data: IWebSocketData) => {
if (!statusElement) {
return;
}
if (isMobile()) {
if (!document.querySelector("#keyboardToolbar").classList.contains("fn__none")) {
return;
@ -293,7 +294,7 @@ export const progressStatus = (data: IWebSocketData) => {
statusElement.style.bottom = "0";
statusTimeout = window.setTimeout(() => {
statusElement.style.bottom = "";
}, 5000);
}, 7000);
} else {
const msgElement = statusElement.querySelector(".status__msg");
if (msgElement) {
@ -301,7 +302,7 @@ export const progressStatus = (data: IWebSocketData) => {
msgElement.innerHTML = data.msg;
statusTimeout = window.setTimeout(() => {
msgElement.innerHTML = "";
}, 5000);
}, 7000);
}
}
};

View file

@ -20,14 +20,14 @@ declare interface INotebookConf {
}
}
export const genNotebookOption = (id: string) => {
export const genNotebookOption = (id: string, notebookId?: string) => {
let html = `<option value="">${window.siyuan.languages.currentNotebook}</option>`;
const helpIds: string[] = [];
Object.keys(Constants.HELP_PATH).forEach((key: "zh_CN") => {
helpIds.push(Constants.HELP_PATH[key]);
});
window.siyuan.notebooks.forEach((item) => {
if (helpIds.includes(item.id)) {
if (helpIds.includes(item.id) || item.id === notebookId) {
return;
}
html += `<option value="${item.id}" ${id === item.id ? "selected" : ""}>${item.name}</option>`;
@ -45,7 +45,7 @@ export const onGetnotebookconf = (data: INotebookConf) => {
<div class="b3-label__text">${window.siyuan.languages.fileTree13}</div>
<span class="fn__hr"></span>
<div class="fn__flex">
<select style="min-width: 200px" class="b3-select" id="docCreateSaveBox">${genNotebookOption(data.conf.docCreateSaveBox)}</select>
<select style="min-width: 200px" class="b3-select" id="docCreateSaveBox">${genNotebookOption(data.conf.docCreateSaveBox, data.box)}</select>
<div class="fn__space"></div>
<input class="b3-text-field fn__flex-1" id="docCreateSavePath" value="">
</div>
@ -55,7 +55,7 @@ export const onGetnotebookconf = (data: INotebookConf) => {
<div class="b3-label__text">${window.siyuan.languages.fileTree6}</div>
<span class="fn__hr"></span>
<div class="fn__flex">
<select style="min-width: 200px" class="b3-select" id="refCreateSaveBox">${genNotebookOption(data.conf.refCreateSaveBox)}</select>
<select style="min-width: 200px" class="b3-select" id="refCreateSaveBox">${genNotebookOption(data.conf.refCreateSaveBox, data.box)}</select>
<div class="fn__space"></div>
<input class="b3-text-field fn__flex-1" id="refCreateSavePath" value="">
</div>

View file

@ -92,6 +92,9 @@ export const newFile = (optios: {
optios.currentPath = resultData.currentPath;
}
fetchPost("/api/filetree/getDocCreateSavePath", {notebook: optios.notebookId}, (data) => {
if (!optios.useSavePath) {
data.data.box = optios.notebookId;
}
if ((data.data.path.indexOf("/") > -1 && optios.useSavePath) || optios.name) {
if (data.data.path.startsWith("/") || optios.currentPath === "/") {
fetchPost("/api/filetree/createDocWithMd", {
@ -138,8 +141,27 @@ export const newFile = (optios: {
if (!validateName(title)) {
return;
}
if (optios.notebookId !== data.data.box) {
fetchPost("/api/filetree/createDocWithMd", {
notebook: data.data.box,
path: pathPosix().join(data.data.path || "/", optios.name || (data.data.path.endsWith("/") ? window.siyuan.languages.untitled : "")),
markdown: ""
}, response => {
/// #if !MOBILE
openFileById({
app: optios.app,
id: response.data,
action: [Constants.CB_GET_HL, Constants.CB_GET_CONTEXT]
});
/// #else
openMobileFileById(optios.app, response.data, [Constants.CB_GET_HL, Constants.CB_GET_CONTEXT]);
/// #endif
});
return;
}
const id = Lute.NewNodeID();
const newPath = optios.notebookId === data.data.box ? (pathPosix().join(getDisplayName(optios.currentPath, false, true), id + ".sy")) : (data.data.path || "/");
const newPath = (pathPosix().join(getDisplayName(optios.currentPath, false, true), id + ".sy"));
if (optios.paths) {
optios.paths[optios.paths.indexOf(undefined)] = newPath;
}

View file

@ -707,12 +707,19 @@ func getDocCreateSavePath(c *gin.Context) {
var docCreateSaveBox string
docCreateSavePathTpl := model.Conf.FileTree.DocCreateSavePath
if nil != box {
docCreateSaveBox = box.GetConf().DocCreateSaveBox
docCreateSavePathTpl = box.GetConf().DocCreateSavePath
boxConf := box.GetConf()
docCreateSaveBox = boxConf.DocCreateSaveBox
docCreateSavePathTpl = boxConf.DocCreateSavePath
}
if "" == docCreateSaveBox {
docCreateSaveBox = model.Conf.FileTree.DocCreateSaveBox
}
if "" != docCreateSaveBox {
if nil == model.Conf.Box(docCreateSaveBox) {
// 如果配置的笔记本未打开或者不存在,则使用当前笔记本
docCreateSaveBox = notebook
}
}
if "" == docCreateSaveBox {
docCreateSaveBox = notebook
}
@ -727,6 +734,13 @@ func getDocCreateSavePath(c *gin.Context) {
docCreateSavePathTpl = "/Untitled"
}
if docCreateSaveBox != notebook {
if "" != docCreateSavePathTpl && !strings.HasPrefix(docCreateSavePathTpl, "/") {
// 如果配置的笔记本不是当前笔记本,则将相对路径转换为绝对路径
docCreateSavePathTpl = "/" + docCreateSavePathTpl
}
}
docCreateSavePath, err := model.RenderGoTemplate(docCreateSavePathTpl)
if nil != err {
ret.Code = -1
@ -754,12 +768,19 @@ func getRefCreateSavePath(c *gin.Context) {
var refCreateSaveBox string
refCreateSavePathTpl := model.Conf.FileTree.RefCreateSavePath
if nil != box {
refCreateSaveBox = box.GetConf().RefCreateSaveBox
refCreateSavePathTpl = box.GetConf().RefCreateSavePath
boxConf := box.GetConf()
refCreateSaveBox = boxConf.RefCreateSaveBox
refCreateSavePathTpl = boxConf.RefCreateSavePath
}
if "" == refCreateSaveBox {
refCreateSaveBox = model.Conf.FileTree.RefCreateSaveBox
}
if "" != refCreateSaveBox {
if nil == model.Conf.Box(refCreateSaveBox) {
// 如果配置的笔记本未打开或者不存在,则使用当前笔记本
refCreateSaveBox = notebook
}
}
if "" == refCreateSaveBox {
refCreateSaveBox = notebook
}
@ -767,6 +788,13 @@ func getRefCreateSavePath(c *gin.Context) {
refCreateSavePathTpl = model.Conf.FileTree.RefCreateSavePath
}
if refCreateSaveBox != notebook {
if "" != refCreateSavePathTpl && !strings.HasPrefix(refCreateSavePathTpl, "/") {
// 如果配置的笔记本不是当前笔记本,则将相对路径转换为绝对路径
refCreateSavePathTpl = "/" + refCreateSavePathTpl
}
}
refCreateSavePath, err := model.RenderGoTemplate(refCreateSavePathTpl)
if nil != err {
ret.Code = -1

View file

@ -320,7 +320,6 @@ func RollbackNotebookHistory(historyPath string) (err error) {
return
}
util.ReloadUI()
FullReindex()
IncSync()
return nil