nobiot / md-roam

Use Org-roam with markdown files by adding Md-roam as a plug-in. Mix org and markdown files in a single Org-roam database.
GNU General Public License v3.0
333 stars 15 forks source link

(help) Doom Emacs setup #60

Closed vctrblck closed 2 years ago

vctrblck commented 2 years ago

I have org-roam version 2 and org-roam-ui setup with Doom Emacs. How can I add md-roam to this setup?

ehamberg commented 2 years ago

@vctrblck This is the setup I use: https://github.com/nobiot/md-roam/issues/59#issuecomment-982770650

nobiot commented 2 years ago

@ehamberg Thank you 🙏 @vctrblck I suggest you try @ehamberg’s config. I don’t use Doom so I can’t really help you in detail.

vctrblck commented 2 years ago

I appreciate the assistance!

I have given it a try (included @ehamberg's config). I evaluate org-roam-node-find. I input the node title. Hit enter. I then get the message 'peculiar error' in the echo area . Any idea what the cause may be?

nobiot commented 2 years ago

No idea. I have never seen it in the context of Md-roam. You’d need to give us more detail.

  1. Does Org-roam work without Md-roam?
  2. How do you configure Org-roam (+roam2 flag or manual config in Doom)?
  3. Do you get an error stack (toggle-debug-on-error and then do the same operation)?
vctrblck commented 2 years ago

Thanks for the togge-debug-on-error. The issue wasn't md-roam related.

Last thing, is the org properties drawer supposed to be visible/present in the markdown version of the org-roam node or is it only supposed to be the YAML front matter? If so, any recommendations as to how I can remove it?

nobiot commented 2 years ago

I don’t understand what you mean. Could you explain, please?

vctrblck commented 2 years ago

In my understanding:

Each org-roam node is a .org file which has a "PROPERTIES" section at the top of the file. When I use md-roam, each org-roam node is a .md file that has a YAML front matter section at the top of the file (meaning the "PROPERTIES" section is excluded), am I correct? On my side, the org-roam node is a .md file - due to the md-roam configuration - but it has both the "PROPERTIES" section and the YAML front matter section. Is this the intended behaviour?

nobiot commented 2 years ago

but it has both the "PROPERTIES" section and the YAML front matter section. Is this the intended behaviour?

I am guessing that you are talking about the result of org-roam-node-find or org-roam-capture to create a new node. Correct? The property drawer with the ID property is added by Org-roam, so it's not an intended behaviour of Md-roam but it's expected.

There are many ways to create a markdown file, so one option to avoid this is to not use these Org-roam commands. Org-roam has been refining how this part of the capture process works; I have yet to figure out the best way to stop it from adding the ID when the captured buffer is for Md-roam.

One way is to do something like this below. It works on my end.

(add-hook 'org-roam-capture-new-node-hook #'my/md-roam-remove-id-prop)

(defun my/md-roam-remove-id-prop ()
  (when (string-suffix-p ".md" (buffer-name))
    (org-delete-property "ID")))
vctrblck commented 2 years ago

I understand now. I'll have to do some tinkering on my end.

I appreciate the assistance!

nobiot commented 2 years ago

@vctrblck You can also try the latest commit that I addressed the issue for myself. I'm hoping that it'll work for Doom, too.

nobiot commented 2 years ago

cc @ehamberg

vctrblck commented 2 years ago

Will do 👌🏿