@ mrjackphil
FYI I’ve setup Keypirinha to index my Obsidian vault. Each individual .md file is added to the Keypirinha index. (Letting me open files by name from Keypirinha.)
I used the files catalogue plugin:
[profile/Obsidian]
activate = yes
include_files = yes
include_dirs = no
paths =
D:\Obsidian\MyVault\*
file_item_label = Obsidian: {title}
python_callback = obsidian_callback
Add the obsidian _callback function is defined as:
# \Keypirinha\portable\Profile\Packages\FilesCatalog\filescatalog_user_callbacks.py
import keypirinha as kp
import os
def obsidian_callback(entry, profile, plugin):
"""
*entry* is a `_globex.GlobExEntry` object, which is an improved version of
`os.DirEntry`.
*profile* is a `namedtuple` defined in :file:`filescatalog.py` as
``ScanProfile``.
*plugin* is the `FilesCatalog` plugin object itself.
"""
if not profile.include_hidden and entry.is_hidden():
return None
if not profile.include_dirs and entry.is_dir():
return None
if not profile.include_files and not entry.is_dir():
return None
include = profile.filters_default
for filter in profile.filters:
if filter.match(entry):
include = filter.inclusive
break
if not include:
return None
if entry.is_dir():
item_label_tmpl = profile.dir_item_label
item_desc_tmpl = profile.dir_item_desc
else:
item_label_tmpl = profile.file_item_label
item_desc_tmpl = profile.file_item_desc
formatter = _LazyItemLabelFormatter(entry, profile, plugin)
item_label = formatter.format(item_label_tmpl, fallback=entry.name)
item_desc = formatter.format(item_desc_tmpl, fallback="")
note_name = f'{entry.path}'.split('\\')[-1]
vault = f'{entry.path}'.split('\\')[-2]
return plugin.create_item(
category=kp.ItemCategory.URL,
label=item_label,
short_desc=f'obsidian://vault/{vault}/{note_name}',
target=f'obsidian://vault/{vault}/{note_name}',
args_hint=kp.ItemArgsHint.ACCEPTED,
hit_hint=kp.ItemHitHint.KEEPALL)