Skip to content

Import: Identify folders with same name as Markdown file, to avoid duplicately named nodes #55

@maphew

Description

@maphew

Enhancement: I'll add this or something like it into trilium-py (see #54)

def find_folders_matching_md_files(folder_path: Path) -> list:
    """Identify folders with same name as Markdown file, to avoid duplicately named nodes.
    
    Avoids situation where this input:
        source_dir/
            Foobaz.md
            Foobaz/hero-image.jpg
            Foobaz/another-pic.jpg
    
    Would create in Trilium:
        destination_note/
            Foobaz
                hero-image.jpg
                another-pic.jpg
            Foobaz
                (empty)

    Note: any content in the sub-folder that is not linked to from the .md will be left behind.

    Args:
        folder_path: Path to the folder containing Markdown files
        
    Returns:
        list: List of folder names that match Markdown file names
    """

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions