I need to include the content of an org file (or a specific section) into my main org file, similarly to what I do in Obsidian with
![[File#Section]]
I've tried this, but it requires export:
#+INCLUDE: "~/sync/org/notes/perso/orglearn.org"
I've also tried this, but it requires code execution with C-c C-c:
In my emacs config file:
(defun my/org-include-file (file)
"Include the content of FILE in the current buffer."
(insert (format "#+BEGIN_EXAMPLE\n%s\n#+END_EXAMPLE"
(with-temp-buffer
(insert-file-contents file)
(buffer-string)))))
In my file:
#+BEGIN_SRC emacs-lisp :results silent
(my/org-include-file "~/sync/org/notes/perso/orglearn.org")
#+END_SRC
Can you please guide me to have automated inclusion?
Thanks!