Vault and annotations
BiblioFetch has two layers of paper management:
- Project jobs (
job.toml) — per-project reference lists that fetch into a local directory. Covered in earlier examples. - Vault — a directory of topic TOML files that acts as a canonical, cross-project reference collection. This example covers the vault.
Vault layout
By default the vault lives at ~/.config/bibliofetch/vault/. Each .toml file defines one topic:
# ~/.config/bibliofetch/vault/mps-algorithms.toml
[topic]
name = "MPS Algorithms"
tags = ["tensor-network", "dmrg"]
notes = "Core MPS/DMRG references"
[doi]
list = [
"arxiv:cond-mat/0407066",
"10.1103/RevModPhys.93.045003",
]An optional vault.toml in the same directory pins the shared store path and topic order:
# ~/.config/bibliofetch/vault/vault.toml
topics = ["mps-algorithms.toml", "dmrg-foundations.toml"]
store = "~/papers/vault"Creating a vault in a tempdir (demo)
The rest of this example creates a self-contained vault under a tempdir so it runs without touching your home directory.
using BiblioFetchCreate a temporary vault directory so this example runs without touching your home directory. Each topic gets its own TOML file.
_vault_demo_dir = mktempdir()
open(joinpath(_vault_demo_dir, "tensor-networks.toml"), "w") do io
BiblioFetch.TOML.print(
io,
Dict(
"topic" => Dict("name" => "Tensor Networks", "tags" => ["mps", "dmrg"]),
"doi" => Dict("list" => ["arxiv:cond-mat/0407066"]),
),
)
end
open(joinpath(_vault_demo_dir, "quantum-info.toml"), "w") do io
BiblioFetch.TOML.print(
io,
Dict(
"topic" => Dict("name" => "Quantum Information"),
"doi" => Dict("list" => ["arxiv:quant-ph/0301023"]),
),
)
endLoad the index and inspect available topics.
index = load_vault_index(_vault_demo_dir)
topics = list_topics(index)
(length(topics), sort([t.name for t in topics]))(2, ["Quantum Information", "Tensor Networks"])list_topics returns one VaultTopic per file found in the directory.
Adding a ref from the shell
bibliofetch vault add arxiv:1706.03762 --topic tensor-networksAppends the ref to the topic TOML in place without touching other entries.
Fetching
The vault_fetch! function builds a synthetic FetchJob per topic and dispatches to the same fetch pipeline used by BiblioFetch.run:
bibliofetch vault fetch # all topics
bibliofetch vault fetch tensor-networks # one topicFrom Julia:
index = load_vault_index()
vault_fetch!(index; verbose=true)Inheriting vault refs in a project job
A project job.toml can import vault topics without duplicating PDFs:
[vault]
inherit = ["tensor-networks", "quantum-info"]
[doi]
list = ["10.1103/PhysRevB.99.214433"] # project-specific onlybibliofetch bib then outputs a single .bib covering both vault and project references. The vault PDFs stay in the vault store; only the metadata is merged for BibTeX generation.
BibTeX export
bibliofetch vault bib # all topics → vault.bib
bibliofetch vault bib tensor-networks # one topic
bibliofetch vault bib --out ~/papers/combined.bibAnnotations
Every paper in the store — vault or project — carries editable annotation fields in its .metadata/<safekey>.toml:
tags = ["mps", "finite-temperature"]
notes = "Definition 2.3 is the key result."
read_status = "read" # unread | reading | read | skimmed
starred = trueThe annotate command opens $EDITOR on the metadata file directly:
bibliofetch annotate 10.1103/PhysRevB.99.214433Filter the listing by annotation field:
bibliofetch ls --tag mps
bibliofetch ls --unread
bibliofetch ls --starredSearching the vault
Full-text search across all vault topics (delegates to search_entries on the vault store):
bibliofetch vault search "DMRG finite temperature"From Julia:
index = load_vault_index()
matches = vault_search(index, "DMRG")
for m in matches
println(m.key, "\t", m.title)
end