Incremental vault_export (0.6.3.2)#51
Merged
Merged
Conversation
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.)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.ymlinout_dirrecords each source's content hash and the page-name → output-path map. On the next export:style.css+ the site index (cheap, no pandoc).Editing a few pages now renders a handful instead of the whole vault.
API
vault_export()returns the output path withrendered/skippedattributes (for callers/tests; the path still works as a plain string everywhere).Tests
test_export.Rextended: 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/*.Rdand rformat touchedpensarignore.R.