Skip to content

Commit

Permalink
refactor: 项目结构重构
Browse files Browse the repository at this point in the history
  • Loading branch information
terwer committed Jun 5, 2023
1 parent d8bb857 commit 1129f3d
Show file tree
Hide file tree
Showing 138 changed files with 587 additions and 49,957 deletions.
1 change: 0 additions & 1 deletion .env.development.local.example

This file was deleted.

38 changes: 2 additions & 36 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,38 +1,4 @@
module.exports = {
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:svelte/recommended",
"turbo",
"prettier",
],

parser: "@typescript-eslint/parser",

overrides: [
{
files: ["*.svelte"],
parser: "svelte-eslint-parser",
// Parse the script in `.svelte` as TypeScript by adding the following configuration.
parserOptions: {
parser: "@typescript-eslint/parser",
},
},
],

plugins: ["@typescript-eslint", "prettier"],

rules: {
// Note: you must disable the base rule as it can report incorrect errors
semi: "off",
quotes: "off",
"no-undef": "off",
"@typescript-eslint/no-var-requires": "off",
"@typescript-eslint/no-this-alias": "off",
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/no-unused-vars": "off",
"@typescript-eslint/no-explicit-any": "off",
"turbo/no-undeclared-env-vars": "off",
"prettier/prettier": "error",
},
root: true,
extends: ["./node_modules/@terwer/eslint-config-custom/typescript/index.cjs"],
}
7 changes: 3 additions & 4 deletions .prettierrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@
*/

module.exports = {
semi: false,
singleQuote: false,
printWidth: 120,
plugins: ["prettier-plugin-svelte"]
semi: false,
singleQuote: false,
printWidth: 120
}
603 changes: 0 additions & 603 deletions CHANGELOG.md

This file was deleted.

661 changes: 0 additions & 661 deletions LICENSE

This file was deleted.

144 changes: 2 additions & 142 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,145 +1,5 @@
[中文](README_zh_CN.md)

# Publisher
# siyuan-plugin-publisher

![](https://raw.githubusercontent.com/terwer/siyuan-plugin-publisher/main/plugins/publisher-main/public/icon.png)

Publishing articles from siyuan-note to platforms such as Yuque, Cnblogs, WordPress, Typecho, Hexo, Hugo, etc.

Support features such as fast publishing, image bed management, platform expansion, smart labels, etc.

This plugin promises that all functions will be free forever. If you want to support the developer, please [Donate](https://github.com/terwer/siyuan-plugin-publisher#Donate) freely.

> 🌹Reminder: This plugin is an upgraded version of the original `Siyuan Notes Publishing Tool` widget. Its functions
> include all the functions provided by the original widget. It also provides a convenient menu operation entry, and has
> carried out a series of bug fixes and experience optimization.
> If you want to see previous version, please refer to my original
> widget: [sy-post-publisher](https://github.com/terwer/src-sy-post-publisher)
## Core Features

- **Extremely fast release**: One-time configuration, one-click release
- **Picture bed management**: Integrate PicGO picture bed, support s3, minio, watermark plugin
- **Support for extensions**: Based on the unified blog API specification, built-in support for metaweblogAPI, WordPress
and Github, and provides a unified adapter, which can theoretically be extended to any platform
- **Platform switch**: All platforms support enabling and disabling, the blog garden is enabled by default, and can be
disabled at any time
- **Dynamic Newly Added**: Support custom adding platform
- **Smart Classification**: Support smart tags, smart slug aliases, smart summaries, and continue to improve
- **Article Binding**: Support linking existing platform articles to Siyuan Notes to facilitate follow-up management,
support Siyuan->platform one-way synchronization
- **Adapt to Theme**: Automatically adapt to dark mode and light mode
- **Language support**: multi-language support, support Chinese version and English version
- **Release view**: Support multiple release views, simple mode, detailed mode and source code mode
- **Multiple deployments**: support Siyuan notes plugin, Chrome browser extension, self-deployment

## Platform List

Names not listed in order

- Cnblogs
- WordPress
- Yu Que
- Github
- Hexo
- Hugo

## Platform Adaptation Plan

If you have a platform you want to use, but this tool has not yet been implemented, you can submit
the [Siyuan Note Publishing Tool Plugin Platform Adaptation Tracking Form](https://terwergreen.feishu.cn/share/base/form/shrcnGRdThUiqnhBg15xgclMM0c%20)
, the developer will consider including it in the development plan.

For platform adaptation, please refer
to [Latest Adaptation](https://terwergreen.feishu.cn/share/base/view/shrcnWT2IGIz1r94z9qvqUghDzd)

## FAQ

* Q1:How to install the publishing tool plugin? Where can I find his entrance after installation?

A1:Find **`Bazaar->Plugins->Publishing Tools`** to download and enable.

The installation process requires no further action. This is no different from the download and installation of other plugins.

After the installation is complete, find the ✈️ icon on the top right toolbar, click the menu, and follow the corresponding instructions to use it.


* Q2:After installing the publishing tool plugin, do I still need to install the widget?

A2:**unnecessary. ​**

The plugin version contains all the functions of the widget version.


* Q3:I am not used to the operation of the new version, and I want to continue to use the previous widget through the plugin, is that possible?

A3:**Yes.**

The plugin has a builtin bridge by default, which can invoke the widget through the plugin. This feature needs to be turned on in `Settings -> Use Widget`​.

<u>Note 1: The plugin version uses the builtin menu of the plugin system, and the menu slot will be disabled when the widget version is activated via plugin. ​</u>

<u>Note 2: After opening the widget version, all functions of the plugin version will be disabled to avoid confusion.</u>

**We strongly recommend you to use the plugin version, because the plugin version will be the main version for long-term maintenance in the future, and the widget version is obsolete, and it is only used to fix problems and compatible with historical users.**


* Q4:I used to use `Custom JS Fragment`​ or add `Widget`​ directly, do I still need to download the plugin now?

A4:**Optional.** But we highly recommended to remove JS snippets and widgets to download the plugin version.

If you don't want to use the plugin version, you don't need to download it, just use the original `custom JS fragment`​ or add `widget`​ to continue using.

If you want to use the plugin version, then we strongly recommend that you delete the previously added `custom JS snippets`​ and `widgets`​, download the plugin version directly, and enable it. No other additional action is required.


* Q5:Is it possible to migrate my historical configuration data items to the plugin?

* A5:**Yes.**

Please go to `Settings->Import and Export->Import the historical data of the widget version. ` Operation.

Note: The widget version configuration data import only supports `sy-p-cfg-v0.8.0.json` and `picgo.json`.


* Q6:What should I do if the platform I need to publish is not provided by the publishing tool?
* A6:Reference: [Platform Adaptation Plan](https://github.com/terwer/siyuan-plugin-publisher/blob/main/README_zh_CN.md#platform-adaptation-plan "Platform Adaptation Plan")


## Donate

If you approve of this project, invite me to have a cup of coffee, which will encourage me to keep updating and create
more useful tools~

### Wechat

<div>
<img src="https://static-rs-terwer.oss-cn-beijing.aliyuncs.com/donate/wechat.jpg" alt="wechat" style="width:280px;height:375px;" />
</div>

### Alipay

<div>
<img src="https://static-rs-terwer.oss-cn-beijing.aliyuncs.com/donate/alipay.jpg" alt="alipay" style="width:280px;height:375px;" />
</div>

# Thanks

- Thanks to the third-party framework for supporting the bottom layer of this project

Names not listed in order

|Name|version|vendor|
| :---------: | :-----: | :---------: |
|turbo|1.9+|Vercel|
|vite|4.2+|Evan You|
|Svelte|3.57+|Rich Harris|
|TypeScript|5.0+|Microsoft|
|siyuan-note|2.9.0+|D,V|
- Thanks to [leolee9086](https://github.com/leolee9086) for the icon resource
Publishing articles from siyuan-note to platforms such as Yuque, Cnblogs, WordPress, Typecho, Hexo, Hugo, etc.
133 changes: 2 additions & 131 deletions README_zh_CN.md
Original file line number Diff line number Diff line change
@@ -1,134 +1,5 @@
[English](README.md)

# 发布工具
# {{name}}

![](https://raw.githubusercontent.com/terwer/siyuan-plugin-publisher/main/plugins/publisher-main/public/icon.png)

将思源笔记的文章发布到语雀、Cnblogs、WordPress、Typecho、Hexo、Hugo 等支持的开放平台,支持极速发布、图床管理、平台扩展、智能标签等特色功能。

本插件承诺,所有功能永久免费。如果您想支持开发者,请在这里 [随意打赏](https://github.com/terwer/siyuan-plugin-publisher/blob/main/README_zh_CN.md#捐赠)

> 🌹 温馨提示:这个插件是原 `思源笔记发布工具` 挂件的插件升级版,功能包含原有挂件提供的所有功能,同时提供了方便的菜单操作入口,并进行了一系列问题修复和体验优化。
> 如果想看 `0.8.0`
> 之前的版本,请参考我之前写的的挂件:[sy-post-publisher](https://github.com/terwer/src-sy-post-publisher)
## 核心特色

- **极速发布**:一次配置,一键发布
- **图床管理**:集成 PicGO 图床,支持 s3、minio、水印插件
- **支持扩展**:基于统一的博客 API 规范,内置 metaweblogAPI 、 WordPress 和 Github 支持,并提供了统一的适配器,理论上可支持扩展到任何平台
- **平台开关**:所有平台均支持启用禁用,默认开启博客园,可随时禁用
- **动态新增**:支持自定义添加平台
- **智能分类**:支持智能标签、智能 slug 别名、智能摘要,并持续完善中
- **文章绑定**:支持关联已有的平台文章到思源笔记,方便后续管理,支持思源-> 平台单向同步
- **适应主题**:自动适配暗黑模式与浅色模式
- **语言支持**:多语言支持,支持中文版和英文版
- **发布视图**:支持多种发布视图,简单模式、详细模式和源码模式
- **多种部署**:支持思源笔记插件、Chrome 浏览器扩展、自部署

## 平台列表

排名不分先后

- 博客园
- WordPress
- 语雀
- Github
- Hexo
- Hugo

## 平台适配计划

如果你有想使用的平台,但是此工具目前还没实现,可在这里提交 [思源笔记发布工具插件平台适配跟踪表](https://terwergreen.feishu.cn/share/base/form/shrcnGRdThUiqnhBg15xgclMM0c)
,开发者会考虑列入开发计划中。

平台适配情况请查看请参考 [最新适配情况](https://terwergreen.feishu.cn/share/base/view/shrcnWT2IGIz1r94z9qvqUghDzd)

## FAQ

* Q1:发布工具插件怎么安装?安装之后在哪里找到他的入口?

A1:找到 **`集市->插件->发布工具`** 下载启用即可。

安装过程无需其他任何操作。这个跟其他插件的下载安装无任何区别。

安装完成后,在顶部右侧工具栏找到 ✈️ 图标,点击菜单,按照对应说明操作使用即可。


* Q2:装了发布工具插件之后,还需要安装挂件吗?

A2:**不需要。**

插件版包含挂件版的所有功能。


* Q3:我不习惯新版操作,想继续通过插件使用以前的挂件,可以吗?

A3:**可以。**

插件默认内置了一个桥接器,可以通过插件唤起挂件。该功能需要在 `设置 -> 使用挂件版`​​ 开启。

<u>注意 1:插件版用插件系统内置的菜单,所有插件版唤起的时候菜单插槽会禁用。</u>

<u>注意 2:开启挂件版之后会关闭插件版的所有功能,避免引起混淆。</u>

**我们强烈推荐您使用插件版,因为插件版将是以后长久维护的主要版本,挂架版本已废弃,仅作为修复问题以及兼容历史用户。**


* Q4:我以前是通过 `自定义JS片段 ​`​​ 或者 直接添加 `挂件`​​ 来使用的,现在还需要下载该插件吗?

A4:**可选。** 但是我们强烈推荐您删除 JS 片段和挂件,下载插件版使用。

如果您不想使用插件版,那么您无需下载,使用原有 `自定义 JS 片段`​​ 或者 添加 `挂件`​​ 继续使用即可。

如果您想使用插件版,那么我们强烈建议您删除之前添加的 `自定义JS片段`​​ 和 `挂件`​​,直接下载插件版,启用即可。无需其他额外操作。


* Q5:我的历史配置数据项迁移到插件,可以吗?
* A5:**可以。**

请在 `设置->导入导出->导入挂件版历史数据。` 操作。

注意:挂件版配置数据导入仅支持 `sy-p-cfg-v0.8.0.json``picgo.json`


* Q6:我需要发布的平台,发布工具没有提供怎么办?
* A6:参考:[平台适配计划](https://github.com/terwer/siyuan-plugin-publisher/blob/main/README_zh_CN.md#平台适配计划 "平台适配计划")

## 捐赠

如果您认可这个项目,请我喝一杯咖啡吧,这将鼓励我持续更新,并创作出更多好用的工具~

### 微信

<div>
<img src="https://static-rs-terwer.oss-cn-beijing.aliyuncs.com/donate/wechat.jpg" alt="wechat" style="width:280px;height:375px;" />
</div>

### 支付宝

<div>
<img src="https://static-rs-terwer.oss-cn-beijing.aliyuncs.com/donate/alipay.jpg" alt="alipay" style="width:280px;height:375px;" />
</div>

# 感谢

* 感谢第三方框架对本项目底层的支持

排名不分先后

|Name|version|vendor|
| :---------: | :-----: | :---------: |
|turbo|1.9+|Vercel|
|vite|4.2+|Evan You|
|Svelte|3.57+|Rich Harris|
|TypeScript|5.0+|Microsoft|
|siyuan-note|2.9.0+|D,V|

* 感谢 [leolee9086](https://github.com/leolee9086) 提供的图标资源
{{description}}
Binary file modified icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions src/index.styl → index.styl
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@
// 建议使用 iconfont ,可以调色,可以调整大小
// https://fontawesome.com/search?q=yuque&o=r&m=free
// https://www.iconfont.cn/search/index?searchType=icon&q=cnblogs&page=1&tag=&fromCollection=1&fills=
.pt-icon{
.iconfont-icon{
width 12px
height 12px
margin-right 10px
margin-top 3px
}
margin-top 0
}
Loading

0 comments on commit 1129f3d

Please sign in to comment.