A shell script that converts Craft markdown documents to Logseq markdown files, handling pages, journals, and image paths.
pages
, journals
and assets
folders. Please backup your data before running the script. The author is not responsible for any data loss that may occur during the conversion process.
- Converts Craft markdown files to Logseq-compatible format
- Handles both pages and journal entries
- Migrates over inlined images correctly.
- Converts journal file names from yyyy.mm.dd.md to yyyy_mm_dd.md format
The script requires longdown
to be installed via npm:
npm install -g longdown
There are two ways to install the script:
brew tap omair-inam/tap
brew install craft-to-logseq
- Download the script from this repository
- Make it executable:
chmod +x craft_to_logseq.sh
Follow these steps for each Craft space you want to convert:
-
Open your Craft workspace
-
Select all documents you want to export (you can use Cmd+A to select all)
-
Right-click and select "Export X item(s) as"
-
Choose "Markdown" from the export options
-
Select a destination folder for your exported files
- Recommendation: Choose a folder path without spaces in the name
- Switch to the export folder containing the markdown files:
cd /path/to/export/folder
- Run the conversion command:
craft-to-logseq --logseq-path /path/to/logseq --output-dir /path/to/output [--verbose]
Required arguments:
--logseq-path
: Path to your Logseq directory--output-dir
: Temporary output directory for processing
Optional arguments:
--verbose
: Enable verbose output--help
: Show help message
craftdocs links are not currently ported over correctly. The script outputs a report of the Markdown files that need to be manually updated to correctly port over Craftdoc links
MIT License
Contributions are welcome! Please feel free to submit a Pull Request.