Skip to main content

Module phantom

Module phantom 

Source
Expand description

Phantom extension for off-page annotation clusters.

Phantoms are annotation clusters that exist conceptually outside the page flow, attached to specific content anchors. They enable rich annotation workflows while keeping the main content clean.

§Overview

  • Phantom clusters attach to content via anchors
  • Phantoms within clusters have positions, sizes, and content
  • Connections link phantoms to each other within a cluster
  • Scopes control visibility (shared, private, or role-based)

§Example

use cdx_core::extensions::phantom::{PhantomClusters, PhantomCluster, Phantom, PhantomScope};
use cdx_core::anchor::ContentAnchor;

let anchor = ContentAnchor::range("para-1", 10, 25);
let cluster = PhantomCluster::new("cluster-1", anchor, "Research Notes")
    .with_scope(PhantomScope::Shared);

Structs§

Phantom
An individual phantom within a cluster.
PhantomCluster
A cluster of phantoms attached to a content anchor.
PhantomClusters
Root structure for phantom clusters stored at phantoms/clusters.json.
PhantomConnection
Connection between phantoms in the same cluster.
PhantomContent
Content of a phantom, wrapping standard content blocks.
PhantomPosition
Position of a phantom in the cluster’s coordinate space.
PhantomSize
Size of a phantom.

Enums§

ConnectionStyle
Visual style for phantom connections.
PhantomScope
Visibility scope for phantom clusters.