Skip to main content

Module marker

Module marker 

Source
Expand description

.yuilink marker file detection + parsing.

Two forms are accepted:

  • empty file → “junction this dir at the parent mount’s dst” (the original presence-only marker semantics)
  • TOML with [[link]] entries → declare explicit links from this directory. Each entry produces one link (after when filter).
# $DOTFILES/home/.config/nvim/.yuilink
[[link]]
dst = "{{ env(name='HOME') }}/.config/nvim"

[[link]]
dst = "{{ env(name='LOCALAPPDATA') }}/nvim"
when = "yui.os == 'windows'"

Each [[link]] may carry an optional src = "<filename>" that scopes the link to a specific file inside the marker’s directory rather than the directory itself:

# $DOTFILES/home/.config/powershell/.yuilink
[[link]]
src = "profile.ps1"
dst = "{{ env(name='USERPROFILE') }}/Documents/PowerShell/Microsoft.PowerShell_profile.ps1"
when = "yui.os == 'windows'"

Stacking semantics (v0.6+): a marker no longer stops the walker. The walker keeps descending past markers and aggregates link entries from every marker it encounters. A descendant marker therefore adds destinations on top of its ancestors rather than replacing them. Each entry’s dst is still the source of truth — if you want the default ~/.config/nvim-style placement, list it explicitly.

Default-dst behaviour, two cases (kept distinct on purpose):

  • Empty / link-less marker — the walker still emits the dir-level link to the parent mount’s natural dst (the original “presence-only” behaviour).
  • Directory-scoped [[link]] (no src) — fully defines the directory’s placement. The parent mount’s natural dst is not implied; only what’s listed here is linked at this dir.
  • File-scoped [[link]] (with src = "<filename>") — applies only to the named sibling file. It does not claim directory-level coverage, so per-file defaults from the parent mount still apply to the rest of the dir (and to the same file too, in addition to the explicit dst).

Structs§

MarkerLink

Enums§

MarkerSpec

Functions§

is_marker_dir
Presence-only check: any .yuilink file (empty or with content) counts. Kept for callers that don’t need the spec contents.
read_spec
Read and parse a .yuilink from dir.