Skip to content

Incremental vault_export (0.6.3.2)#51

Merged
TroyHernandez merged 2 commits into
mainfrom
feature/incremental-export
May 27, 2026
Merged

Incremental vault_export (0.6.3.2)#51
TroyHernandez merged 2 commits into
mainfrom
feature/incremental-export

Conversation

@TroyHernandez

Copy link
Copy Markdown
Contributor

vault_export() wiped the output directory and re-rendered every page through a separate pandoc process on every export — minutes on a large vault (the cornelius vault is hundreds of pages). It's now incremental.

How

A .pensar-export-cache.yml in out_dir records each source's content hash and the page-name → output-path map. On the next export:

  • Render only pages whose source changed (hash differs, or output missing).
  • Also render any page whose wikilinks reference a name that was added / removed / moved — its broken↔resolved links shift even though its own source didn't (the one correctness subtlety, since wikilink resolution is global).
  • Delete outputs for sources that no longer exist.
  • Always regenerate style.css + the site index (cheap, no pandoc).
  • First export, or a deleted cache, is a full build.

Editing a few pages now renders a handful instead of the whole vault.

API

vault_export() returns the output path with rendered / skipped attributes (for callers/tests; the path still works as a plain string everywhere).

Tests

test_export.R extended: no-op re-export skips all (1 render = log.md, which the export itself appends to), single edit renders one, an added page re-renders its linkers and flips a broken link to resolved, deletion removes the output and re-renders linkers (link breaks again), and a deleted cache forces a full rebuild. Full suite green (578/0).

Incidental: tinyrox regenerated a few unrelated man/*.Rd and rformat touched pensarignore.R.

vault_export wiped the output dir and re-rendered every page through a
separate pandoc process each export -- minutes on a large vault. It is
now incremental: an .pensar-export-cache.yml in out_dir records each
source's hash and the page-name->output map. Subsequent exports render
only pages whose source changed, plus any page whose wikilinks point at
a name that was added/removed/moved (so broken<->resolved links stay
correct). Orphaned outputs are deleted; style.css and the site index are
always regenerated (no pandoc). First export, or a deleted cache, is a
full build.

vault_export returns the out_dir with `rendered`/`skipped` attributes.
Tests cover: no-op re-export skips all, single edit renders one, an
added page re-renders its linkers, deletion removes output + re-renders
linkers, deleted cache forces full rebuild.

(Incidental: tinyrox regenerated several man/*.Rd and rformat touched
pensarignore.R.)
@TroyHernandez TroyHernandez merged commit 5c49804 into main May 27, 2026
4 checks passed
@TroyHernandez TroyHernandez deleted the feature/incremental-export branch May 27, 2026 20:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant