mirror of
https://github.com/jxpeng98/obsidian-to-NotionNext
synced 2026-07-29 16:35:57 +08:00
Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e3669e7a83 | ||
|
|
617bb370dc | ||
|
|
310cf3043c | ||
|
|
c701acbfaa | ||
|
|
d8c755cfce |
2
.github/workflows/release.yml
vendored
2
.github/workflows/release.yml
vendored
@@ -6,7 +6,7 @@ on:
|
|||||||
- "*"
|
- "*"
|
||||||
|
|
||||||
env:
|
env:
|
||||||
PLUGIN_NAME: your-plugin-id # Change this to match the id of your plugin.
|
PLUGIN_NAME: obsidian-to-notion # Change this to match the id of your plugin.
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
|
|||||||
@@ -61,6 +61,9 @@ https://www.notion.so/myworkspace/a8aec43384f447ed84390e8e42c2e089?v=...
|
|||||||
|
|
||||||
# 感谢
|
# 感谢
|
||||||
[开发流程 | Obsidian 插件开发文档](https://luhaifeng666.github.io/obsidian-plugin-docs-zh/zh/getting-started/development-workflow.html)
|
[开发流程 | Obsidian 插件开发文档](https://luhaifeng666.github.io/obsidian-plugin-docs-zh/zh/getting-started/development-workflow.html)
|
||||||
|
|
||||||
[GitHub - devbean/obsidian-wordpress: An obsidian plugin for publishing docs to WordPress.](https://github.com/devbean/obsidian-wordpress)
|
[GitHub - devbean/obsidian-wordpress: An obsidian plugin for publishing docs to WordPress.](https://github.com/devbean/obsidian-wordpress)
|
||||||
|
|
||||||
[GitHub - obsidianmd/obsidian-api](https://github.com/obsidianmd/obsidian-api)
|
[GitHub - obsidianmd/obsidian-api](https://github.com/obsidianmd/obsidian-api)
|
||||||
[GitHub - zhaohongxuan/obsidian-weread-plugin: Obsidian Weread Plugin is an plugin to sync Weread(微信读书) hightlights and annotations into your Obsidian Vault.](https://github.com/zhaohongxuan/obsidian-weread-plugin)
|
|
||||||
|
[GitHub - zhaohongxuan/obsidian-weread-plugin: Obsidian Weread Plugin is an plugin to sync Weread(微信读书) hightlights and annotations into your Obsidian Vault.](https://github.com/zhaohongxuan/obsidian-weread-plugin)
|
||||||
|
|||||||
4
main.ts
4
main.ts
@@ -10,6 +10,7 @@ import {
|
|||||||
Plugin,
|
Plugin,
|
||||||
PluginSettingTab,
|
PluginSettingTab,
|
||||||
Setting,
|
Setting,
|
||||||
|
normalizePath
|
||||||
} from "obsidian";
|
} from "obsidian";
|
||||||
import { join } from "path";
|
import { join } from "path";
|
||||||
import * as fs from "fs";
|
import * as fs from "fs";
|
||||||
@@ -95,8 +96,9 @@ export default class MyPlugin extends Plugin {
|
|||||||
const nowFile = app.workspace.getActiveFile();
|
const nowFile = app.workspace.getActiveFile();
|
||||||
if (nowFile) {
|
if (nowFile) {
|
||||||
const filePath: string = nowFile.path;
|
const filePath: string = nowFile.path;
|
||||||
|
// @ts-ignore
|
||||||
const basePath: string = nowFile.vault.adapter.basePath;
|
const basePath: string = nowFile.vault.adapter.basePath;
|
||||||
const fullPath = join(basePath, filePath);
|
const fullPath = normalizePath(join(basePath, filePath));
|
||||||
console.log("fullpath", fullPath);
|
console.log("fullpath", fullPath);
|
||||||
const fileData = fs.readFileSync(fullPath, "utf8");
|
const fileData = fs.readFileSync(fullPath, "utf8");
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"id": "obsidian-to-notion",
|
"id": "obsidian-to-notion",
|
||||||
"name": "Obsidian shared to Notion",
|
"name": "Obsidian shared to Notion",
|
||||||
"version": "0.3.0",
|
"version": "0.3.4",
|
||||||
"minAppVersion": "0.0.1",
|
"minAppVersion": "0.0.1",
|
||||||
"description": "This is a plugin for Obsidian. This plugin share obsidian md file to notion with notion api",
|
"description": "This is a plugin for Obsidian. This plugin share obsidian md file to notion with notion api",
|
||||||
"author": "Easychris",
|
"author": "Easychris",
|
||||||
|
|||||||
2892
package-lock.json
generated
2892
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "obsidian-to-notion",
|
"name": "obsidian-to-notion",
|
||||||
"version": "0.3.0",
|
"version": "0.3.4",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"description": "This is a plugin for Obsidian. This plugin share obsidian md file to notion with notion api",
|
"description": "This is a plugin for Obsidian. This plugin share obsidian md file to notion with notion api",
|
||||||
"main": "main.js",
|
"main": "main.js",
|
||||||
|
|||||||
4
release.sh
Executable file
4
release.sh
Executable file
@@ -0,0 +1,4 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
node update-version.js $1
|
||||||
|
git tag -a $1 -m $1
|
||||||
|
git push origin $1
|
||||||
26
update-version.js
Normal file
26
update-version.js
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
// update package.json version
|
||||||
|
import fs from 'fs';
|
||||||
|
|
||||||
|
const packageJson = JSON.parse(fs.readFileSync('./package.json', 'utf8'));
|
||||||
|
|
||||||
|
console.log(packageJson.version);
|
||||||
|
|
||||||
|
|
||||||
|
// get node args
|
||||||
|
const args = process.argv.slice(2);
|
||||||
|
|
||||||
|
packageJson.version = args[0];
|
||||||
|
|
||||||
|
console.log(packageJson.version);
|
||||||
|
|
||||||
|
|
||||||
|
// write package.json
|
||||||
|
fs.writeFileSync('./package.json', JSON.stringify(packageJson, null, 2));
|
||||||
|
|
||||||
|
// read manifest.json
|
||||||
|
const manifestJson = JSON.parse(fs.readFileSync('./manifest.json', 'utf8'));
|
||||||
|
|
||||||
|
manifestJson.version = args[0];
|
||||||
|
|
||||||
|
// write manifest.json
|
||||||
|
fs.writeFileSync('./manifest.json', JSON.stringify(manifestJson, null, 2));
|
||||||
Reference in New Issue
Block a user