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

Rant-Lang

lanicelanice4k downloads

Thin wrapper around the high-level procedural templating language Rant.

Add to Obsidian
  • Overview
  • Scorecard
  • Updates21

Thin wrapper around the Rant language Rust crate to be used in Obsidian.

"Rant is a high-level procedural templating language with a diverse toolset for easily creating dynamic code templates, game dialogue, stories, name generators, test data, and much more." - from Rant's GitHub page

Table of Contents

  • Usage
  • Examples
    • Inline
    • Styling
    • Links
    • Dice-roller
    • Lists
  • Embedding Rant Blocks
    • Inline
    • Within codeblocks
  • Installation
    • From within Obsidian
    • Via BRAT
    • Manually

Usage

Use a code block with the rant type, in which you can enter a Rant program. The program is then compiled and executed with Rant, and the result shown in the Obsidian preview mode.

Use the command Re-rant with random seed (active file) (default hotkey: Cmd+R/Ctrl+R) to run Rant again on each block in the active (preview) file.

It's also possible to insert a Rant program inline by starting an inline code block with "rant:".

Within a rant block (both inline and code blocks), the result of the program is then rendered with the Obsidian MarkdownParser. That means that you can add styling, links, or other markdown-processing elements inside a rant block, and they will be rendered accordingly. In order to avoid Rant syntax errors, you can wrap these elements in double quotes, because Rant treats everything inside double quotes as string literals, and will not evaluate the content.

For common markdown operations, the following global functions are added to the Rant context: bold, italic, bold-italic, highlight, link

You can also embed the result of an existing rant codeblock into any other document or other rant block by using block links, see these examples for details.

Examples

Note: As Rant chooses random block elements to run, the output of the following examples will vary with each re-run of Rant, so what's shown here is just one possible result.

A Rant program that produces a shuffled deck of cards, taken from the official Rant examples:

```rant
[shuffle: 
  [rep: 2] {(:Joker)} 
  [cat: **(A;2;3;4;5;6;7;8;9;10;J;Q;K); **(♠;♥;♣;♦) |> list]
]
```

Could produce this output (with a random order on each re-rant):

Cards example

Inline

An inline Rant program:

This inline Rant block is `rant: {neat|awesome|fantastic}`!

Result:

Inline example

Styling

This is an example of how to apply markdown styling using the global markdown functions (the single backtick before the bold function serves as hint):

```rant
`[bold: {Hello|Hi|Hey}] world!
```

Result:

Styling example

Links

You can use any form of links within a Rant code block, and it properly renders (including page preview on hover):

```rant
[rep:10][sep:"-"]{[link: A Page]|"[External link](https://www.wikipedia.org)"|Just text}
```

Result:

Link example

Dice-roller

Example using the dice-roller plugin within a Rant block:

```rant
Suddenly "`dice: 2d4`" {goblins|dragons|gelatinous cubes} charge at you!
```

Result:

Dice-roller example

Lists

A Rant program can output lists like this:

```rant
A list of all kinds of stuff:\n
[rep:5][sep:\n]{"- [[A page]]"|"- Just text"|"- `dice: 2d12`"}
```

Result:

List example

Embedding Rant Blocks

Inline

When you have a rant codeblock inside a document called Programs that you want to embed in another document, first give it an ID using the ^ notation:

```rant
{heads|tails|edge}
```
^coin-flip

Then you can embed it like so:

Flipping a coin... It landed on `rant: [[Programs#^coin-flip]]`!

Within codeblocks

Inside a rant codeblock, you can import rant codeblocks from other documents by starting the codeblock with import: [[File#^{block-id}]] statements.

Important: import: statements can only be used as very first lines in a rant codeblock. Once any line does not begin with import:, the regular rant program starts, and you can't import anything else. One import per line.

Here is an example, we define rant blocks that define functions, import the block, and call the functions:

```rant
[$flip-coin: heads; tails] {
    {<heads>|<tails>}
}
```
^flip-coin

```rant
import: [[Programs#^flip-coin]]

[$flip-coin-with-values] {
    [flip-coin: Heads; Tails]
}
```
^flip-coin-with-values

```rant
import: [[Programs#^flip-coin-with-values]]

"Flipping a coin... "[flip-coin-with-values]!
```

As you can see, nested imports are supported, so you can import one (or multiple) programs in one block, and then import that block in another, and so on.

Installation

From within Obsidian

  1. Open Settings > Community plugins
  2. Make sure "Safe mode" is off
  3. In the community plugins browser, search for "Rant-Lang"
  4. Install & Enable
  5. Profit

Via BRAT

  1. Add lanice/obsidian-rant to the list of Beta plugins in the Obsidian42 - BRAT settings menu
  2. Enable the plugin in the Community plugins settings menu

Manually

  1. Download the latest release
  2. Extract the obsidian-rant folder from the zip to your vault <vault>/.obsidian/plugins/
  3. Reload Obsidian
  4. Enable the plugin in the Community plugins settings menu
63%
HealthFair
ReviewCaution
About
Execute Rant scripts in code blocks or inline to generate procedural text—templates, dialogue, name generators, random data, and more. Render outputs in preview with full Markdown parsing, embed block results via links, and re-run scripts with new random seeds for varied output.
TemplatingCodeWriting
Details
Current version
0.5.9
Last updated
4 years ago
Created
4 years ago
Updates
21 releases
Downloads
4k
Compatible with
Obsidian 0.12.15+
Platforms
Desktop, Mobile
License
MIT
Report bugRequest featureReport plugin
Author
lanicelanice
github.com/lanice
GitHublanice
  1. Community
  2. Plugins
  3. Templating
  4. Rant-Lang

Related plugins

Templater

Create and use dynamic templates.

JS Engine

Run JavaScript from within your notes.

CustomJS

Reuse custom JavaScript across desktop and mobile.

QuickAdd

Quickly add new notes or content to your vault.

Mermaid Tools

Improved Mermaid.js experience: visual toolbar with common elements and more.

Longform

Helps you write and edit novels, screenplays, and other long projects.

Text Generator

Generate text content using GPT-3 (OpenAI).

Smart Composer

AI chat with note context, smart writing assistance, and one-click edits for your vault.

LanguageTool Integration

advanced spell/grammar checks with the help of language-tool.

PlantUML

Generate PlantUML diagrams.