Inline Context

approvedunreviewed

by Mohamed Saleh

Extend Markdown capabilities by adding inline fold, encapsulate text anywhere in the note, create spoilers, even flashcards for active recall.

★ 2 stars↓ 331 downloadsUpdated 2mo agoMIT

Inline Context

Attach translations, definitions, and other context to ordinary text in Obsidian. A context item can either replace its text inline when activated or show its additional text in a popup.

Example

Create a Translation context on bonjour with the detail hello:

[translation::bonjour|hello]

The delimiters are fixed implementation details. Inline Context hides them in the normal editing and reading experience where safe, while the Markdown file keeps a readable, portable representation.

Modes

  • Replace inline — the original text is replaced by the attached text on hover or click, according to the interaction setting.
  • Show popup — the original text remains in place and the attached text appears in a floating popup.

Commands

Use the command palette to:

  • Add context to selected text or the word under the cursor
  • Edit context at the cursor
  • Remove context while keeping the visible text
  • Delete context and its contents
  • Change an item's context type
  • Normalize older context markers to readable type names
  • Reveal or hide all replacing contexts
  • Jump to the next or previous context
  • Start a context review

Context types

Context types provide presentation and organization only. Each type can have its own mode, shared style preset, icon, and visual treatment. Built-in styles include Ghost, Pill, Bracket, Underline, and Badge. You can create reusable custom styles once in Settings and apply them to multiple context types. The attached text remains a free-form textbox, so a Translation type does not need hard-coded language, pronunciation, or example fields.

Current scope

The core experience focuses on context creation, editing, removal, natural cursor movement, inline replacement, and popup display. Flashcard scheduling, vault-wide search, shared definitions, and other larger learning features are planned separately.

Development

npm install
npm run build
npm run typecheck
npm test

Requires Obsidian 1.13.0 or newer. The plugin keeps its existing manifest ID (inline-fold) so users can upgrade without losing plugin data.

License

MIT

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.