Context Block

approvedunreviewed

by Junyoung Bang

Compact context blocks for supplementary information in Markdown notes.

★ 1 starsUpdated today0BSD

Context Block

Supporting details, without interrupting your notes.

Turn supplementary information into compact, title-free blocks in Obsidian. Keep your links, lists and code, with less space around them.

Context Block in Obsidian: a compact explanation, formatted Markdown with YAML code, and the same sentence in a standard Note callout and a smaller context block.

Actual Obsidian rendering · Default settings · Light and dark themes
Light preview · Dark preview

Compact by defaultNative MarkdownYour theme
Equal padding and text at 90% of the note size.Links, lists and code in Reading view and Live Preview.Colors follow Obsidian, with adjustable background and border strength.

Write a context block

> [!context]
> Linux Namespace와는 다른 수준의 개념임을 명시하자.

Use the existing callout syntax. The plugin handles the compact appearance; your note stays plain Markdown.

Commands

  • Context Block: Wrap selection wraps the selected paragraphs. A partial paragraph selection expands to the full paragraph. With no selection, it wraps the current paragraph; on an empty line it inserts an empty block.
  • Context Block: Unwrap current block unwraps the block containing the cursor. The selection must stay inside one block. Nested quotes remain intact.

Both commands use one editor transaction and support Undo/Redo. Assign shortcuts under Settings → Hotkeys.

Wrapping rejects existing blockquotes, frontmatter, fenced code and indented code. Use a plain > [!context] header for blocks you want to unwrap with the command. Source mode retains normal Markdown syntax.

Appearance

Under Settings → Context Block, configure:

SettingDefaultRange
Text size90% of note text75–100%
Padding10px on all sides4–24px
Background strength4%0–12%
Border strength12%0–30%

Colors follow the active theme. Changes apply immediately and persist across restarts. Reset to defaults restores the appearance. Other callout types keep their existing styles.

Disabling the plugin leaves valid callout Markdown in the note. Obsidian then renders it as a regular callout.

Local installation

Requires Obsidian 1.8.9 or newer.

  1. Run npm install and npm run build.
  2. Create <Vault>/.obsidian/plugins/context-block/.
  3. Copy main.js, manifest.json, and styles.css into that folder.
  4. Reload Obsidian and enable Context Block under Settings → Community plugins.

Development

  • npm run dev: watch and rebuild.
  • npm run build: type check and production bundle.
  • npm run lint: lint.
  • npm test: document transformation regression tests.

No network requests, telemetry or external services are used by the plugin. The implementation uses browser-compatible APIs; actual iOS/Android device testing has not been performed.

Based on the official Obsidian sample plugin.

For plugin developers

Search results and similarity scores are powered by semantic analysis of your plugin's README. If your plugin isn't appearing for searches you'd expect, try updating your README to clearly describe your plugin's purpose, features, and use cases.