From cfa4e6d4ec5b385d1aa412efab1e0674df153826 Mon Sep 17 00:00:00 2001 From: Kacper Kula Date: Thu, 27 Mar 2025 12:19:59 +0000 Subject: [PATCH] feat: adding basename and parent SQL variables --- CHANGELOG.md | 3 +++ docs/using-properties.md | 2 ++ manifest.json | 2 +- package.json | 2 +- src/codeblockHandler/CodeblockProcessor.ts | 2 ++ src/codeblockHandler/inline/InlineProcessor.ts | 2 ++ versions.json | 3 ++- 7 files changed, 13 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cd94b5c..92567c7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +# 0.30.1 (2025-03-27) +- feat: added basename and parent SQL variables + # 0.30.0 (2025-03-26) - feat: added ability to reference tables from the other files in `table()` functions - feat: added ability to reference tables by their header name diff --git a/docs/using-properties.md b/docs/using-properties.md index ec3c48d..96d1c63 100644 --- a/docs/using-properties.md +++ b/docs/using-properties.md @@ -10,6 +10,8 @@ On top of properties current file exposes in the properties, you can also use th | ---------- | ------------------------------------------- | ---------------- | | @path | Full path of the file you're editing | `folder/file.md` | | @fileName | Filename with extension | `file.md` | +| @basename | Filename without extension | `file` | +| @parent | Path of the parent folder (`/` if none) | `folder` | | @extension | Extension of the file (without leading dot) | `md` | diff --git a/manifest.json b/manifest.json index 24a3014..2040314 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "id": "sqlseal", "name": "SQLSeal", - "version": "0.30.0", + "version": "0.30.1", "minAppVersion": "0.15.0", "description": "Use SQL in your notes to query your vault files and CSV content.", "author": "hypersphere", diff --git a/package.json b/package.json index 7e13fd9..b2816e5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "sqlseal", - "version": "0.30.0", + "version": "0.30.1", "description": "A plugin for Obsidian that allows you to run SQL queries on your notes.", "main": "main.js", "scripts": { diff --git a/src/codeblockHandler/CodeblockProcessor.ts b/src/codeblockHandler/CodeblockProcessor.ts index 2e2347e..5b76cea 100644 --- a/src/codeblockHandler/CodeblockProcessor.ts +++ b/src/codeblockHandler/CodeblockProcessor.ts @@ -118,6 +118,8 @@ export class CodeblockProcessor extends MarkdownRenderChild { ...fileCache?.frontmatter ?? {}, path: file.path, fileName: file.name, + basename: file.basename, + parent: file.parent?.path, extension: file.extension, } diff --git a/src/codeblockHandler/inline/InlineProcessor.ts b/src/codeblockHandler/inline/InlineProcessor.ts index e28bc77..97a5bcf 100644 --- a/src/codeblockHandler/inline/InlineProcessor.ts +++ b/src/codeblockHandler/inline/InlineProcessor.ts @@ -61,6 +61,8 @@ export class InlineProcessor extends MarkdownRenderChild { ...fileCache?.frontmatter ?? {}, path: file.path, fileName: file.name, + basename: file.basename, + parent: file.parent?.path, extension: file.extension, } diff --git a/versions.json b/versions.json index f981b8d..8bead15 100644 --- a/versions.json +++ b/versions.json @@ -55,5 +55,6 @@ "0.28.3": "0.15.0", "0.28.4": "0.15.0", "0.29.0": "0.15.0", - "0.30.0": "0.15.0" + "0.30.0": "0.15.0", + "0.30.1": "0.15.0" } \ No newline at end of file