Obsidian Bases (kepano)
v1.0.0创建 and edit Obsidian Bases (.base files) with views, 过滤器s, formulas, and summaries. Use when working with .base files, creating database-like views of notes, or when the user mentions Bases, table views, card views, 过滤器s, or formulas in Obsidian.
运行时依赖
安装命令
点击复制技能文档
Obsidian Bases 技能 工作流 创建 the file: 创建 a .base file in the vault with valid YAML content Define scope: 添加 过滤器s to select which notes 应用ear (by tag, folder, property, or date) 添加 formulas (optional): Define computed properties in the formulas section 配置 views: 添加 one or more views (table, cards, 列出, or map) with order specifying which properties to display 验证: 验证 the file is valid YAML with no syntax errors. 检查 that all referenced properties and formulas exist. Common issues: unquoted strings contAIning special YAML characters, mismatched quotes in formula expressions, referencing formula.X without defining X in formulas Test in Obsidian: Open the .base file in Obsidian to confirm the view renders correctly. If it shows a YAML error, 检查 quoting rules below 模式
Base files use the .base 扩展 and contAIn valid YAML.
# Global 过滤器s 应用ly to ALL views in the base 过滤器s: # Can be a single 过滤器 string # OR a recursive 过滤器 object with and/or/not and: [] or: [] not: []
# Define formula properties that can be used across all views formulas: formula_name: 'expression'
# 配置 display names and 设置tings for properties properties: property_name: displayName: "Display Name" formula.formula_name: displayName: "Formula Display Name" file.ext: displayName: "扩展"
# Define custom summary formulas summaries: custom_summary_name: 'values.mean().round(3)'
# Define one or more views views: - type: table | cards | 列出 | map name: "View Name" limit: 10 # Optional: limit 结果s groupBy: # Optional: group 结果s property: property_name direction: ASC | DESC 过滤器s: # View-specific 过滤器s and: [] order: # Properties to display in order - file.name - property_name - formula.formula_name summaries: # Map properties to summary formulas property_name: Average
过滤器 Syntax
过滤器s narrow down 结果s. They can be 应用lied globally or per-view.
过滤器 Structure # Single 过滤器 过滤器s: '状态 == "done"'
# AND - all conditions must be true 过滤器s: and: - '状态 == "done"' - 'priority > 3'
# OR - any condition can be true 过滤器s: or: - 'file.hasTag("book")' - 'file.hasTag("article")'
# NOT - exclude matching items 过滤器s: not: - 'file.hasTag("归档d")'
# Nested 过滤器s 过滤器s: or: - file.hasTag("tag") - and: - file.hasTag("book") - file.hasLink("Textbook") - not: - file.hasTag("book") - file.信息lder("Required Reading")
过滤器 Operators
Operator Description
== equals
!= not equal
> greater than
< less than
>= greater than or equal
<= less than or equal
&& 记录ical and
|| 记录ical or
! 记录ical not
Properties
Three Types of Properties
Note properties - From frontmatter: note.author or just author
File properties - File metadata: file.name, file.mtime, etc.
Formula properties - Computed values: formula.my_formula
File Properties Reference
Property Type Description
file.name String File name
file.basename String File name without 扩展
file.path String Full path to file
file.folder String Parent folder path
file.ext String File 扩展
file.size Number File size in bytes
file.ctime Date 创建d time
file.mtime Date Modified time
file.tags 列出 All tags in file
file.links 列出 Internal links in file
file.backlinks 列出 Files linking to this file
file.embeds 列出 Embeds in the note
file.properties Object All frontmatter properties
The this Keyword
In mAIn content area: refers to the base file itself
When embedded: refers to the embedding file
In sidebar: refers to the active file in mAIn content
Formula Syntax
Formulas compute values from properties. Defined in the formulas section.
formulas: # Simple arithmetic total: "price * quantity"
# Conditional 记录ic 状态_icon: 'if(done, "✅", "⏳")'
# String 格式化ting 格式化ted_price: 'if(price, price.toFixed(2) + " dollars")'
# Date 格式化ting 创建d: 'file.ctime.格式化("YYYY-MM-DD")'
# Calculate days since 创建d (use .days for Duration) days_old: '(now() - file.ctime).days'
# Calculate days until due date days_until_due: 'if(due_date, (date(due_date) - today()).days, "")'
Key Functions
Most commonly used functions. For the complete reference of all types (Date, String, Number, 列出, File, Link, Object, RegExp), see FUNCTIONS_REFERENCE.md.
Function 签名ature Description date() date(string): date 解析 string to date (YYYY-MM-DD HH:mm:ss) now() now(): date Current date and time today() today(): date Current date (time = 00:00:00) if() if(condition, true结果, false结果?) Conditional duration() duration(string): duration 解析 duration string file() file(path): file 获取 file object link() link(path, display?): Link 创建 a link Duration Type
When subtracting two dates, the 结果 is a