Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: justice2001/halo-plugin-vditor
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.0.0-beta.1
Choose a base ref
...
head repository: justice2001/halo-plugin-vditor
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref

Commits on Nov 25, 2023

  1. doc: update readme

    justice2001 committed Nov 25, 2023
    Copy the full SHA
    daa6b74 View commit details
  2. doc: update release url

    justice2001 committed Nov 25, 2023
    Copy the full SHA
    c9a4fc2 View commit details
  3. perf: modify the item in vditor toolbar

    feat: enable text counter
    feat: enable outline by default
    justice2001 committed Nov 25, 2023
    Copy the full SHA
    14a4a7c View commit details

Commits on Nov 26, 2023

  1. Copy the full SHA
    da831ea View commit details
  2. Copy the full SHA
    f428b4a View commit details
  3. Copy the full SHA
    c9a3661 View commit details
  4. Copy the full SHA
    669e393 View commit details
  5. 📝 Add todo to readme

    justice2001 committed Nov 26, 2023
    Copy the full SHA
    4a848cf View commit details
  6. 🔥 Remove config class because not use it

    this class used in dev branch, the development is not complete
    justice2001 committed Nov 26, 2023
    Copy the full SHA
    37e6a2a View commit details

Commits on Nov 27, 2023

  1. 🎨 Improve structure

    📝 Correct spelling
    justice2001 committed Nov 27, 2023
    Copy the full SHA
    5eb2bfe View commit details
  2. Copy the full SHA
    ac5e9fe View commit details
  3. 📝 Add todo to readme

    justice2001 committed Nov 27, 2023
    Copy the full SHA
    95be4ad View commit details
  4. Copy the full SHA
    7017404 View commit details
  5. Merge branch 'main' into dev

    # Conflicts:
    #	build.gradle
    #	console/src/views/Vditor.vue
    #	src/main/java/run/halo/starter/VEditorConfiguration.java
    justice2001 committed Nov 27, 2023
    Copy the full SHA
    2cfe88d View commit details
  6. Copy the full SHA
    159ddb9 View commit details
  7. ✨ Add type writer mode

    justice2001 committed Nov 27, 2023
    Copy the full SHA
    4ac99ff View commit details
  8. Copy the full SHA
    6eac09e View commit details

Commits on Nov 28, 2023

  1. Copy the full SHA
    8ed9d25 View commit details
  2. Copy the full SHA
    a5689fb View commit details
  3. 📝 Update README

    justice2001 committed Nov 28, 2023
    Copy the full SHA
    e41fcbf View commit details
  4. 🐛 Insert image hotkey conflits with dev tools hotkey

    new hotkey: ⇧⌘P
    justice2001 committed Nov 28, 2023
    Copy the full SHA
    e503dd0 View commit details

Commits on Nov 29, 2023

  1. Copy the full SHA
    88b81a9 View commit details
  2. Copy the full SHA
    de66fff View commit details
  3. Copy the full SHA
    209ff48 View commit details
  4. 🔖 Release v1.1.0

    justice2001 committed Nov 29, 2023
    Copy the full SHA
    8e329c7 View commit details

Commits on Nov 30, 2023

  1. 📝 Add some todos

    justice2001 committed Nov 30, 2023
    Copy the full SHA
    ed70040 View commit details
  2. Copy the full SHA
    5a5b21f View commit details
  3. Copy the full SHA
    36f19c9 View commit details
  4. Copy the full SHA
    7aa8c7b View commit details

Commits on Dec 2, 2023

  1. Copy the full SHA
    f85033b View commit details
  2. Copy the full SHA
    4832642 View commit details

Commits on Dec 3, 2023

  1. 🚧 Settings

    justice2001 committed Dec 3, 2023
    Copy the full SHA
    ef7a396 View commit details

Commits on Dec 6, 2023

  1. 💚 Add gitea ci

    justice2001 committed Dec 6, 2023
    Copy the full SHA
    6cfe5b4 View commit details
  2. 💚 Gitea CI

    justice2001 committed Dec 6, 2023
    Copy the full SHA
    01fd8f4 View commit details
  3. 💚 Fix upload error

    justice2001 committed Dec 6, 2023
    Copy the full SHA
    f53f79e View commit details

