Syntax Palette

by Frank
5
4
3
2
1
Score: 50/100

Description

Syntax highlighting themes for Obsidian code blocks.

Reviews

No reviews yet.

Stats

1
stars
45
downloads
0
forks
14
days
1
days
1
days
0
total PRs
0
open PRs
0
closed PRs
0
merged PRs
0
total issues
0
open issues
0
closed issues
4
commits

Latest Version

2 days ago

Changelog

Syntax Palette 0.5.9

This mobile candidate replaces per-fragment CSS displacement with one native horizontal scroll container per fenced block when the host provides CodeMirror's BlockWrapper API. The wrapper is created and managed by CodeMirror through EditorView.blockWrappers; the plugin does not reparent editable DOM or replace text with a widget. API availability was checked in Obsidian 1.15.0, the version reported by the user. Hosts without this API keep the 0.5.8 shared-offset path.

Native block scrolling removes per-frame inherited CSS offset changes and the extra position marks that were split by syntax tokens. The browser owns touch panning and momentum. The plugin installs no touch listeners in this mode, avoiding the main-thread wait caused by a non-passive touchmove listener. Desktop row scrolling is unchanged. Width measurement, caret visibility, virtualization offset restoration, wrapping and plugin cleanup are retained.

The 0.5.8 data-ignore-swipe navigation opt-out is present on the native wrapper and code rows, including at block boundaries; vertical page panning remains available. The reading-view gutter fix is unchanged.

The performance fixture compares 24, 46 and 120 logical code lines, including many syntax tokens, over 60 offset updates. It records browser style/layout metrics and mounted DOM counts rather than timing only the JS setter. The baseline and new path use the same isolated macOS Obsidian 1.15.0 harness with GPU disabled. These measurements do not establish iPhone FPS or native iOS keyboard/selection behavior. On-device testing is still required.

Requires Obsidian 1.14.5 or later; the optimized mobile path uses the newer editor API available in the checked 1.15.0 host. Install main.js, manifest.json, and styles.css, retaining any existing data.json.

README file from

Github

English · 简体中文

Syntax Palette

Make code blocks look the way you like.

Choose a syntax color palette for Markdown code blocks without changing the rest of your Obsidian theme. Your notes, app colors, and other parts of Obsidian keep their usual look.

See it in Obsidian

These are genuine screenshots from an isolated Obsidian test vault, captured with the v0.5.2 development build before the plugin was renamed from Atom One Fenced Syntax. The settings screenshot still shows that earlier name; the code colors and controls shown are real.

What changes — and what stays the same

Obsidian's theme controls the whole app. Syntax Palette gives Markdown fenced code blocks their own color choices, so you can keep your favorite Obsidian theme and choose code colors that suit you.

The palette applies inside fenced code blocks. It does not recolor regular text or inline code, and it never edits your Markdown content. An optional setting can also change the fenced block's background.

Choose a palette

Pick from 39 color variants across 15 theme families, including GitHub, Atom One, Catppuccin, Tokyo Night, Ayu, Dracula, Nord, and more. Choose a light palette and a dark palette separately, so each follows the matching Obsidian appearance.

You can also:

  • Turn code-block backgrounds on or off. They are off by default.
  • Show line numbers, with each code block starting at 1. They are off by default and are not copied into your notes.
  • Choose whether long lines wrap in the editor (off by default). With wrapping off, each code block scrolls horizontally on its own; the rest of the note stays put.
  • Keep Obsidian's normal wrapping for regular text. The code-wrapping option only affects fenced code in the editor.

Syntax coloring is available for common languages including Python, JavaScript and TypeScript, JSON, Bash, HTML, and CSS. Unsupported or untagged code blocks keep Obsidian's own syntax colors.

How to use it

Once Syntax Palette is installed:

  1. Open Settings → Community plugins → Syntax Palette.
  2. Choose a palette for Light mode and another for Dark mode. You can use a family preset first, then adjust either choice separately.
  3. Turn on code-block backgrounds or line numbers if you want them.
  4. Set editor code wrapping to match how you like to read long lines.

Changes apply immediately and are saved for your next Obsidian session.

Availability and installation

Check the GitHub releases and Obsidian Community plugins for the current publication status. This source build's experimental mobile support has not yet been validated on mobile devices.

To install a published release manually, download main.js, manifest.json, and styles.css from the GitHub release. Put all three files in your vault's .obsidian/plugins/syntax-palette/ folder, reload Obsidian, and enable Syntax Palette under Settings → Community plugins. These three files contain everything the plugin needs; no additional WASM file is required.

For a local source build, use those same three files from plugin/syntax-palette/. See the installation notes.

Compatibility and known limits

  • Mobile installation is enabled for iOS, iPadOS, and Android as an experimental target. Real-device testing is still needed, especially for touch scrolling, selection, keyboard input, and rotation.
  • macOS has been tested with Obsidian 1.14.5. Windows and Linux are target platforms but have not yet been tested on those systems.
  • Pop-out windows are not supported.
  • The 39 built-in palettes cannot be extended with custom theme files.
  • When editor wrapping is off, long code lines use horizontal scrolling inside each fenced block.
  • On a narrow screen, enabling editor code wrapping can make long lines easier to edit.

For developers

The plugin source is in plugin-src/; bundled theme data, source details, and third-party license texts are in sources/. The build embeds the Oniguruma WASM payload into main.js, so the Community Plugins file set does not need a separate runtime asset. Full third-party notices ship in both main.js and THIRD-PARTY-NOTICES.txt. See theme provenance for theme credits and licensing, and development guide for the development and testing notes.

To build from source:

npm ci
npm run verify
npm run build
npm run package
npm run verify-build

License

Public author: Frank. This project credit does not establish copyright ownership of historical code or third-party resources.

Syntax Palette's own project code is offered under the Apache License 2.0. Bundled themes, grammar files, parser-derived code, and runtime components keep their original licenses; see THIRD-PARTY-NOTICES.txt for the notices and full license texts. The theme snapshots and their exact versions are documented in THEME-PROVENANCE.md.

Before contributing, please open an issue to discuss the change. See LICENSE-AUDIT.md and RELEASE-AUDIT.md for the current owner-review items.