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
331 stars 14 forks source link

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

Closed bimawa closed 3 years ago

bimawa commented 3 years ago

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?

nobiot commented 3 years ago

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.

bimawa commented 3 years ago

Ohh ok.

searene commented 2 years ago

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)))