progfolio / doct

DOCT: Declarative Org Capture Templates for Emacs
GNU General Public License v3.0
375 stars 8 forks source link

Documentation update to explain `:datetree` needs `:olp` not `:headline` #30

Closed seanhagen closed 2 years ago

seanhagen commented 2 years ago

I'm trying to set up my Org config so I'm using doct -- so far, it's pretty awesome!

However, I got stuck trying to move my file+olp+datetree capture targets to doct.

I thought that this would work:

(setq org-capture-templates
      (doct
       '(("Top Level Date-Tree Test 1"
          :keys "m" 
          :file "~/date-tree-test.org"
          :headline "Meetings"
          :datetree t
          :template "* SCHEDULED %^{Meeting Title} \n%?"
          :jump-to-captured t)
         ("Child Date-Tree Tests"
          :keys "p"
          :children (("Child Test 1"
                      :keys "m" 
                      :file "~/date-tree-test.org" 
                      :type entry
                      :headline "Meetings"
                      :datetree t
                      :template "* SCHEDULED %^{Meeting Title} \n%?"
                      :jump-to-captured t))
          ))))

But it wasn't working and I couldn't figure out why. It kept creating a date-tree at the bottom of the file as a new top-level heading instead of putting the date-tree under the headline I specified.

I didn't find out that to specify a heading with :datetree you need to use :olp ("Heading") instead of :headline "Heading" until I found this on Reddit. Is that how it's supposed to work, or is that a bug?

If that's how it's supposed to work then I can do a PR to update the README so it's clear, but I wanted to check first.

progfolio commented 2 years ago

I'm trying to set up my Org config so I'm using doct -- so far, it's pretty awesome!

Thank you. Glad you're finding it useful.

didn't find out that to specify a heading with :datetree you need to use :olp ("Heading") instead of :headline "Heading" until I found this on Reddit. Is that how it's supposed to work, or is that a bug?

That's the intended behavior. If you take a look at the target section of the documentation for org-capture-templates, you'll see there is no file+headline+datetree target type.

If that's how it's supposed to work then I can do a PR to update the README so it's clear, but I wanted to check first.

I've added a note to the docs: https://github.com/progfolio/doct/commit/ce21bce19b91e6f1dfc1f23983b4b8ce4464c8f5

Let me know if that helps.

progfolio commented 2 years ago

Closing this on the assumption that the issue has been cleared up. If not, feel free to comment and we can reopen.