Skip to content

Official Smart Plugins site Smart Plugins are independent third-party plugins for Obsidian. Smart Connections is the flagship plugin.

Smart Context settings

Smart Context settings control how reviewed source packages are formatted and which optional sources or sections can enter the output.

Where to find these settings in Obsidian

Open Settings -> Community plugins -> Smart Context.

Note

Output settings change the text that Smart Context copies. They do not rewrite the source notes on disk.

Current output controls

The current settings surface exposes:

Choose a preset, copy a small package, paste it into a review surface, and inspect the exact structure before using it in a larger workflow.

How a context is structured

A text package combines:

  1. the output wrapper
  2. an optional file tree
  3. one rendered item per selected source or block
  4. the closing output wrapper

The output template can use {{FILE_TREE}} for a hierarchical source map.

Item templates support:

Variable Value
{{KEY}} Full item key or path
{{ITEM_NAME}} File or block name without folder path or extension
{{TIME_AGO}} Relative modified time or Missing
{{LINK_DEPTH}} Link depth, default 0
{{EXT}} File extension when available
{{IS_CURRENT}} Marker when the item belongs to the active note

{{FILE_TREE}} marks the first active-note match. Use {{IS_CURRENT}} when every matching item needs a marker.

XML-style default

A simple structured wrapper remains useful for review and downstream tooling.

Context template:

<context>
{{FILE_TREE}}
{{CONTEXT_ITEMS}}
</context>

Item template:

<item loc="{{KEY}}" at="{{TIME_AGO}}" depth="{{LINK_DEPTH}}">
{{ITEM_CONTENT}}
</item>

Markdown and JSON presets

Use the built-in preset selector for Markdown headings or JSON rather than copying an unverified handwritten template from documentation.

For JSON, use JSON Stringify in Pro. Raw {{ITEM_CONTENT}} can contain quotes, backslashes, newlines, and control characters that make a handwritten JSON template invalid. Serializer-backed output avoids unescaped content and trailing-delimiter errors.

Before treating any custom preset as machine-safe, test fixtures containing:

Heading filters (Pro)

Heading filters include or exclude named sections from copied source items without changing the source note.

After changing a heading rule, copy a small package and confirm that the intended section is present or absent.

External sources (Pro, desktop)

External-source settings bound desktop filesystem discovery.

Max search depth

Limits how many folder levels Smart Context scans from the selected external root.

Max search items

Caps how many eligible items are retained after a scan.

Use bounded values and ignore patterns for dependencies, builds, caches, generated output, secrets, and unrelated packages.

Troubleshooting

The file tree is missing

Confirm that {{FILE_TREE}} is present in the output template.

Linked notes are hard to distinguish

Add {{LINK_DEPTH}} to the item template so direct and traversed items remain visible.

The output is too large

JSON output fails to parse

Use JSON Stringify instead of a handwritten JSON template, then test the pasted result with a JSON parser before downstream automation.

Related pages