-
Notifications
You must be signed in to change notification settings - Fork 9
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
Review, refine citar-org-roam--create-capture-note
#2
Comments
I can help get this working when I'm done with emacs-citar/citar#634 and have some more bandwidth. I don't use Org-Capture myself, but I it has some features that the create-note function in Citar doesn't. For example, it can store notes as sub-headings inside a single file, insert the last stored Org link, prompt for certain template fields that are expanded within the note, etc. |
OK, those are good reasons to keep it and fix it then. It occurs to me also, as I noted in an edit above, that if possible, it'd be good to be able to add a ref note from org, using capture. So I merged that branch to main. I did add back the I go back-and-forth on whether this should be in citar, but am leaning towards keeping it here, since I don't really know how it will evolve, and it could be good to keep it independent. PS - I sent you an invite to the org, just in case it's easier to manage permissions, if it should be useful. |
Hi, I gave this a look and I am pretty sure there is a small mistake in the function. Aren't the :node and :props arguments supposed to go to
I have tinkered a bit with the org-roam capture system (mainly for making my own specialized templates) so I can probably help with this, but I have 2 questions. I wanted to run this function as a test to try its behavior but I am a bit confused with the |
Probably easier to show you; (defun citar-open-notes (keys)
"Open notes associated with the KEYS."
(interactive (list (citar-select-refs)))
(dolist (key keys)
(let ((entry (citar-get-entry key)))
(funcall
(citar--get-notes-config :action) key entry))))
Its limitations are my limitations; specifically my lack of knowledge of org/roam-capture. I just tried to adapt Jethro's minimal example. So if you'd like to submit a PR with those "other cool things", I'd love to see it! EDIT: I think, ideally, the same function would open existing notes or create new ones (using |
I see, I will probably play around with this more and suggest anything I come up with. |
This comment was marked as outdated.
This comment was marked as outdated.
citar-org-roam--create-note
citar-org-roam--open-capture-note
Also, just realized there was a bug on the citar side, that I just fixed. Turning on I just added a screenshot to the README. EDIT: the basics now work; both open existing (by id) and creating new (by citekey, via capture) notes. |
citar-org-roam--open-capture-note
citar-org-roam--create-capture-note
Hi! Wouldn't there be a way to simply use the default |
IDK. Why I was asking for help here.
Sure; it's a defcustom. Or did you mean something different? |
A couple of things: if you set the I was able to get the 'orb-citar-edit-note to work as I was expecting by calling it directly from the
I have tried to set it from my configuration file but it doesn't work from there, and this is most likely due to my ignorance in elisp (is there way to simply access the |
I'll fix the spurious "/". Should be set to
Edit: sorry. I misread. Utimately, orb will probably be its own note source, so you would just choose that for You may be able use |
Fixed. If you don't want to use a subdir, set that value to
Yes; that's just how it works ATM. If we know we're creating a bibliographic note here, because calling Or is the idea that one might want to do this from org-roam? If yes, that's one of the enhancements I don't know how to implement, and I don't have time ATM to figure it out. Perhaps the others in this thread can. But I do think there are some UX issues to think about. Like, if one clicks on a citation within an org-roam document, which runs I think it can indeed just, as it would now, be In fact, it should work now, if you have So we cover now two note-opening/creating contexts that work with org-roam:
Would you need to create a bibliographic note in some other context, then? If from org-roam, via the capture menu, what benefit does that provide, and could that not just call Maybe if one wanted more than one template for bibliographic notes? I do know @roshanshariff had some ideas, however, to enhance this function. Perhaps he could weigh in here? |
I know that Org Capture is a very user-oriented feature and doesn't easily allow other packages to participate in the note formatting (for example to extend its template system, except by including arbitrary Elisp code). Org-Roam-Bibtex goes to heroic lengths to make it possible. When I have some time, I'm planning to look into whether there's a way to do it without quite so much complexity, but it will probably involve some trade-offs. For example, you might have to invoke a Citar-specific capture command instead of |
What value does the capture menu provide for this particular use case, however?
|
I don't personally use Org Capture very much, but I can imagine how its features might fit into someone's workflow:
Pretty much any time you otherwise want to use Org Capture, but would like the template to be filled in using data from a Citar reference. |
I totally agree with @roshanshariff. I also like the way in which Org Capture lets you preemptively confirm or discard the new buffer without automatically saving it. Plus, people that integrated Org Capture in their workflow might like at least to have the option of using their general templates even with Citar... |
Maybe we should have two notes sources:
Or a single one, with additional defcustom to choose? I still don't understand how the UX would work on the second though. |
Here are some pictures of my UX. Two more things:
|
Thanks for the screenshots! Except, there you only have one bibliographic template; so what's the value of the capture menu there?
As I mentioned to you earlier (twice): has to be set to |
Sorry, my bad! Thanks!
… Il giorno 19 lug 2022, alle ore 12:33, bdarcus ***@***.***> ha scritto:
Thanks for the screenshots!
2. If I try to create a note with the standard citar-org-roam--create-capture-note command, after setting the citar-org-roam-subdir to "",
As I mentioned to you earlier (twice): has to be set to nil ;-)
—
Reply to this email directly, view it on GitHub <#2 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AONRCSKJRYX7BQH35LURWXLVUZ767ANCNFSM5ZX3AV5A>.
You are receiving this because you commented.
|
I do also want to mention that ORB will be supporting the new citar note API, and could in theory even use parts of this package. So these are potentially complementary. And to go back to your other point above:
You have two options ATM:
I'm not sure if @roshanshariff has any thoughts about how we should handle this piece. I was really contemplating two options:
IDK myself. This is still kind of an experimental package at this point, that we put together to test out what we needed for the new citar notes API. It still needs a bit of work before we release it more formally. |
Granting there's more work to be done here, anyone see any problem with announcing this and submitting to MELPA along with citar 1.0 (soon)? It's functional and bug-free; no? |
@lazzalazza - can you try this please; preferably today or tomorrow (the weekend)? I want to recommend this to folks whose configs break :-) (citar-register-notes-source
'orb-citar-source
(list :name "Org-Roam Notes"
:category 'org-roam-node
:items #'citar-org-roam--get-candidates
:hasitems #'citar-org-roam-has-notes
:open #'citar-org-roam-open-note
:create #'orb-citar-edit-note
:annotate #'citar-org-roam--annotate))
(setq citar-notes-source 'orb-citar-source) |
Hi! I put the last line of code in my config file and the rest of it in citar-org-roam.el and it works like a charm (there's an extra parens at the end though)...
Thank you so much!
… Il giorno 6 ago 2022, alle ore 13:17, bdarcus ***@***.***> ha scritto:
@lazzalazza <https://github.com/lazzalazza> - can you try this?
(defconst orb-citar-source
(list :name "Org-Roam Notes"
:category 'org-roam-node
:items #'citar-org-roam--get-candidates
:hasitems #'citar-org-roam-has-notes
:open #'citar-org-roam-open-note
:create #'orb-citar-edit-note
:annotate #'citar-org-roam--annotate))
(citar-register-notes-source
'orb-citar-source)
(setq citar-notes-source 'orb-citar-source))
—
Reply to this email directly, view it on GitHub <#2 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AONRCSIHU2FVJNYMTCZZF53VXZCTZANCNFSM5ZX3AV5A>.
You are receiving this because you were mentioned.
|
Really the only change should be using ORB to create new notes. Is that the case? |
It is! It works!
… Il giorno 6 ago 2022, alle ore 14:41, bdarcus ***@***.***> ha scritto:
Really the only change should be using ORB to create new notes. Is that the case?
—
Reply to this email directly, view it on GitHub <#2 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AONRCSOO2ZTEUBJKFHDL5F3VXZMQJANCNFSM5ZX3AV5A>.
You are receiving this because you were mentioned.
|
This comment was marked as outdated.
This comment was marked as outdated.
I wonder if there are tweaks to upstream that could make this easier? |
I am trying to integrate citar/citar-org-roam with org-roam's capture functionality. I am not sure what exact solution has been arrived at on this issue. I see that you have provided the internal function The key difference I see between this function and the one in https://jethrokuan.github.io/org-roam-guide/ is that Jethro's method of accessing the citekey and entry as the |
Ideally we can modify
If you have the key, you can get its entry with But the citar functions that open notes already pass the key and entry to these note functions. In the meantime, see: https://github.com/emacs-citar/citar/wiki/Notes-configuration#org-roam-bibtex |
|
This function is adapted from @jethrokuan's post:
https://jethrokuan.github.io/org-roam-guide/#orgc48eb0d
I'm not super familiar with the org-roam capture system, so would help if someone who is can review this and suggest any changes.
Aside from fixing the variable bug noted in the code, it might be nice if this was accessible and configurable from
org-roam-capture
, which it isn't now. Per below, I'm still unsure of the ideal UI and config details here.Note: this reflects changes in emacs-citar/citar#634; also, org citations aren't allowed in property drawers, so I changed that.
The text was updated successfully, but these errors were encountered: