aqeja_ClipperMaster-for-Obs.../common.ts

160 lines
5.8 KiB
TypeScript
Raw Permalink Normal View History

2025-03-25 02:03:10 +00:00
import { App, getLanguage } from "obsidian"
export const folderName = 'ClipperMaster'
export const upsertFile = async (app: App, fileName: string, content: string) => {
const folder = await app.vault.getFolderByPath(folderName)
if (!folder) {
await app.vault.createFolder(folderName)
}
const filePath = `${folderName}/${fileName}.md`
const file = await app.vault.getFileByPath(filePath)
if (file) {
await app.vault.modify(file, content)
} else {
await app.vault.create(filePath, content)
}
}
const language = getLanguage()
export const isZh = language.startsWith('zh')
const getTexts = () => {
if (isZh) {
return {
listeningPort: '监听端口号',
desc: 'HTTP请求的端口号',
enterPort: '输入端口号',
error: '必须是一个有效的端口号 (1 - 65535)',
welcome: '欢迎使用 ClipperMaster for Obsidian',
2025-04-11 08:36:43 +00:00
fileSaved:'🎉 已保存到:',
guidanceButton: '使用说明',
guidanceDesc: '点击打开使用说明页面',
openGuidance: '打开说明'
2025-03-25 02:03:10 +00:00
}
}
return {
listeningPort: 'Listening Port',
desc: 'Port to listen for HTTP requests',
enterPort: 'Enter Port Number',
error: 'Must be a valid port number (1 - 65535)',
welcome: 'Welcome to ClipperMaster for Obsidian',
2025-04-11 08:36:43 +00:00
fileSaved: '🎉 File saved to:',
guidanceButton: 'Guidance',
guidanceDesc: 'Click to open guidance page',
openGuidance: 'Open Guidance'
2025-03-25 02:03:10 +00:00
}
}
export const texts = getTexts()
export const Welcome = isZh ? `# ClipperMaster for Obsidian
[ClipperMaster](https://clippermaster.com) 是一款强大的 Chrome 浏览器扩展,能让你轻松从网页中提取结构化数据,构建你的专属信息数据库。
![](https://clippermaster.com/clippermaster-intro.png)
# ClipperMaster Obsidian 使
****
ClipperMaster Obsidian **ClipperMaster Chrome ** Obsidian线
---
## ****
- **** Markdown Obsidian
- ****
---
## ****
### **1. ClipperMaster Chrome **
Chrome [Chrome ](https://chromewebstore.google.com/detail/clippermaster/bdilooeboaoifijdnpomfoinefbokjlj) 安装。
### **2. ClipperMaster Obsidian **
1. Obsidian **** ****
2. **** **ClipperMaster**
3. **** ****
4. **Port**
### **3. Chrome **
1. ClipperMaster Chrome **Options** **** **** **Obsidian**
2. Obsidian **Port**
---
## ****
### **1. **
-
### **2. **
- **Obsidian**
### **3. **
- 访 [ClipperMaster ](https://clippermaster.com) 或者 [给我们发送邮件](mailto:tony@clippermaster.com)。
---
## ****
- [ ClipperMaster Chrome ](https://chromewebstore.google.com/detail/clippermaster/bdilooeboaoifijdnpomfoinefbokjlj)
- ClipperMaster Obsidian
---
` : `# ClipperMaster for Obsidian
[ClipperMaster](https://clippermaster.com) is a powerful Chrome extension that empowers you to effortlessly extract structured data from web pages, building your personalized information database.
![](https://clippermaster.com/clippermaster-intro.png)
# ClipperMaster Obsidian Plugin User Guide
**Turn Web Content into Your Knowledge Assets with One Click**
The ClipperMaster Obsidian plugin is the perfect companion to the **ClipperMaster Chrome plugin**, helping you seamlessly send and store structured information extracted from web pages to Obsidian, creating an automated knowledge management pipeline.
---
## **Plugin Functionality**
- **One-Click Storage**: Convert text, images, and other content extracted from web pages into Markdown format and save them to Obsidian.
- **Structured Storage**: Supports templated storage, keeping your content organized.
---
## **Installation Steps**
### **1. Install the ClipperMaster Chrome Plugin**
If not already installed, get the Chrome plugin from the [Chrome Web Store](https://chromewebstore.google.com/detail/clippermaster/bdilooeboaoifijdnpomfoinefbokjlj).
### **2. Install the ClipperMaster Obsidian Plugin**
1. Open Obsidian, go to **Settings** **Community plugins**.
2. Click **Browse**, search for **ClipperMaster**.
3. After finding the plugin, click **Install**, then **Enable**.
4. In the plugin settings, get or modify the **Port**.
### **3. Configure the Chrome Plugin**
1. Open the ClipperMaster Chrome plugin, go to **Options** **Automations** **Add Automation** Send to **Obsidian**.
2. Enter the **Port** set in Obsidian.
---
## **Frequently Asked Questions**
### **1. What web content does the plugin support?**
- Text, links, images, etc., can be extracted and stored.
### **2. Is there a fee?**
- The **Send to Obsidian** feature is completely free.
### **3. How do I get technical support?**
- Visit the [ClipperMaster Official Website](https://clippermaster.com) or [send us an email](mailto:tony@clippermaster.com).
---
## **Experience It Now**
Click the links below to start your knowledge management revolution:
- [Install ClipperMaster Chrome Plugin](https://chromewebstore.google.com/detail/clippermaster/bdilooeboaoifijdnpomfoinefbokjlj)
- Install ClipperMaster Obsidian Plugin
---`