Search...Search plugins and themes...
⌘K
Sign in
  • Get started
  • Download
  • Pricing
  • Enterprise
  • Account
  • Obsidian
  • Overview
  • Sync
  • Publish
  • Canvas
  • Mobile
  • Web Clipper
  • CLI
  • Learn
  • Help
  • Developers
  • Changelog
  • About
  • Roadmap
  • Blog
  • Resources
  • System status
  • License overview
  • Terms of service
  • Privacy policy
  • Security
  • Community
  • Plugins
  • Themes
  • Discord
  • Forum / 中文论坛
  • Merch store
  • Brand guidelines
Follow us
DiscordTwitterBlueskyThreadsMastodonYouTubeGitHub
© 2026 Obsidian

Formula Forge

unxokunxok1 downloads

Render bases formulas in your notes, define global formulas and functions, and more formula-related features.

Add to Obsidian
Formula Forge screenshot
Formula Forge screenshot
  • Overview
  • Scorecard
  • Updates2


Formula Forge

Render bases formulas in your notes, define global formulas and functions, and more formula-related features.

Table of Contents:

  • Formula rendering
    • Inline code
    • Codeblock
  • Utilities
    • md()
    • define() / Null.define()
    • then() / Null.then()
  • Global formulas
  • Custom functions
    • Global scope example
    • Type scope example
  • API
  • Templater integration

Formula rendering

You can render formulas in your notes in inline code or a codeblock. These formulas will automatically re-render when metadata changes.

Both this and file refer to the current file which the formula is being rendered in.

Inline code

By default, the inline code syntax is an equals sign. For example:

`=this.file.name + 2`

inline rendering demo

Codeblock

By default, the codeblock language is base-formula. For example:

```base-formula
"Created: " + file.ctime
```

codeblock rendering demo

With formula codeblocks, you can also add CSS classes by adding them after the codeblock language. For example:

```base-formula my-class my-other-class
"Created: " + file.ctime
```

Utilities

FF provides a few extra utility functions you can use in your formulas. More may be added in the future.

md()

md(input: number): html

  • Converts a markdown srting into a code snippet that renders as HTML.
  • Example: md("*italic*, **bold**, ~~strikethrough~~")

define() / Null.define()

define(name: string, value: any): null

  • Defines a local variable.
  • Typically used in conjunction with then().
  • Example: define(who, "world").then("Hello " + who + "!") returns "Hello world!".
  • It is also a function of the Null type, so it can be chained to define multiple variables.
  • Example: define("num1", 6).define("num2", 7).then(num1 + num2) returns 13.

then() / Null.then()

then(any: Any...): any

  • Evaluates every argument passed to it, but only returns the last argument provided.
  • Typically used in conjunction with define().
  • Example: then(define("foo", "bar"), "this string is ignored", foo) returns "bar".
  • It is also a function of the Null type, which is useful to chain on a define() call.
  • Example: define(who, "world").then("Hello " + who + "!") returns "Hello world!".

Global formulas

In the plugin settings, you can define global formulas which can be accessed in any base or formula in your vault.

These formulas are treated exactly the same as regular formula properties that you would define within a base, so they can be used within filters and as a property.

global formula demo

Custom functions

In the plugin settings, you can define custom functions which can accept typed parameters and be used in any base or formula in your vault.

These functions can be defined in the global scope or as a function of a specific data type.

You can copy the YAML for these examples and import them by selecting the three dots near the Custom functions setting and selecting Import YAML.

Global scope example

name: formatDollars
description: Converts a number into a string dollar amount
scope: Global
scopeType: Any
parameters:
  - name: num
    type: Number
    optional: false
    variadic: false
formula: '"$" + num.round(2)'

Type scope example

name: random
description: Gets a random item from the list
scope: Type
scopeType: List
parameters: []
formula: self[(random() * self.length).floor()]

API

FF provides an API for some formula-related features in your own plugins and scripts. See below for an overview of its use.

For the full type definition, see src/Api/api.ts.

// access the API
const { api } = app.plugins.plugins["formula-forge"];

// ensure the API is ready for use (because it's loaded asynchronously)
// do this when accessing the API in things like startup scripts
api.on("ready", () => {
    // do some stuff...
});

// evaluate a formula
const output = api.evaluateFormula(
    "this.file.path", // the formula to eval
    "path/to/note.md" // the file to use as `this` and `file`
);

// render formula output to the DOM
output.renderTo(myEl, app.renderContext);

// get the actual value of a formula's output
const raw = api.normalizeFormulaValue(output);
typeof raw === "string"; // true

Templater integration

To use formulas in templater syntax, add the following as a user script:

path/to/user-scripts/formula.js

/**
 * Evaluates a formula
 * @param {string} formula - The formula to evaluate
 * @param {string | TFile | undefined} file - The file to evaulate this formula in the context of. You only need to pass this if using the "this" or "file" keywords.
 * @returns The formula output
 */
function evaluateFormula(formula, file) {
    const { api } = app.plugins.plugins["formula-forge"];
    return api.evaluateFormula(formula, file).toString();
}

module.exports = evaluateFormula;

Example templater syntax:

<% tp.user.formula("2 + 2") %>

<% tp.user.formula(`"Created: " + file.ctime`, tp.config.target_file) %>
99%
HealthExcellent
ReviewPassed
Details
Current version
1.0.0
Last updated
16 hours ago
Created
4 weeks ago
Updates
2 releases
Downloads
1
Compatible with
Obsidian 1.12.7+
Platforms
Desktop, Mobile
License
MIT
Report bugRequest featureReport plugin
Sponsor
Buy Me a Coffee
Author
unxokunxok
github.com/unxok
GitHubunxok
  1. Community
  2. Plugins
  3. Formula Forge

Related plugins

Importer

Convert your data to Markdown files you can use in Obsidian. Works with Apple Notes, OneNote, Evernote, Notion, Google Keep, and many other formats.

Advanced Tables

Improved table navigation, formatting, and manipulation.

Notebook Navigator

A better file browser and calendar inspired by Apple Notes, Bear, Evernote and Day One.

Templater

Create and use dynamic templates.

Minimal Theme Settings

Control the colors and fonts in Minimal Theme.

Advanced Canvas

Supercharge your canvas experience. Create presentations, flowcharts and more.

BRAT

Easily install a beta version of a plugin for testing.

Recent Files

Display a list of recently opened files.

Smart Connections

Find related notes and excerpts while writing. Your link building copilot displays relevant content in graph + list view. A local embedding model powers semantic search. Zero setup. No API key.

Homepage

Open a note, base, or workspace on startup, or set it for quick access later.