Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a file+olp capture template example to the wiki #39

Open
bdarcus opened this issue Apr 2, 2023 · 4 comments
Open

Add a file+olp capture template example to the wiki #39

bdarcus opened this issue Apr 2, 2023 · 4 comments

Comments

@bdarcus
Copy link
Contributor

bdarcus commented Apr 2, 2023

Anyone have a good example template to include here, that when creating a new note, will create a new heading in a pre-specified org file?

https://github.com/emacs-citar/citar-org-roam/wiki/capture-templates

Bonus points if one can (optionally?) select from multiple target files. EDIT: I don't see that this is possible.

@bdarcus bdarcus changed the title Add a file+olp capture template example to the README or wiki Add a file+olp capture template example to the wiki Apr 2, 2023
@45mg
Copy link

45mg commented Jan 29, 2024

Couldn't figure out how to add to the wiki, so I'm leaving this here.

Capture to specific heading, prompting for file

The following capture template will capture to a heading whose name is the entry's title, creating it if it doesn't exist, in a filename read from the user:

("@" "literature note" plain
 "%?"
 :target
 (file+olp
  "%(read-file-name \"Enter file to add note to:\")"
  ("${citar-title}"))
 :unnarrowed t :hook org-id-get-create)

:hook is documented in org-capture-templates. We use it to turn the heading into a node if it isn't already one, so that citar-org-roam--create-capture-note adds the ref to it. Without this, the ref will be added to a higher-level node if there is one.

@bdarcus
Copy link
Contributor Author

bdarcus commented Jan 29, 2024

Couldn't figure out how to add to the wiki, so I'm leaving this here.

Thanks much! I forgot to open up editing permissions, now fixed.

But I added your content here:

https://github.com/emacs-citar/citar-org-roam/wiki/capture-templates#capture-to-specific-heading-prompting-for-file

@45mg
Copy link

45mg commented Jan 30, 2024

Great, thanks.

Maybe mention/link this in the README? I wouldn't have known about the wiki if you hadn't linked it here.

@bdarcus
Copy link
Contributor Author

bdarcus commented Jan 30, 2024

Done!

7d67dcc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants