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

Cedar

thefellowthefellow14 downloads

Syntax highlighting for Cedar policy language and Cedar schema code blocks

Add to Obsidian
Cedar screenshot
  • Overview
  • Scorecard
  • Updates2

Syntax highlighting for the Cedar policy language in Obsidian notes.

Fenced code blocks tagged cedar (policies) or cedarschema (schemas, in the human-readable schema format) are highlighted in Live Preview, Source mode and Reading view, using your theme's code colours.

A Cedar policy and a Cedar schema highlighted in an Obsidian note

```cedar
permit (
  principal == PhotoApp::User::"alice",
  action == PhotoApp::Action::"viewPhoto",
  resource in PhotoApp::Album::"vacation"
)
when { context.mfa == true };
```

```cedarschema
namespace PhotoApp {
  entity User;
  entity Album;
  entity Photo in [Album] = { "private": Bool };
  action viewPhoto appliesTo { principal: [User], resource: [Photo] };
}
```

Like Obsidian's built-in languages, code blocks inside blockquotes and callouts are highlighted in Reading view only, not in the editor.

How it works

The highlighting comes from the TextMate grammars in the official Cedar extension for Visual Studio Code (cedar-policy/vscode-cedar), which are bundled unmodified. Notes are highlighted exactly the way VS Code and the Cedar plugin for JetBrains IDEs highlight them.

  • The grammars run in a pure-JavaScript TextMate engine (@shikijs/vscode-textmate with Shiki's JavaScript regex engine), with no WebAssembly and no network access, on desktop and mobile.
  • Live Preview and Source mode: the plugin registers cedar and cedarschema editor modes, which Obsidian uses for fenced code blocks with those languages.
  • Reading view: the plugin registers cedar and cedarschema with Obsidian's Prism highlighter. This also covers embeds, hover previews and PDF export.

TextMate scopes are mapped to Obsidian's code colours (--code-keyword, --code-string, --code-comment, …) in the same way the JetBrains plugin maps them to IDE colours. Every highlighted token also gets a cedar-<kind> class, so you can restyle it with a CSS snippet:

/* e.g. make principal/action/resource/context stand out */
.cedar-variable { font-weight: bold; }

The kinds are: keyword, variable, slot, entity-type, namespace, builtin-type, property, function, method, annotation, string, string-escape, invalid-escape, number, boolean, operator, punctuation and bracket.

Installing

From Obsidian: Settings → Community plugins → Browse, search for Cedar, then install and enable it.

To install by hand, download main.js, manifest.json and styles.css from the latest release into <vault>/.obsidian/plugins/cedar/, then enable Cedar under Settings → Community plugins.

Development

Tools are pinned in mise.toml (Node 22).

npm install
npm run lint                # Obsidian's official ESLint rules (what the directory's review runs)
npm test                    # tokenizer, editor mode and Prism tests
npm run build               # type-check and bundle main.js
scripts/dev-vault.sh        # build and link the plugin into test-vault/ (or a vault given as $1)

Open test-vault/ as a vault in Obsidian, enable community plugins and Cedar, and open Cedar.md.

Releases: run npm version <x.y.z> (bumps package.json, manifest.json and versions.json), then git push --follow-tags. The Release workflow builds the plugin and creates a draft GitHub release with main.js, manifest.json and styles.css. Review the draft, then publish it.

License

Apache License 2.0. See LICENSE and NOTICE. Cedar grammars © Cedar Contributors.

HealthExcellent
ReviewPassed
SyntaxCSS
Details
Current version
0.1.2
Last updated
2 days ago
Created
2 days ago
Updates
2 releases
Downloads
14
Compatible with
Obsidian 1.5.0+
Platforms
Desktop, Mobile
License
Apache-2.0
Report bugRequest featureReport plugin
Author
thefellowthefellow
GitHubthefellow
  1. Community
  2. Plugins
  3. Syntax
  4. Cedar

Related plugins

Admonition

Admonition block-styled content.

Custom Frames

Turn web apps into panes using iframes with custom styling. Also comes with presets for Google Keep, Todoist and more.

Style Settings

Adjust theme, plugin, and snippet CSS variables.

CSS Editor

Edit CSS snippet files.

Custom Font Loader

Customize your vault with any font you want (+ Support for Android and iOS).

Sheets Extended

Vertical headers, merged cells, and custom CSS tables with Advanced Tables compatability.

Lapel

Show the heading levels in the gutter of the editor.

Show Whitespace

CSS styles and CM6 extensions to highlight whitespace in Source and Live Preview modes.

Blur

Create obfuscated blocks of text.

Snippetor

Create and tweak common snippets.