Skip to content

Commit

Permalink
docs: rename parameter for tp.file.exists from filename to filepath
Browse files Browse the repository at this point in the history
refs: #977
  • Loading branch information
Zachatoo committed Dec 2, 2023
1 parent 84cc6b3 commit d8a08bc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions docs/documentation.toml
Original file line number Diff line number Diff line change
Expand Up @@ -271,12 +271,12 @@ example = """<% tp.file.cursor_append("Some text") %>"""

[tp.file.functions.exists]
name = "exists"
description = """The filename of the file we want to check existence. The fullpath to the file, relative to the Vault and containing the extension, must be provided. e.g. `"MyFolder/SubFolder/MyFile"`."""
definition = "tp.file.exists(filename: string)"
description = """Check to see if a file exists by it's file path. The full path to the file, relative to the Vault and containing the extension, must be provided."""
definition = "tp.file.exists(filepath: string)"

[[tp.file.functions.exists.args]]
name = "filename"
description = "The filename of the file we want to check existence."
name = "filepath"
description = "The full file path of the file we want to check existence for."

[[tp.file.functions.exists.examples]]
name = "File existence"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,9 @@ export class InternalModuleFile extends InternalModule {
};
}

generate_exists(): (filename: string) => Promise<boolean> {
return async (filename: string) => {
const path = normalizePath(filename);
generate_exists(): (filepath: string) => Promise<boolean> {
return async (filepath: string) => {
const path = normalizePath(filepath);
return await app.vault.exists(path);
};
}
Expand Down

0 comments on commit d8a08bc

Please sign in to comment.