Skip to content

Docs say top-level plugins apply to all spaces, but the config rejects them #190

Open

Description

@mindsocket

Problem

docs/config.md (Plugins section) says plugins "can be declared at the top level (applies to all spaces) or per-space (overrides the top level)", and its example has a top-level plugins map. Core doesn't accept that.

  • measured: a .sctx.json with a top-level plugins key fails to load: Invalid config in …/.sctx.json: … "additionalProperty":"plugins" … "must NOT have additional properties". The config's JSON Schema (src/config/index.ts) allows plugins only on a space.
  • measured: everything that reads plugin config uses only context.space?.plugins (src/read/read-space.ts:6, src/render/render.ts:13, src/commands/template-sync.ts:6, src/commands/render.ts:94). Nothing merges a top-level map into the spaces.

Options

  1. Fix the docs: plugin config is per space only. Remove the top-level example.
  2. Implement the documented behaviour: accept a top-level plugins map, merge it into each space at load (with the space's entry winning per plugin), and keep the docs.

Option 2 is a convenience for configs with many spaces sharing a parse plugin's settings (a fieldMap, say). Option 1 is a one-line fix. Hosts like the Obsidian plugin look up a space's plugins["sctx-markdown"], so a merge at load time (option 2) would need no change there.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions