Main

Sync files between directories

source

FileMeta

 FileMeta (size:int, mtime:float, hash:Optional[str]=None)

source

should_ignore

 should_ignore (p:pathlib.Path, ignore_globs:Iterable[str])

source

file_hash

 file_hash (path:pathlib.Path, algo:str='md5')

source

rel_key

 rel_key (root:pathlib.Path, p:pathlib.Path)

source

make_quarto

 make_quarto (path:str, yaml_data:Dict[str,Any], text_data:str=None,
              update_dates=True)

Make a Quarto (.qmd) document with YAML metadata and text content.


source

create_frontmatter

 create_frontmatter (title:str, author:str='Author', date:str=None,
                     date_modified:str=None, categories:List[str]=None,
                     draft:bool=False, **kwargs)

source

parse_quarto

 parse_quarto (path:str)

Parse a Quarto document and extract YAML frontmatter and markdown content.


source

obsidian_to_quarto_transform

 obsidian_to_quarto_transform (src_path:pathlib.Path,
                               dst_root:pathlib.Path,
                               sync_root:pathlib.Path)

Transform function that converts .md files to .qmd files with proper frontmatter.


source

md_content_changed

 md_content_changed (md_path:pathlib.Path, qmd_path:pathlib.Path)

Check if the markdown content has changed between .md and .qmd files.


source

create_index_qmd

 create_index_qmd (dir_path:pathlib.Path, quarto_root:pathlib.Path)

Create an index.qmd file for a directory.


source

check_listing_metadata

 check_listing_metadata (sync_root:pathlib.Path)

*Check if there’s a _listing_meta.yml file in the sync directory.*


source

filename_to_title

 filename_to_title (filename:str)

Convert filename to a readable title.


source

read_markdown_content

 read_markdown_content (md_path:pathlib.Path)

Read markdown content from an .md file.


source

sync_obsidian_to_quarto

 sync_obsidian_to_quarto (obsidian_root:str|pathlib.Path,
                          quarto_root:str|pathlib.Path, dry_run:bool=True,
                          ignore:Iterable[str]=('*.DS_Store', 'Thumbs.db',
                          '.obsidian', '*.tmp'))

*Sync Obsidian .md files to Quarto .qmd files.

Args: obsidian_root: Path to Obsidian vault or folder with .md files quarto_root: Path to Quarto project destination dry_run: If True, only show what would be done without making changes ignore: Glob patterns to ignore during sync*

if __name__ == "__main__":
    # Example usage
    obsidian_path = "/Users/rehabpath/Local_Projects/note-sync/playground/Obsidian/notes-folder"
    quarto_path = "/Users/rehabpath/Local_Projects/note-sync/playground/Website/notes"
    
    # Dry run first to see what would happen
    sync_obsidian_to_quarto(obsidian_path, quarto_path,dry_run=False)
    
    # Uncomment to actually perform the sync
    # sync_obsidian_to_quarto(obsidian_path, quarto_path, dry_run=False)
Syncing from Obsidian/notes-folder/ to Website/notes/
--------------------------------------------------
Found listing metadata file: _listing_meta.yml
SKIP FILE: agents/huggingface-course/Unit 1 - Introduction.qmd (no changes)