-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
329 additions
and
3 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 |
---|---|---|
@@ -1 +1,3 @@ | ||
export * from "./lib/zhi-blog-api" | ||
import BlogConfig, { PasswordType, PageType } from "./lib/blogConfig" | ||
import BlogPlaceholder from "./lib/blogPlaceholder" | ||
export { BlogConfig, BlogPlaceholder, PasswordType, PageType } |
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,143 @@ | ||
/* | ||
* Copyright (c) 2023, Terwer . All rights reserved. | ||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | ||
* | ||
* This code is free software; you can redistribute it and/or modify it | ||
* under the terms of the GNU General Public License version 2 only, as | ||
* published by the Free Software Foundation. Terwer designates this | ||
* particular file as subject to the "Classpath" exception as provided | ||
* by Terwer in the LICENSE file that accompanied this code. | ||
* | ||
* This code is distributed in the hope that it will be useful, but WITHOUT | ||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
* version 2 for more details (a copy is included in the LICENSE file that | ||
* accompanied this code). | ||
* | ||
* You should have received a copy of the GNU General Public License version | ||
* 2 along with this work; if not, write to the Free Software Foundation, | ||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | ||
* | ||
* Please contact Terwer, Shenzhen, Guangdong, China, youweics@163.com | ||
* or visit www.terwer.space if you need additional information or have any | ||
* questions. | ||
*/ | ||
|
||
import BlogPlaceholder from "./blogPlaceholder" | ||
|
||
/** | ||
* 页面类型 | ||
*/ | ||
export enum PageType { | ||
/** | ||
* Markdown正文 | ||
*/ | ||
Markdown, | ||
/** | ||
* HTML | ||
*/ | ||
Html, | ||
/** | ||
* 属性 | ||
*/ | ||
Formatter, | ||
/** | ||
* Markdown和属性 | ||
*/ | ||
Markdown_And_Formatter, | ||
/** | ||
* MDX | ||
* | ||
* @see https://mdxjs.com/ | ||
*/ | ||
MDX, | ||
} | ||
|
||
/** | ||
* 密码类型 | ||
*/ | ||
export enum PasswordType { | ||
/** | ||
* 密码 | ||
*/ | ||
PasswordType_Password, | ||
/** | ||
* token | ||
*/ | ||
PasswordType_Token, | ||
} | ||
/** | ||
* 博客通用配置类 | ||
*/ | ||
abstract class BlogConfig { | ||
/** | ||
* 首页 | ||
*/ | ||
protected home: string | ||
|
||
/** | ||
* API地址 | ||
*/ | ||
protected apiUrl: string | ||
|
||
/** | ||
* 用户名 | ||
*/ | ||
protected username: string | ||
|
||
/** | ||
* 密码类型 | ||
*/ | ||
protected passwordType: PasswordType | ||
|
||
/** | ||
* 密码 | ||
*/ | ||
protected password: string | ||
|
||
/** | ||
* 是否发布 | ||
*/ | ||
protected apiStatus: boolean | ||
|
||
/** | ||
* 博客名(API获取) | ||
*/ | ||
protected blogName: string | ||
|
||
/** | ||
* 文章别名key | ||
*/ | ||
protected posidKey: string | ||
|
||
/** | ||
* 文章预览链接 | ||
*/ | ||
protected previewUrl: string | ||
|
||
/** | ||
* 文章类型 | ||
*/ | ||
protected pageType: PageType | ||
|
||
/** | ||
* 操作提示 | ||
*/ | ||
protected placeholder: BlogPlaceholder | undefined | ||
|
||
protected constructor() { | ||
this.home = "" | ||
this.apiUrl = "" | ||
this.username = "" | ||
this.passwordType = PasswordType.PasswordType_Password | ||
this.password = "" | ||
this.apiStatus = false | ||
this.blogName = "" | ||
this.posidKey = "" | ||
this.previewUrl = "" | ||
this.pageType = PageType.Markdown | ||
this.placeholder = undefined | ||
} | ||
} | ||
|
||
export default BlogConfig |
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,97 @@ | ||
/* | ||
* Copyright (c) 2023, Terwer . All rights reserved. | ||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | ||
* | ||
* This code is free software; you can redistribute it and/or modify it | ||
* under the terms of the GNU General Public License version 2 only, as | ||
* published by the Free Software Foundation. Terwer designates this | ||
* particular file as subject to the "Classpath" exception as provided | ||
* by Terwer in the LICENSE file that accompanied this code. | ||
* | ||
* This code is distributed in the hope that it will be useful, but WITHOUT | ||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
* version 2 for more details (a copy is included in the LICENSE file that | ||
* accompanied this code). | ||
* | ||
* You should have received a copy of the GNU General Public License version | ||
* 2 along with this work; if not, write to the Free Software Foundation, | ||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | ||
* | ||
* Please contact Terwer, Shenzhen, Guangdong, China, youweics@163.com | ||
* or visit www.terwer.space if you need additional information or have any | ||
* questions. | ||
*/ | ||
|
||
/** | ||
* 配置提示 | ||
* | ||
* @author terwer | ||
* @since 1.0.0 | ||
*/ | ||
abstract class BlogPlaceholder { | ||
/** | ||
* 首页操作提示 | ||
*/ | ||
protected homePlaceholder: string | ||
|
||
/** | ||
* API 地址操作提示 | ||
*/ | ||
protected apiUrlPlaceholder: string | ||
|
||
/** | ||
* 用户名操作提示 | ||
*/ | ||
protected usernamePlaceholder: string | ||
|
||
/** | ||
* 密码类型操作提示 | ||
*/ | ||
protected passwordTypePlaceholder: string | ||
|
||
/** | ||
* 密码操作提示 | ||
*/ | ||
protected passwordPlaceholder: string | ||
|
||
/** | ||
* API状态是否正常操作提示 | ||
*/ | ||
protected apiStatusPlaceholder: boolean | ||
|
||
/** | ||
* 博客名(API获取)操作提示 | ||
*/ | ||
protected blogNamePlaceholder: string | ||
|
||
/** | ||
* 文章别名key操作提示 | ||
*/ | ||
protected posidKeyPlaceholder: string | ||
|
||
/** | ||
* 文章预览链接操作提示 | ||
*/ | ||
protected previewUrlPlaceholder: string | ||
|
||
/** | ||
* 文章类型操作提示 | ||
*/ | ||
protected pageTypePlaceholder: string | ||
|
||
constructor() { | ||
this.homePlaceholder = "" | ||
this.apiUrlPlaceholder = "" | ||
this.usernamePlaceholder = "" | ||
this.passwordTypePlaceholder = "" | ||
this.passwordPlaceholder = "" | ||
this.apiStatusPlaceholder = false | ||
this.blogNamePlaceholder = "" | ||
this.posidKeyPlaceholder = "" | ||
this.previewUrlPlaceholder = "" | ||
this.pageTypePlaceholder = "" | ||
} | ||
} | ||
|
||
export default BlogPlaceholder |
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
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,49 @@ | ||
/* | ||
* Copyright (c) 2023, Terwer . All rights reserved. | ||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | ||
* | ||
* This code is free software; you can redistribute it and/or modify it | ||
* under the terms of the GNU General Public License version 2 only, as | ||
* published by the Free Software Foundation. Terwer designates this | ||
* particular file as subject to the "Classpath" exception as provided | ||
* by Terwer in the LICENSE file that accompanied this code. | ||
* | ||
* This code is distributed in the hope that it will be useful, but WITHOUT | ||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
* version 2 for more details (a copy is included in the LICENSE file that | ||
* accompanied this code). | ||
* | ||
* You should have received a copy of the GNU General Public License version | ||
* 2 along with this work; if not, write to the Free Software Foundation, | ||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | ||
* | ||
* Please contact Terwer, Shenzhen, Guangdong, China, youweics@163.com | ||
* or visit www.terwer.space if you need additional information or have any | ||
* questions. | ||
*/ | ||
import { BlogConfig, BlogPlaceholder, PasswordType } from "zhi-blog-api" | ||
import SiyuanPlaceholder from "./SiyuanPlaceholder"; | ||
|
||
/** | ||
* 思源笔记配置 | ||
* | ||
* @author terwer | ||
* @since 1.0.0 | ||
*/ | ||
class SiyuanConfig extends BlogConfig { | ||
/** | ||
* 思源笔记操作提示 | ||
* | ||
* @protected | ||
*/ | ||
protected override placeholder: SiyuanPlaceholder | ||
|
||
constructor() { | ||
super() | ||
this.apiUrl = "http://127.0.0.1:6806" | ||
this.passwordType = PasswordType.PasswordType_Token | ||
this.password = "" | ||
this.placeholder = new SiyuanPlaceholder() | ||
} | ||
} |
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,35 @@ | ||
/* | ||
* Copyright (c) 2023, Terwer . All rights reserved. | ||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | ||
* | ||
* This code is free software; you can redistribute it and/or modify it | ||
* under the terms of the GNU General Public License version 2 only, as | ||
* published by the Free Software Foundation. Terwer designates this | ||
* particular file as subject to the "Classpath" exception as provided | ||
* by Terwer in the LICENSE file that accompanied this code. | ||
* | ||
* This code is distributed in the hope that it will be useful, but WITHOUT | ||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
* version 2 for more details (a copy is included in the LICENSE file that | ||
* accompanied this code). | ||
* | ||
* You should have received a copy of the GNU General Public License version | ||
* 2 along with this work; if not, write to the Free Software Foundation, | ||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | ||
* | ||
* Please contact Terwer, Shenzhen, Guangdong, China, youweics@163.com | ||
* or visit www.terwer.space if you need additional information or have any | ||
* questions. | ||
*/ | ||
|
||
import { BlogPlaceholder } from "zhi-blog-api"; | ||
|
||
/** | ||
* 思源笔记操作提示 | ||
*/ | ||
class SiyuanPlaceholder extends BlogPlaceholder{ | ||
|
||
} | ||
|
||
export default SiyuanPlaceholder |