API documentation

Published

February 20, 2025

Exported functions and structures

Vaults

Vault

Julia structure for an Obsidian vault.

Construct a Vault from current working directory.

Vault(; omit, dataview)

notes

Find all notes in a vault.

notes(v)

wikinames

Find wikinames for notes in a vault. Compare notes(v::Vault).

wikinames(v)

Metadata on notes: Obsidian tags

tagged

Finds list of pages in Vault v that are tagged with tag t.

tagged(v, t)

tags

Finds list of tags on page wikiname in Vault v.

tags(v, wikiname)

Extract Obsidian tags from YAML header and markdown body of file f.

tags(f)

Metadata on notes: dataview key-value properties

NoteKV

Key-value metadata annotation for an Obsidian note, or page.

kvpairs

Find list of key-value pairs for a given note in a vault. The result is a Vector of named tuples with fields k and v.

Example

julia> kvpairs(v, notenames[1])
3-element Vector{Any}:
 (k = "sequence", v = "16")
 (k = "hiddensequence", v = "16")
 Dict{Any, Any}()
kvpairs(v, note)

Extract list of key-value pairs from file f. The result is a Vector of named tuples with two fields, k and v.

Example

julia> kvpairs("/path/to/file.md")
3-element Vector{Any}:
 (k = "sequence", v = "16")
 (k = "hiddensequence", v = "16")
 Dict{Any, Any}()
kvpairs(f)

Exporting notes and vaults to Markdown

mdcontent

Extract the contents of a note as generic markdown. YAML headers and dataview blocks are omitted. wiki-style links are converted to standard markdown links with relative paths.

mdcontent(v, pg; quarto, omitdvtags, omittags)

exportmd

Export all notes in vault v to markdown files in root directory dest`.

exportmd(
    v,
    outputroot;
    keepyaml,
    yaml,
    quarto,
    omitdvtags,
    omittags
)

Export a note n to a markdown file in a subdirectory of directory outputroot.

exportmd(
    v,
    n,
    outputroot;
    keepyaml,
    yaml,
    quarto,
    omitdvtags,
    omittags
)

Export a note named pg to a markdown file in a subdirectory of directory outputroot.

exportmd(
    v,
    pg,
    outputroot;
    keepyaml,
    yaml,
    quarto,
    omitdvtags,
    omittags
)