generated from halo-dev/plugin-starter
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Ryan Wang <[email protected]>
- Loading branch information
Showing
34 changed files
with
3,277 additions
and
859 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: "20" | ||
pnpm-version: "9" | ||
app-id: app-SUvBR | ||
ui-path: "ui" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,76 +1,31 @@ | ||
# plugin-starter | ||
# Halo 内容格式助手 | ||
|
||
Halo 2.0 插件开发快速开始模板。 | ||
为 Halo 添加内容格式转换和导出的功能。 | ||
|
||
## 开发环境 | ||
**⚠️ 目前格式转换并不能完全保留原格式,部分语法可能在不同的编辑器中有不同的表现,建议谨慎使用。** | ||
|
||
插件开发的详细文档请查阅:<https://docs.halo.run/developer-guide/plugin/introduction> | ||
## 特性 | ||
|
||
所需环境: | ||
- 支持 Markdown 和富文本格式的互转。 | ||
- 支持导出文章内容,支持转换为 Markdown 文件导出。 | ||
|
||
1. Java 17 | ||
2. Node 20 | ||
3. pnpm 9 | ||
4. Docker (可选) | ||
## 使用方式 | ||
|
||
克隆项目: | ||
1. 下载,目前提供以下两个下载方式: | ||
- Halo 应用市场:<https://www.halo.run/store/apps/app-SUvBR> | ||
- GitHub Releases:访问 [Releases](https://github.com/ruibaby/plugin-content-tools/releases) 下载 Assets 中的 JAR 文件。 | ||
2. 安装,插件安装和更新方式可参考:<https://docs.halo.run/user-guide/plugins> | ||
3. 在文章管理页面中,点击文章的 `···` 按钮即可看到 **转换** 和 **导出** 的功能选项。 | ||
4. 也可以在文章编辑页面顶部的编辑器选择框中选择 **内容格式转换器** 进行转换。 | ||
|
||
```bash | ||
git clone [email protected]:halo-sigs/plugin-starter.git | ||
## 预览 | ||
|
||
# 或者当你 fork 之后 | ||
![](./images/plugin-content-tools-preview-1.png) | ||
|
||
git clone [email protected]:{your_github_id}/plugin-starter.git | ||
``` | ||
![](./images/plugin-content-tools-preview-2.png) | ||
|
||
```bash | ||
cd path/to/plugin-starter | ||
``` | ||
![](./images/plugin-content-tools-preview-3.png) | ||
|
||
### 运行方式 1(推荐) | ||
![](./images/plugin-content-tools-preview-4.png) | ||
|
||
> 此方式需要本地安装 Docker | ||
```bash | ||
# macOS / Linux | ||
./gradlew pnpmInstall | ||
|
||
# Windows | ||
./gradlew.bat pnpmInstall | ||
``` | ||
|
||
```bash | ||
# macOS / Linux | ||
./gradlew haloServer | ||
|
||
# Windows | ||
./gradlew.bat haloServer | ||
``` | ||
|
||
执行此命令后,会自动创建一个 Halo 的 Docker 容器并加载当前的插件,更多文档可查阅:<https://docs.halo.run/developer-guide/plugin/basics/devtools> | ||
|
||
### 运行方式 2 | ||
|
||
> 此方式需要使用源码运行 Halo | ||
编译插件: | ||
|
||
```bash | ||
# macOS / Linux | ||
./gradlew build | ||
|
||
# Windows | ||
./gradlew.bat build | ||
``` | ||
|
||
修改 Halo 配置文件: | ||
|
||
```yaml | ||
halo: | ||
plugin: | ||
runtime-mode: development | ||
fixedPluginPath: | ||
- "/path/to/plugin-starter" | ||
``` | ||
最后重启 Halo 项目即可。 | ||
![](./images/plugin-content-tools-preview-5.png) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
src/main/java/cc/ryanc/contenttools/ContentToolsPlugin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package cc.ryanc.contenttools; | ||
|
||
import org.springframework.stereotype.Component; | ||
import run.halo.app.plugin.BasePlugin; | ||
import run.halo.app.plugin.PluginContext; | ||
|
||
/** | ||
* @author ryanwang | ||
*/ | ||
@Component | ||
public class ContentToolsPlugin extends BasePlugin { | ||
|
||
public ContentToolsPlugin(PluginContext pluginContext) { | ||
super(pluginContext); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,19 @@ | ||
# Refer https://docs.halo.run/developer-guide/plugin/basics/manifest | ||
|
||
apiVersion: plugin.halo.run/v1alpha1 | ||
kind: Plugin | ||
metadata: | ||
# The name defines how the plugin is invoked, A unique name | ||
name: starter | ||
name: content-tools | ||
spec: | ||
enabled: true | ||
requires: ">=2.20.0" | ||
author: | ||
name: Halo | ||
website: https://github.com/halo-dev | ||
logo: logo.png | ||
homepage: https://github.com/halo-dev/plugin-starter#readme | ||
repo: https://github.com/halo-dev/plugin-starter | ||
issues: https://github.com/halo-dev/plugin-starter/issues | ||
displayName: "插件快速开始模板" | ||
description: "这是一个插件快速开始模板" | ||
name: Ryan Wang | ||
website: https://github.com/ruibaby | ||
logo: icon.svg | ||
homepage: https://github.com/ruibaby/plugin-content-tools#readme | ||
repo: https://github.com/ruibaby/plugin-content-tools | ||
issues: https://github.com/ruibaby/plugin-content-tools/issues | ||
displayName: "内容格式助手" | ||
description: "支持文章内容格式转换和导出" | ||
license: | ||
- name: "GPL-3.0" | ||
url: "https://github.com/halo-dev/plugin-starter/blob/main/LICENSE" | ||
url: "https://github.com/ruibaby/plugin-content-tools/blob/main/LICENSE" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,10 @@ | ||
/// <reference types="vite/client" /> | ||
/// <reference types="unplugin-icons/types/vue" /> | ||
|
||
export {}; | ||
|
||
declare module "axios" { | ||
export interface AxiosRequestConfig { | ||
mute?: boolean; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.