Commits on Dec 7, 2023

  1. 🚸 Split Settings

    justice2001 committed Dec 7, 2023
    Copy the full SHA
    41cc6ab View commit details
  2. Copy the full SHA
    8095c1f View commit details
  3. Copy the full SHA
    fe8c458 View commit details
  4. 💚 Gitea CI

    justice2001 committed Dec 7, 2023
    Copy the full SHA
    62b86f8 View commit details
  5. 💚 Fix upload error

    justice2001 committed Dec 7, 2023
    Copy the full SHA
    814203e View commit details
  6. Copy the full SHA
    1d79afc View commit details
  7. 📝 Update readme

    justice2001 committed Dec 7, 2023
    Copy the full SHA
    b96fa39 View commit details
  8. Copy the full SHA
    fb218ac View commit details
  9. ⬆️ Update pnpm

    justice2001 committed Dec 7, 2023
    Copy the full SHA
    a57d3cd View commit details
  10. Merge branch 'dev'

    # Conflicts:
    #	.gitea/workflows/workflow.yaml
    justice2001 committed Dec 7, 2023
    Copy the full SHA
    2d238d9 View commit details
  11. Copy the full SHA
    6c23f24 View commit details
  12. Copy the full SHA
    f1595ce View commit details
  13. Copy the full SHA
    93655a1 View commit details

Commits on Dec 18, 2023

  1. Copy the full SHA
    f682445 View commit details
  2. 🎨 Format code

    justice2001 committed Dec 18, 2023
    Copy the full SHA
    4d03034 View commit details
Showing with 5,072 additions and 1,328 deletions.
  1. +108 −0 .gitea/workflows/workflow.yaml
  2. +19 −0 .github/workflows/cd.yaml
  3. +17 −0 .github/workflows/ci.yaml
  4. +4 −0 .github/workflows/workflow.yaml
  5. +136 −0 CHANGELOG.md
  6. +97 −14 README.md
  7. +49 −5 build.gradle
  8. +1 −0 console/.npmrc
  9. +8 −4 console/package.json
  10. +1,378 −1,072 console/pnpm-lock.yaml
  11. +21 −0 console/src/assets/debug.svg
  12. +36 −0 console/src/i18n/en-US.ts
  13. +36 −0 console/src/i18n/zh-CN.ts
  14. +36 −0 console/src/i18n/zh-TW.ts
  15. +6 −6 console/src/index.ts
  16. +122 −0 console/src/model/DebugPanel.vue
  17. +92 −0 console/src/model/TemplateModal.vue
  18. +42 −0 console/src/schema/drive.ts
  19. +83 −0 console/src/schema/gallery.ts
  20. +44 −0 console/src/schema/git.ts
  21. +28 −0 console/src/schema/joe-progress.ts
  22. +34 −0 console/src/schema/tips.ts
  23. +53 −0 console/src/type/editor.d.ts
  24. +1 −0 console/src/type/i18n.d.ts
  25. +39 −0 console/src/utils/config-utils.ts
  26. +10 −0 console/src/utils/cursor-utils.ts
  27. +27 −0 console/src/utils/dom-utils.ts
  28. +23 −0 console/src/utils/fetch-utils.ts
  29. +24 −0 console/src/utils/i18n-utils.ts
  30. +2 −0 console/src/utils/icon.ts
  31. +16 −0 console/src/utils/quick-insert-utils.ts
  32. +260 −0 console/src/utils/vditor-utils.ts
  33. +0 −64 console/src/views/HomeView.vue
  34. +348 −0 console/src/views/VditorMde.vue
  35. +13 −52 console/vite.config.ts
  36. BIN doc/assets/colorful-tips.png
  37. BIN doc/assets/git-repo.png
  38. +73 −0 doc/halo.md
  39. +128 −0 doc/rfc/custom-insert.md
  40. +51 −0 doc/rfc/quick-insert-demo.json
  41. +47 −0 doc/test/halo-render.md
  42. +1 −0 doc/test/render.md
  43. +51 −0 doc/test/test_case.md
  44. +396 −0 doc/test/vditor.md
  45. +11 −0 download_dist.bat
  46. +11 −0 download_dist.sh
  47. +1 −1 gradle.properties
  48. +1 −1 gradle/wrapper/gradle-wrapper.properties
  49. +1 −0 settings.gradle
  50. +0 −65 src/main/java/run/halo/starter/VditorHeadProcessor.java
  51. +8 −3 ...java/{run/halo/starter/VEditorConfiguration.java → top/mczhengyi/vditor/VditorConfiguration.java}
  52. +4 −4 src/main/java/{run/halo/starter → top/mczhengyi/vditor}/VditorMdePlugin.java
  53. +22 −0 src/main/java/top/mczhengyi/vditor/bean/RenderConfig.java
  54. +41 −0 src/main/java/top/mczhengyi/vditor/extension/VditorPostContentHandler.java
  55. +42 −0 src/main/java/top/mczhengyi/vditor/extension/VditorSinglePageContentHandler.java
  56. +54 −0 src/main/java/top/mczhengyi/vditor/utils/ScriptBuilder.java
  57. +36 −0 src/main/java/top/mczhengyi/vditor/utils/ScriptUtils.java
  58. +21 −0 src/main/resources/extensions/extension-definitions.yaml
  59. +23 −0 src/main/resources/extensions/roleTemplates.yaml
  60. +124 −4 src/main/resources/extensions/settings.yaml
  61. +10 −9 src/main/resources/plugin.yaml
  62. +7 −0 src/main/resources/static/dark-mode/dark-joe.js
  63. +5 −0 src/main/resources/static/dark-mode/dark-system.js
  64. +8 −0 src/main/resources/static/external/halo-renders.js
  65. +5 −0 src/main/resources/static/external/media-render.js
  66. BIN src/main/resources/static/halo-renders/fonts/iconfont.ttf
  67. BIN src/main/resources/static/halo-renders/fonts/iconfont.woff
  68. BIN src/main/resources/static/halo-renders/fonts/iconfont.woff2
  69. BIN src/main/resources/static/halo-renders/icons/drive/ali.png
  70. +1 −0 src/main/resources/static/halo-renders/icons/drive/baidu.svg
  71. +309 −0 src/main/resources/static/halo-renders/index.css
  72. +1 −0 src/main/resources/static/halo-renders/index.js
  73. +54 −0 src/main/resources/static/inject-demo.css
  74. +44 −0 src/main/resources/static/inject-demo.js
  75. +70 −0 src/main/resources/static/quick-insert-demo.json
  76. +93 −0 src/main/resources/static/render-utils.js
  77. +21 −24 src/main/resources/static/render.js
  78. +27 −0 src/main/resources/static/themes/dark.css
  79. +18 −0 src/main/resources/static/themes/light.css
  80. +39 −0 src/main/resources/static/vditor-render.css
108 changes: 108 additions & 0 deletions .gitea/workflows/workflow.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
name: Build Plugin JAR File

on:
push:
branches: [ main, dev ]

jobs:
build:
runs-on: debian-12
steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Set up JDK 17
uses: actions/setup-java@v2
with:
distribution: 'temurin'
cache: 'gradle'
java-version: 17
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 18
- uses: pnpm/action-setup@v2.0.1
name: Install pnpm
id: pnpm-install
with:
version: 8
run_install: false
- name: Get pnpm store directory
id: pnpm-cache
run: |
echo "::set-output name=pnpm_cache_dir::$(pnpm store path)"
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/console/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install Frontend Dependencies
run: |
./gradlew pnpmInstall
- name: Build with Gradle
run: |
# Set the version with tag name when releasing
if [ $GITHUB_REF_NAME == "main" ]; then
version=${{ github.event.release.tag_name }}
version=${version#v}
sed -i "s/version=.*-SNAPSHOT$/version=$version/1" gradle.properties
else
build=${{ github.run_number }}
echo 当前版本的构建号为: $build
sed -i "s/\(version=[0-9]*\.[0-9]*\.[0-9]*\)-SNAPSHOT/\1-build.$build-SNAPSHOT/g" gradle.properties
fi
./gradlew clean build -x test
- name: Archive plugin-starter jar
uses: actions/upload-artifact@v3
with:
name: plugin-starter
path: |
build/libs/*.jar
retention-days: 90

github-release:
runs-on: debian-12
needs: build
if: github.event_name == 'release'
steps:
- name: Download plugin-starter jar
uses: actions/download-artifact@v2
with:
name: plugin-starter
path: build/libs
- name: Get Name of Artifact
id: get_artifact
run: |
ARTIFACT_PATHNAME=$(ls build/libs/*.jar | head -n 1)
ARTIFACT_NAME=$(basename ${ARTIFACT_PATHNAME})
echo "Artifact pathname: ${ARTIFACT_PATHNAME}"
echo "Artifact name: ${ARTIFACT_NAME}"
echo "ARTIFACT_PATHNAME=${ARTIFACT_PATHNAME}" >> $GITHUB_ENV
echo "ARTIFACT_NAME=${ARTIFACT_NAME}" >> $GITHUB_ENV
echo "RELEASE_ID=${{ github.event.release.id }}" >> $GITHUB_ENV
- name: Upload a Release Asset
uses: actions/github-script@v2
if: github.event_name == 'release'
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
console.log('environment', process.versions);
const fs = require('fs').promises;
const { repo: { owner, repo }, sha } = context;
console.log({ owner, repo, sha });
const releaseId = process.env.RELEASE_ID
const artifactPathName = process.env.ARTIFACT_PATHNAME
const artifactName = process.env.ARTIFACT_NAME
console.log('Releasing', releaseId, artifactPathName, artifactName)
await github.repos.uploadReleaseAsset({
owner, repo,
release_id: releaseId,
name: artifactName,
data: await fs.readFile(artifactPathName)
});
19 changes: 19 additions & 0 deletions .github/workflows/cd.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: CD

on:
release:
types:
- published

jobs:
cd:
uses: halo-sigs/reusable-workflows/.github/workflows/plugin-cd.yaml@v2
secrets:
halo-pat: ${{ secrets.HALO_PAT }}
permissions:
contents: write
with:
node-version: "18"
pnpm-version: "8"
app-id: app-uBcYw
ui-path: "console"
17 changes: 17 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: CI

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
ci:
uses: halo-sigs/reusable-workflows/.github/workflows/plugin-ci.yaml@v1
with:
node-version: "18"
pnpm-version: "8"
ui-path: "console"
4 changes: 4 additions & 0 deletions .github/workflows/workflow.yaml
Original file line number Diff line number Diff line change
@@ -41,6 +41,10 @@ jobs:
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/console/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Download Vditor assets
run: |
chmod a+x download_dist.sh
bash download_dist.sh
- name: Install Frontend Dependencies
run: |
./gradlew pnpmInstall
136 changes: 136 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
# 更新记录

### 1.8.0

- ⬆️ 升级Vditor版本至3.10.4
- ✨ 添加对Katex macros的支持 #53
- 🐛 修复粘贴图片时会出现载错误位置的bug #46

### v1.7.1

- ⚰️ 移除对已过时的 PluginWrapper 的引用 #43

### v1.7.0

- ⬆️ 调整 Halo 最低兼容版本为 `2.14.0`
- ✨ 添加`使用第一个h1作为标题`的功能 #33
- 🐛 修复代码块颜色异常的问题 #38

### v1.6.2

- ⬆️ 升级Vditor版本至3.10.2
- ✨ 添加页面加载CDN设置,添加自定义CDN支持 `#30`

#### 关于CDN配置

由于Vditor本体加载CDN的方式,无法支持类似`cdnjs`的url格式。当前内置4种CDN: `内置`,`jsDelivr`, `unpkg`, `zstatic`

**如何确认cdn是否可用:**

您可以访问`<你的cdn>/dist/index.min.js`,能加载出来则说明可用,同时注意cdn是否包含该版本资源,版本升级信息会在更新日志中体现。

### v1.6.1

- 🐛 修复单页文章加载Vditor资源时 version 未成功替换问题 `#27`
- 🐛 添加遗漏的 plantuml 渲染器 `#28`
- 🐛 修复多媒体链接无法渲染的问题
- 🐛 修复多媒体渲染的大小问题

### v1.6.0

- ⬆️ 修改Vditor为官方版本(Vditor 3.9.9)
- ✨ 添加 Vditor Debugger 设置
- 🐛 修复行内公式渲染的问题 #22
- 🐛 修复操作栏修改属性不生效的问题 #20 \[vditor]
- 🐛 修复在 PJAX 主题下渲染器无法正常处理的问题 #24
- 🐛 修复 render 样式与其他样式冲突的问题
- 🐛 修复`插入图片`在 Safari 中不可用的问题

### v1.5.1

- ✨ 添加图集的快捷插入按钮
- 🐛 修复脑图、图标、echart暗色模式渲染错误的问题
- 🐛 解决更新插件前台资源缓存的问题
- 🐛 解决暗色模式渲染异常的问题
- 🐛 解决主题代码块等样式覆盖的问题

### v1.5.0

- ✨ 使用新的快速插入表单,界面更美观
- ✨ 支持渲染其他插件/主题的自定义组件(需要开发者支持)
- ✨ 支持加入快速插入链接(需要开发者支持)
- ✨ 允许用户禁用HTML代码块隐藏的特性
- ✨ 支持用户自定义上传图片的格式
- ✨ vditor-halo-render添加组图组件(gallery)
- 🐛 修复图片拖拽插入错位的问题
- 🐛 修复echarts,mindmap无法渲染的问题
- 🐛 修复所见即所得模式下超链接颜色丢失的问题
- 🚀 优化前端渲染逻辑,去除无用的dom查询

### v1.4.0

- ✨ 支持编辑器加载状态展示
- ✨ 支持拖拽上传图片
- ✨ 添加快速插入自定义块的按钮
- ✨ 添加仅在Markdown文章注入解析器的选项
- ⬆️ 更新halo-vditor至3.9.9版本(对应vditor 3.9.8)
- ⬆️ 更新vditor-halo-render到1.1.0版本
- ✨ 重新设计tip、git模块
- ✨ 添加资源下载模块
- ✨ 为git添加fork、topic信息
- ✨ 为git添加缓存
- ✨ 添加对Gitee的支持
- 🐛 修复invalid type界面边框与其他模块不对齐的问题

### v1.3.2

- 🐛 编辑器编写代码块出现闪屏问题

### v1.3.1

- 🐛 修复Vditor编辑器切换到其他编辑器导致的样式冲突问题
- 🐛 修复编辑器在Halo中出现页面滚动条的问题
- 🐛 修复前台数学公式无法渲染的问题

### v1.3.0

- ✨ 支持更多tips渲染
- ✨ 支持github仓库信息渲染
- ✨ 升级vditor为分支halo-vditor版本 https://github.com/justice2001/halo-vditor
- ⬆️ 升级halo-vditor到3.9.8版本(对应vditor3.9.7)
- 🐛 修复页面偶尔出现加载shi问题,使用本地资源

### v1.2.0

- 🚸 将设置拆分为编辑器和渲染两个部分
- ✨ 为编辑器添加多国语言支持(简中、繁中、英语)
- ✨ 添加启用编辑器代码块的选项
- ✨ 添加跟随Joe 3.0主题切换暗色模式的选项
- 🐛 修复单页未对内容进行渲染的问题
- 🐛 修复所见即所得模式下部分内容被小工具栏遮挡的问题

### v1.1.0

- ⬆️ 更新 Halo 最低兼容版本至 2.8.0
- ✨ 添加默认编辑模式设置
- ✨ 添加打字机模式设置
- ✨ 添加插入图片功能(快捷键:⇧⌘P)
- ✨ 添加自动暗色模式的支持
- 🐛 修复了编辑器中有序列表左侧序号消失的问题
- 🐛 修复全屏编辑器左侧被Halo导航栏遮挡的问题
- 🧪 实验性特性: 支持多媒体渲染

### v1.0.1

- ⚡ 修改为仅在文章中加入vditor render,优化部分页面加载速度
- ⚡ 修改vditor库从本地加载,优化页面加载速度
- 🐛 修复由于id重复可能存在的冲突问题
- ⚰️ 删除了部分无用代码

### v1.0.0

- ✨ 集成强大的Markdown编辑器Vditor进Halo中
- ✨ 提供所见即所得(wysiwyg)、即时渲染(ir)、分屏渲染(sv)三种渲染模式
- ✨ 支持大纲、数学公式、脑图、图表、流程图、甘特图、时序图、五线谱、多媒体、语音阅读、标题锚点、代码高亮及复制、graphviz 渲染、plantumlUML图
- ✨ 支持字符计数
- ✨ 支持在前台注入渲染脚本(需在设置中开启)
Loading