lorenbll39 downloadsAdds Bases formula objects for bookmarks: file.bookmarks, file.hasBookmarks(), bookmark.path() and bookmark.folder().
Adds Bases formula objects for the bookmarks of the current file.
file.bookmarks as a Bases formula instance function. Returns a sorted, deduplicated list of bookmark objects for the file represented by the current Bases row. Each bookmark displays as its final segment only (e.g. Bases for path Projects/Obsidian/Bases). If a file is bookmarked in multiple groups, the list contains one object per bookmark.file.bookmarks in any Bases formula property. The function is called on the file value of the row and requires no arguments: file.bookmarks.bookmark is a Value of type bookmark. Isolating an element (e.g. file.bookmarks[0] or file.bookmarks.map(value)) allows per-bookmark operations.map or index access, then call bookmark methods on the isolated value.bookmark.path() / bookmark.fullPath() returns the full escaped path (groups + bookmark title) joined with / without spaces. A / inside a title is escaped as //.file.bookmarks.map(value.path()) or file.bookmarks[0].path().bookmark.folder() / bookmark.parent() returns the immediate parent folder (single escaped segment) or null if the bookmark has no folder above it.file.bookmarks.map(value.folder()). Returns null for root bookmarks; use value.folder() ?? "" or filter to handle.file.hasBookmarks() returns a boolean (true if the file has any bookmarks, false otherwise).file.hasBookmarks() or file.hasBookmarks() == true. Use in Bases filter: hasBookmarks()./ without spaces, escaping / inside titles as //./ in titles.items / _items) and for each matching file bookmark builds fullPath from [...groupPath, title].map(s=>s.replaceAll("/","//")).join("/").var(--link-color)). Clicking reveals the Bookmarks view, opens any closed bookmark folder (group) containing the bookmark, scrolls the target into view and highlights only the final file/folder bookmark as if hovered/selected (no Bases cell highlight).BookmarkValue.renderTo renders an <a class="bookmark-path-link"> that calls highlightBookmark; the Bookmarks view is revealed, the full folder chain for the bookmark's escaped path is opened (each is-collapsed ancestor group is expanded via click and is-collapsed/hidden removal), the matching bookmark's .tree-item-self (resolved via view.itemDoms WeakMap, [data-path], or .tree-item-inner text fallback) is scrolled into view and flashed with bookmark-highlight + is-active (cleared after 2.2 s, previous highlights are removed, retries if the view is still rendering). mousedown/mouseup are cancelled and the Bases cell is blurred to prevent border highlight.file whose path equals the current file path are evaluated; other bookmark types are ignored.obsidian.d.ts typings and vary across Obsidian versions.npm install
No additional configuration is required.
main.js, manifest.json, and styles.css to <Vault>/.obsidian/plugins/bookmarks-in-bases/.file.bookmarks. Examples:file.bookmarks
file.hasBookmarks()
file.bookmarks.map(value.path())
file.bookmarks.map(value.folder())
file.bookmarks[0].path()
file.bookmarks[0].folder()
file.hasBookmarks()
file.bookmarks.map(value.path()).contains("Projects/Obsidian/Bases")
Behavior:
file.bookmarks returns [] if the file cannot be resolved, if the Bookmarks plugin is unavailable, or if the file has no file-type bookmarks. Otherwise returns a sorted list of bookmark objects; display is the final segment only (e.g. Bases), escaped with // inside titles.file.hasBookmarks() returns true if the file has at least one bookmark, false otherwise (boolean, not list).bookmark.path() / bookmark.fullPath() returns the full escaped path including the final bookmark title (e.g. Projects/Obsidian/Bases). Joined with / without spaces.bookmark.folder() / bookmark.parent() returns the immediate parent folder (single escaped segment) or null if the bookmark is at the root (no folder above it). Use value.folder() ?? "" to coerce to string.is-active/bookmark-highlight (hover/selected look, cleared after 2.2 s). The Bases cell is not highlighted, and links have no underline or tooltip.Limitations:
[] or null if the structure is not found.Compile the plugin from src/main.ts to main.js:
npm run dev # watch mode, inline sourcemap
npm run build # production build, minified, no sourcemap
Run the linter:
npm run lint
Manual install for testing:
npm run build.main.js, manifest.json, and styles.css (if present) to <Vault>/.obsidian/plugins/bookmarks-in-bases/.Versioning: update version in manifest.json and package.json, then run npm version patch|minor|major to update versions.json.
This plugin exposes no user-facing settings. There are no configuration keys, no settings tab, and no persisted data. Behavior is fully determined by the current file and the vault's bookmark tree.
minAppVersion is 1.13.7 as declared in manifest.json.isDesktopOnly is false; the plugin does not use desktop-only APIs.0BSD. See LICENSE.
Copyright (C) 2020-2026 by Dynalist Inc.
Report issues at https://github.com/LorenBll/Bookmarks-In-Bases/issues.