Skip to content

Enhancement: Expand --paths directory arguments to nav-listed files #78

Description

@virtualguard101

Summary

Passing a directory to --paths (e.g. docs/obsidian/音视频) is treated as a single path key obsidian/音视频, which is not a nav file entry. Sync skips with:

WARNING changed file not in nav, skip: obsidian/音视频
INFO nothing to sync

Users expect directory paths to mean all nav-listed markdown under that directory.

Steps to reproduce

mkdocs-note ns --paths docs/obsidian/音视频

Nav contains obsidian/音视频/乐理基础.md but not the directory path itself.

Proposed solution

When --paths resolves to a directory:

  1. Expand to all nav-listed .md / .ipynb files whose file_rel is under that directory prefix.
  2. If the directory has changes but no nav-listed children, log clearly (e.g. no nav-listed files under obsidian/音视频).
  3. Optionally support glob patterns (docs/obsidian/音视频/**/*.md).

Acceptance criteria

  • --paths docs/obsidian/音视频 syncs all nav-listed files under that tree.
  • Passing a single file path still works as today.
  • Dry-run lists expanded file set.
  • Docs updated with directory vs file semantics.

Related

  • Incremental sync and collect_targets in sync.py

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions