Skip to content

Obsidian export: nodes whose label starts with . produce notes Obsidian never displays #2205

Description

@irvinolave-alt

Found on graphifyy 0.9.26 (uv tool install, Python 3.11, Linux), running graphify <dir> --backend claude-cli followed by graphify export obsidian --graph graphify-out/graph.json --labels graphify-out/.graphify_labels.json --dir <vault>. Sibling of #2204, independent fix.

Summary

safe_name() strips filesystem-unsafe characters but leaves a leading . intact, so a node for a dotfile is written as .env.md. Obsidian hides every file whose name begins with a dot: the note does not appear in the file explorer, in Quick Switcher, or in graph view. It is written, counted in the "N notes" total, and referenced by [[wikilinks]] from visible notes — those links render as unresolved.

Where

graphify/export.py:500 (and the parallel copy at :801)

def safe_name(label: str) -> str:
    cleaned = re.sub(r'[\\/*?:"<>|#^[\]]', "", label...)
    ...

The character class does not cover a leading ..

Reproduction

Corpus containing any dotfile that becomes a node — .env, .env.example, .gitignore, .dockerignore, .eslintrc, .github/workflows/*.yml. My run produced:

.env (credenciales TB).md
.env.example.md

Both invisible in Obsidian. .env.example.md is the target of a references edge from README.md, so that link shows as unresolved in the visible note.

Expected

Every note the exporter writes is reachable in the Obsidian UI.

Suggested fix

Strip or escape a leading dot in safe_name, e.g. cleaned = cleaned.lstrip(".") with a fallback if that empties the stem, or a dotfile- prefix to keep the name recognizable. Either way the H1 and source_file: frontmatter still carry the true filename, so nothing is lost. Whatever the choice, _dedup_node_filenames will handle a collision with a non-dotted sibling.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions