dom8509 / logseq-to-markdown

Export Logseq to Markdown
MIT License
30 stars 3 forks source link

The Tutorial of logseq-to-markdown #5

Open kl2111 opened 1 year ago

kl2111 commented 1 year ago

Written with GPT-4

How to Convert Logseq Markdown Notes to Standard Markdown Notes on a Mac

Step 1: Install npm

Before you start, you'll need to have npm installed on your Mac. npm is a package manager for Node.js. If you haven't installed Node.js and npm on your Mac yet, visit the Node.js official download page: https://nodejs.org/en/download/. Download and install the version suitable for your Mac system.

Step 2: Install logseq-to-markdown

Once you've got npm installed, you can install logseq-to-markdown on your Mac. Open Terminal, and enter the following command:

npm install @dom8509/logseq-to-markdown -g

This will install logseq-to-markdown globally.

Step 3: Export Notes from Logseq

Open Logseq, click on the "..." button at the top right, select "Export Graph", and then click on "Export to Markdown". This will download a zip file containing all your Logseq notes.

Unzip the file, and you'll have a folder containing journals and pages subfolders. We'll refer to this as the Documents folder.

Step 4: Convert Notes

Once you've got logseq-to-markdown installed, you can use it to convert your Logseq notes. First, in Terminal, use the cd command to navigate to your graph folder. For instance, if your graph folder path is /Users/ohyoung/Downloads/Documents, you can enter:

cd /Users/ohyoung/Downloads

Then, run the logseq-to-markdown command, followed by the name of your graph folder and specify the output directory. For instance:

logseq-to-markdown Documents -o Output

This will convert the notes in the Documents folder and output them into the Output folder.

Uninstalling npm and logseq-to-markdown

If you no longer need npm and logseq-to-markdown, you can uninstall them using the following commands:

npm uninstall -g @dom8509/logseq-to-markdown

As for uninstalling npm, you can follow the guide on this link: https://www.positronx.io/how-to-uninstall-node-js-and-npm-on-macos/.

Points to Keep in Mind

While using the logseq-to-markdown tool, there are a few issues you might need to be aware of:

  1. By default, logseq-to-markdown will only process notes in the pages folder, not the journals folder. If you want to convert notes in the journals folder, you may need to move the contents of the journals folder into the pages folder.

  2. logseq-to-markdown exports notes that have the "public:: true" property by default. If you want to export all notes, you'll need to add the "public:: true" property to each note.

  3. The logseq-to-markdown command removes the "+ " symbol at the first level when converting notes. If you wish to remove the "+ " symbol at all levels, this is currently not supported by logseq-to-markdown and you may need to use other tools or manually make these changes.

That's the guide on how to convert Logseq markdown notes to standard markdown notes on a Mac. If you encounter any problems or need further guidance, don't hesitate to ask.

vehka commented 4 months ago

Step 3 is redundant. You only need to enter the graph name, the script will locate the graph folder automatically.