nobiot/md-roam

How to select what type should I insert note .org or .md

bimawa opened this issue · 3 comments

After read issue #49 . I found the next solution for force file, which I insert, create with .md format:

(setq org-roam-file-extensions '("md" "org"))

But md-roam is addon for org-roam. And I use it only for documentations, but notes I prefer hold in org files. How can I select the type of file for org-roam?

I just create some notes as .org files; others, .md files. I don't use org-roam-capture or org-roam-find-file to create new notes.

Ohh ok.

I found a solution to select a file type each time I insert a note using org-roam-node-insert. Just add the following code to your config file:

(add-to-list 'org-roam-capture-templates
      '("m" "Markdown" plain "" :target
          (file+head "%<%Y-%m-%dT%H%M%S>.md"
  "---\ntitle: ${title}\nid: %<%Y-%m-%dT%H%M%S>\ncategory: \n---\n")
      :unnarrowed t))

Here is my complete configuration, I'd be happy if it's helpful to anyone.

(use-package! md-roam
  :after (org-roam)
  :demand t
  :custom
  (org-roam-file-extensions '("md" "org"))
  :config
  ;; md-roam-mode must be active before org-roam-db-sync
  (md-roam-mode 1)
  ;; autosync-mode triggers db-sync. md-roam-mode must be already active
  (org-roam-db-autosync-mode 1)
  (add-to-list 'org-roam-capture-templates
      '("m" "Markdown" plain "" :target
          (file+head "%<%Y-%m-%dT%H%M%S>.md"
  "---\ntitle: ${title}\nid: %<%Y-%m-%dT%H%M%S>\ncategory: \n---\n")
      :unnarrowed t)))