resourcepath

package
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 28, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package resourcepath centralizes shared resource target rules.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CandidatePathsWithAttachmentFolder

func CandidatePathsWithAttachmentFolder(note *model.Note, attachmentFolderPath string, rawTarget string) []string

CandidatePathsWithAttachmentFolder expands a resource target through the shared note-relative and attachment-folder rules.

func LooksLikeImage

func LooksLikeImage(rawTarget string) bool

LooksLikeImage reports whether a target resolves to a supported image type.

func LookupImageEmbedPath

func LookupImageEmbedPath(note *model.Note, attachmentFolderPath string, rawTarget string, lookup func(string) model.PathLookupResult) model.PathLookupResult

LookupImageEmbedPath applies the shared image-embed lookup rules, including an explicit vault-relative slash-path fallback after note-relative lookup misses.

func LookupIndexedAssetPath

func LookupIndexedAssetPath(note *model.Note, idx *model.VaultIndex, rawTarget string) model.PathLookupResult

LookupIndexedAssetPath applies the indexed vault asset lookup rules and can surface canonical ambiguity when fallback is refused.

func LookupIndexedImageEmbedAssetPath

func LookupIndexedImageEmbedAssetPath(note *model.Note, idx *model.VaultIndex, rawTarget string) model.PathLookupResult

LookupIndexedImageEmbedAssetPath applies the indexed vault image-embed asset lookup rules and can surface canonical ambiguity when fallback is refused.

func LookupPath

func LookupPath(note *model.Note, attachmentFolderPath string, rawTarget string, lookup func(string) model.PathLookupResult) model.PathLookupResult

LookupPath applies the shared note-relative and attachment-folder lookup rules against a caller-provided lookup that can surface canonical ambiguity.

func ResolveIndexedAssetPath

func ResolveIndexedAssetPath(note *model.Note, idx *model.VaultIndex, rawTarget string) string

ResolveIndexedAssetPath applies the indexed vault asset lookup rules.

func ResolveIndexedImageEmbedAssetPath

func ResolveIndexedImageEmbedAssetPath(note *model.Note, idx *model.VaultIndex, rawTarget string) string

ResolveIndexedImageEmbedAssetPath applies the indexed vault image-embed asset lookup rules.

Types

type LookupResult

type LookupResult = model.PathLookupResult

LookupResult describes a shared resource lookup attempt.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL