# TODO: examplesmarkdown.obsidian.vault_and_links
Queries about links in a vault
all_custom_text_for_links_in_vault
all_custom_text_for_links_in_vault (note:trouver.markdown.obsidian.vault .VaultNote, vault:os.PathLike, anchor:Union[str,int]=-1)
Return all custom text used in the Obsidian vault for the specified note and anchor.
| Type | Default | Details | |
|---|---|---|---|
| note | VaultNote | The note to find the custom text for. | |
| vault | PathLike | The path to the Obsidian vault directory | |
| anchor | Union | -1 | The anchor in the note to find the custom text for. If 0, then returns only the custom texts for internal links without anchors. If -1, then returns the custom texts for all of the internal links of the specified note. |
| Returns | dict | Each key is the custom text used and each value is a set of paths relative to vault to the notes where the custom text is used. The key 0 means that no custom text is used. |
all_links_in_vault
all_links_in_vault (vault:os.PathLike, backlinks:bool=False, multiplicities:bool=False)
*Returns a dict keeping track of which notes contain links to which notes.
TODO: currently, the regex capture regex code. Change them so that this does not happen.
Parameters - vault - PathLike - backlinks - bool - If True, then keeps track of the links in each note. If False, then keeps track of the backlinks in each note, i.e. which other notes link to each note. Defaults to False. - multiplicties - bool - If True, then keeps track of multiple links to the same note for each note. Otherwise, only keeps track of whether or not a note links to a(nother) note. Defaults to False.
Returns - dict[str, list[str]] - Each key is a str, referring to the name of a note. Each corresponding value is a list. The list contains the names of all the notes which the key note references to if backlinks is True, and contains the names of all the notes which reference the key note if backlinks is False. The list can contain multiple occurrences of the same note if multiplicities is True.*
# TODO: examples