Logmark converts directory-organized markdown files for use with Logseq by adding the parent directories of each file as [[page]] references in the files.
This program eases transitioning to Logseq for those who have organized their notes in a hierarchical directory structure where the directories can serve as tags or topic references to the files they contain. It was created to move files from exported Joplin notes to Logseq using the notebooks as page references, but it will work with any similar collection of markdown files.
- reconstruct your notebook references in Logseq
- add a list of custom page references at the commandline
- avoid duplicating the filename as a heading if it is already used on the first line
- choose which heading level is used for the page title
logmark.py --help
If you have a markdown file:
/home/user/notes/joplin-backup/webinars/journalism/investigative_journalism.md
And you run:
logmark.py -l 2 -i /home/user/notes/joplin-backup/ -o my-exported-notes/
Then the journalism.md file will be exported to my-exported-notes/
and edited with a title and page references like so:
## investigative_journalism
[[webinars]] [[journalism]]
original text...
/home/user/notes/joplin-backup is ignored as a source of page references because it is assumed that the first source directory provided on the commandline is the root of the notes directory. Therefore, anything higher up will start referencing data not related to the target set of files. If you want the root to become a tag (in this example joplin-backup
) then just move the root to an empty directory and stop your source path with that empty directory. This will mean that all markdown files will have the root added as a page reference.
only needed when run from source files
- python 3.5+
- Python3 Tkinter
- PySimpleGui
- does not currently preserve/convert image links
- does not preserve/convert platform-specific tags
- logmark is intended for use with markdown files only