Extenote
← All Docs

Computed Data

Extenote derives certain data dynamically from your vault content. This page explains what gets computed, when it’s computed, and how to choose between dynamic computation and persisted values.

Computed vs Persisted

Some data can be either:

Data TypeComputedPersistedNotes
cited_incomputeCitedIn()sync-citationsWhich projects cite each bibtex entry
cross-refscomputeAllCrossRefs()-Wikilinks and backlinks
tag indexbuildTagTree()-All tags and their objects
project membershipobjectBelongsToProject()-Which objects belong to each project
vault summarysummarizeVault()-Object counts, issues, etc.

When to Use Each Approach

Dynamic Computation

Persisted Values

Computation Details

cited_in (Citation Tracking)

Scans all projects that include shared-references for Pandoc/Quarto citations ([@key]) and builds a reverse index.

Dynamic: computeCitedIn(objects, config) returns CitedInMap with:

Persist: extenote sync-citations writes cited_in field to each bibtex entry.

Parses [[wikilinks]] in document bodies and builds forward/backward reference maps.

Dynamic only: computeAllCrossRefs(objects) returns refs per object.

Uses parseWikiLinks() to extract links, buildObjectIndex() for ID lookups.

Tag Index

Builds a tree structure of all tags with their objects.

Dynamic only:

Tags support namespaces via : (e.g., collection:data-leverage).

Project Membership

Determines which objects belong to each project based on source configuration and includes.

Dynamic only: objectBelongsToProject(obj, projectName, config) checks:

  1. Object’s sourceId matches project sources
  2. Object type matches project includes

Vault Summary

Aggregates statistics about the vault.

Dynamic only: summarizeVault(vault) returns:

Web UI: Computed Data View

The web app’s status page shows:

Access via the “System” or “Status” menu item.

Performance Considerations

OperationTypical TimeNotes
Load vault (500 objects)~200msFile I/O + parsing
computeCitedIn~50msRegex scanning
computeAllCrossRefs~100msLink parsing + indexing
buildTagTree~20msString processing

For vaults with 1000+ objects, consider persisting frequently-accessed computed data.

CLI Commands

# Persist cited_in to bibtex entries
extenote sync-citations

# Preview what would be updated
extenote sync-citations --dry-run

# View vault summary (computed)
extenote summary

API Reference

import {
  computeCitedIn,
  getCitedIn,
  computeAllCrossRefs,
  buildTagTree,
  summarizeVault
} from "@extenote/core";

// Compute cited_in dynamically
const citedInMap = computeCitedIn(vault.objects, vault.config);

// Get cited_in for specific entry (checks persisted first, falls back to computed)
const projects = getCitedIn(entry, citedInMap);

// Build full cross-reference graph
const crossRefs = computeAllCrossRefs(vault.objects);

// Build tag tree
const tagTree = buildTagTree(vault.objects);

// Get vault summary
const summary = summarizeVault(vault);