-
Notifications
You must be signed in to change notification settings - Fork 3
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
1 parent
fadf384
commit 8824656
Showing
7 changed files
with
82 additions
and
13 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
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
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
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,4 +1,24 @@ | ||
import { App } from "obsidian"; | ||
import * as path from "path"; | ||
|
||
export function toValidFilename(filename: string): string { | ||
let validFilename = filename.replace(/[^a-zA-Z0-9öüäÖÜÄ.\-]/g, ""); | ||
return validFilename; | ||
} | ||
|
||
export function toObsidianPath(path: string): string { | ||
return path.replace(/\\/g, "/"); | ||
} | ||
|
||
export function createMissingFolders(app: App, filepath: string) { | ||
const folder = path.dirname(filepath); | ||
const folders = folder.contains("\\") ? folder.split("\\") : folder.split("/"); | ||
|
||
let currentFolder = ""; | ||
for (const folder of folders) { | ||
currentFolder = path.join(currentFolder, folder); | ||
|
||
if (!app.vault.getAbstractFileByPath(currentFolder)) | ||
app.vault.createFolder(currentFolder); | ||
} | ||
} |
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 |
---|---|---|
|
@@ -10,5 +10,6 @@ | |
} | ||
|
||
.docx-wrapper { | ||
padding: 0 !important; | ||
background-color: var(--background-primary) !important; | ||
} |