mirror of
https://github.com/jxpeng98/obsidian-to-NotionNext
synced 2026-07-29 08:08:34 +08:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
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:
|
||||||
|
|||||||
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 {
|
||||||
|
|||||||
2892
package-lock.json
generated
2892
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user