How to create a Logseq graph using existing Markdown files

If you already have a collection of Markdown files you wish to start with instead of creating a new graph, Logseq allows you to import those files—even if they were created with another tool.

To start using Logseq with your existing Markdown files, all you have to do is create a new graph and select a directory that contains Markdown files. Logseq will automatically create the following folders:

  • journals (in which each day a new file is created for that day)
  • pages (where new files are created when you create a new page in Logseq)
  • assets (where all (media) files you upload in Logseq are stored)

Logseq has the ability to find files in subfolders, so it’s not necessary to move all of your Markdown files to the pages folder. When you open a directory with files that were created by the Obsidian Daily notes core plugin, Logseq will automatically locate them. However, Logseq will create a new file for every day onward in the journals folder.

If you want to use Logseq in combination with Obsidian (for example, to make use of Obsidian’s massive plugin ecosystem), have a look at the following Twitter thread by Logseq team member Ramses. In it, he shows exactly what settings you need to change in both tools to make them play nice together.

https://twitter.com/rroudt/status/1443546448675573760?s=20&t=7ZN7VrDmlEgLvtT5Ffgung

Continue by getting to know the Journals page.

2 Likes

Logseq has the ability to find files in subfolders, so it’s not necessary to move all of your Markdown files to the pages folder.

For me logseq has created its own nested file structure , but does not seem to be able to read down into it.
https://discuss.logseq.com/t/many-journal-pages-disappear-nested-directory-structure/11289/2
Could it be because it finds the deeper pages folders, but not the journals?

Any help would be greatly appreciated

1 Like

When I opened logseq in a directory that already had markdown files most of them ended up permanently deleted. I had no recent backup, which admittedly is my own stupid fault, but anyone trying this needs to take care.

That shouldn’t be happening! If you can, could you please send me a DM with the steps that you took and that resulted in this data loss?

I literally just started the program and selected the directory that contained my files. note that the directory was already initialized as a git repo, but there where a lot of uncommitted changes.

I’ve searched around and find only one result addressing my version of Markdown imports into Logseq. I’m placing this in this thread, because this is the most popular result no matter how i try to search my question. I’m hoping if I get an answer it will benefit others. At least they will see that someone else has the same question.

I want to import an individual .md file to create a new page in Logseq. I don’t want to create a whole new graph. I have one already. The [import] menu item on the right side is deceptive. I think its fair to assume that single pages could be imported. But the link yields this graphic:

Which continues the deception. While the screen says “If they are in a JSON, EDN or Markdown format Logseq can work with them.” There is no ability to import MD files. All three of those options reject my markdown.
I don’t want to have to dig into my ~/logseq/pages directory and manually drop my files there. Why isn’t there a simple add .md file to my graph feature? It’s also interesting that no one has made a plug in to do this. If I could code, I would consider that an additional contribution beyond my $15 a month.

Is there some secret I can’t find in my documentation searches?
Am I the only one that has this need?
[happy to repost this as a new topic if the mods request, or if this is ignored for too long.]

You mention the solution in your post: If you place individual Markdown files in the pages folder (which is inside your graph folder) and re-index, those pages will appear in your graph. There is currently no other way.

The import feature you show is to import files from other app (that don’t use Markdown). But the fact Markdown is mentioned can indeed be confusing and it would indeed be easier to just “upload” single files via this screen. I’ll forward this to the devs as feedback.

2 Likes

Thanks for making that clear Ramses. I know the “solution” is in my post. I don’t like it. It is a clunky work around for a missing feature; basic MD importing. I guess I should make a feature request.

Drag and dropping a file in Logseq should be handled in a smart way, for example if it’s a .md file display a confirmation dialog to add it as a new page, if it is a JSON, EDN etc ask if you want to try to import or adding the file to the asset folder, if it is another kind including images ask only the latter.

2 Likes

Thank you, that’s a great suggestion.

I’ve forwarded your feedback to @tienson and @futurized.

1 Like